diff --git a/Python/60_Registration_Introduction.ipynb b/Python/60_Registration_Introduction.ipynb index 968a53ea..5e124ec3 100644 --- a/Python/60_Registration_Introduction.ipynb +++ b/Python/60_Registration_Introduction.ipynb @@ -6,9 +6,10 @@ "source": [ "# Introduction to SimpleITKv4 Registration \n", "\n", - "**SimpleITK conventions:**\n", - "* Dimensionality and pixel type of registered images is required to be the same (2D/2D or 3D/3D).\n", - "* Supported pixel types are sitkFloat32 and sitkFloat64 (use the SimpleITK [Cast](http://www.simpleitk.org/doxygen/latest/html/namespaceitk_1_1simple.html#af8c9d7cc96a299a05890e9c3db911885) function if your image's pixel type is something else).\n", + "First, a reminder of some SimpleITK conventions:\n", + "* The dimensionality of images being registered is required to be the same (ie. 2D/2D or 3D/3D).\n", + "* The pixel type of images being registered is required to be the same.\n", + "* Supported pixel types for images being registered are sitkFloat32 and sitkFloat64. You can use the SimpleITK [Cast](http://www.simpleitk.org/doxygen/latest/html/namespaceitk_1_1simple.html#af8c9d7cc96a299a05890e9c3db911885) function if your image's pixel type is something else.\n", "\n", "## Registration Components \n", "\n", @@ -16,11 +17,11 @@ "\n", "There are many options for creating an instance of the registration framework, all of which are configured in SimpleITK via methods of the ImageRegistrationMethod class. This class encapsulates many of the components available in ITK for constructing a registration instance.\n", "\n", - "Currently, the available choices from the following groups of ITK components are:\n", + "Here is a list of currently available choices for each group of components:\n", "\n", "### Optimizers\n", "\n", - "The SimpleITK registration framework supports several optimizer types via the SetOptimizerAsX() methods, these include:\n", + "Several optimizer types are supported via the `SetOptimizerAsX()` methods. These include:\n", "* [Exhaustive](http://www.itk.org/Doxygen/html/classitk_1_1ExhaustiveOptimizerv4.html)\n", "* [Nelder-Mead downhill simplex](http://www.itk.org/Doxygen/html/classitk_1_1AmoebaOptimizerv4.html), a.k.a. Amoeba\n", "* [Powell optimizer](https://itk.org/Doxygen/html/classitk_1_1PowellOptimizerv4.html)\n", @@ -31,13 +32,12 @@ " * [RegularStepGradientDescent](http://www.itk.org/Doxygen/html/classitk_1_1RegularStepGradientDescentOptimizerv4.html)\n", "* [ConjugateGradientLineSearch](http://www.itk.org/Doxygen/html/classitk_1_1ConjugateGradientLineSearchOptimizerv4Template.html)\n", "* [L-BFGS2](https://itk.org/Doxygen/html/classitk_1_1LBFGS2Optimizerv4.html) (Limited memory Broyden, Fletcher, Goldfarb, Shannon)\n", - "* [L-BFGS-B](http://www.itk.org/Doxygen/html/classitk_1_1LBFGSBOptimizerv4.html) (Limited memory Broyden, Fletcher,Goldfarb,Shannon-Bound Constrained) - supports the use of simple constraints ($l\\leq x \\leq u$) \n", + "* [L-BFGS-B](http://www.itk.org/Doxygen/html/classitk_1_1LBFGSBOptimizerv4.html) (Limited memory Broyden, Fletcher, Goldfarb, Shannon - Bound Constrained) - supports the use of simple constraints.\n", "\n", "\n", - " \n", "### Similarity metrics\n", "\n", - "The SimpleITK registration framework supports several metric types via the SetMetricAsX() methods, these include:\n", + "Several metric types are supported via the `SetMetricAsX()` methods. These include:\n", "* [MeanSquares](http://www.itk.org/Doxygen/html/classitk_1_1MeanSquaresImageToImageMetricv4.html)\n", "* [Demons](http://www.itk.org/Doxygen/html/classitk_1_1DemonsImageToImageMetricv4.html)\n", "* [Correlation](http://www.itk.org/Doxygen/html/classitk_1_1CorrelationImageToImageMetricv4.html)\n", @@ -48,8 +48,8 @@ "\n", "### Interpolators\n", "\n", - "The SimpleITK registration framework supports several interpolators via the SetInterpolator() method, which receives one of\n", - "the [following enumerations](http://www.simpleitk.org/doxygen/latest/html/namespaceitk_1_1simple.html#a7cb1ef8bd02c669c02ea2f9f5aa374e5):\n", + "Several interpolators are supported via the `SetInterpolator()` method, which can take one of\n", + "the following interpolators:\n", "* sitkNearestNeighbor \n", "* sitkLinear\n", "* sitkBSpline1, sitkBSpline2, sitkBSpline3, sitkBSpline4, sitkBSpline5, where the number denotes the spline order, with sitkBSpline3 being the go-to option.\n", @@ -60,9 +60,12 @@ "* sitkLanczosWindowedSinc\n", "* sitkBlackmanWindowedSinc\n", "\n", + "See the [list of interpolators in the API reference]((http://www.simpleitk.org/doxygen/latest/html/namespaceitk_1_1simple.html#a7cb1ef8bd02c669c02ea2f9f5aa374e5)) for more information\n", + "\n", + "\n", "## Data - Retrospective Image Registration Evaluation\n", "\n", - "We will be using part of the training data from the Retrospective Image Registration Evaluation ([RIRE](https://rire.insight-journal.org/)) project." + "In this notebook will be using part of the training data from the Retrospective Image Registration Evaluation ([RIRE](https://rire.insight-journal.org/)) project." ] }, { @@ -89,7 +92,7 @@ "metadata": {}, "source": [ "## Utility functions\n", - "A number of utility callback functions for image display and for plotting the similarity metric during registration." + "First we define a number of utility callback functions for image display and for plotting the similarity metric during registration." ] }, { @@ -105,8 +108,8 @@ "from IPython.display import clear_output\n", "\n", "\n", - "# Callback invoked by the interact IPython method for scrolling through the image stacks of\n", - "# the two images (moving and fixed).\n", + "# Callback invoked by the IPython interact method for scrolling through image stacks of\n", + "# the two images being registered.\n", "def display_images(fixed_image_z, moving_image_z, fixed_npa, moving_npa):\n", " # Create a figure with two subplots and the specified size.\n", " plt.subplots(1, 2, figsize=(10, 8))\n", @@ -185,7 +188,7 @@ "source": [ "## Read images\n", "\n", - "We first read the images, casting the pixel type to that required for registration (Float32 or Float64) and look at them." + "Now we can read the images, casting the pixel type to that required for registration (Float32 or Float64) and have a look at them." ] }, { @@ -212,7 +215,7 @@ "source": [ "## Initial Alignment\n", "\n", - "Use the CenteredTransformInitializer to align the centers of the two volumes and set the center of rotation to the center of the fixed image." + "To set sensible default values for the centre of rotation and initial translation between the two images, the CenteredTransformInitializer is used to align the centers of the two volumes and set the center of rotation to the center of the fixed image." ] }, { @@ -252,31 +255,23 @@ "source": [ "## Registration\n", "\n", - "The specific registration task at hand estimates a 3D rigid transformation between images of different modalities. There are multiple components from each group (optimizers, similarity metrics, interpolators) that are appropriate for the task. Note that each component selection requires setting some parameter values. We have made the following choices:\n", - "\n", - "