[Insight-users] Poor results with the BSplineDeformableTransform

Luis Ibanez luis.ibanez at kitware.com
Sun Nov 15 14:26:15 EST 2009


Hi Motes,

There are still many other reasons why the registration
may not be working as expected.

You still should consider fine tunning the Optimizer parameters.

For example:

      Was "500" the maximum number of iterations ?

If so, then, the optimizer didn't really converged,
it simply ran out of iterations.

Plotting the Metric values versus the Iteration number is
usually a good way of verifying if the optimizer is really
converging.

BTW: What optimizer are you using ?


     Thanks


            Luis


------------------------------------------------------------------------------------
On Thu, Nov 12, 2009 at 6:19 AM, motes motes <mort.motes at gmail.com> wrote:
> I have made a know deformation of lena using the BSplineWarping1.cxx
> with this input (12*12 nodes on the image. Since I use cubic BSpline
> this gives a total of 15*15 nodes):
>
>
>    0   0       0   0       0   0        0   0       0   0        0
> 0       0   0      0   0      0   0       0   0       0   0        0
> 0       0   0        0   0       0   0
>
>    0   0       0   0       0   0        0   0       0   0        0
> 0       0   0      0   0      0   0       0   0       0   0        0
> 0       0   0        0   0       0   0
>
>    0   0       0   0       0   0        0   0       0   0        0
> 0       0   0      0   0      0   0       0   0       0   0        0
> 0       0   0        0   0       0   0
>
>    0   0       0   0       0   0        0   0       0   0        0
> 0       0   0      0   0      0   0       0   0       0   0        0
> 0       0   0        0   0       0   0
>
>    0   0       0   0       0   0        0   0       0   0        0
> 0       0   0      0   0      0   0       0   0       0   0        0
> 0       0   0        0   0       0   0
>
>    0   0       0   0       0   0        0   0       0   0        0
> 0       0   0      0   0      0   0       0   0       0   0        0
> 0       0   0        0   0       0   0
>
>    0   0       0   0       0   0        0   0       0   0        0
> 0       0   0    -10  20     10  20       0   0      0   0        0
> 0       0   0        0   0       0   0
>
>    0   0       0   0       0   0        0   0       0   0        0
> 0       0   0      0   0      0   0       0   0       0   0        0
> 0       0   0        0   0       0   0
>
>    0   0       0   0       0   0        0   0       0   0        0
> 0       0   0    -10  -0    10  -20       0   0      0   0        0
> 0       0   0        0   0       0   0
>
>    0   0       0   0       0   0        0   0       0   0        0
> 0       0   0      0   0      0   0       0   0       0   0        0
> 0       0   0        0   0       0   0
>
>    0   0       0   0       0   0        0   0       0   0        0
> 0       0   0      0   0      0   0       0   0       0   0        0
> 0       0   0        0   0       0   0
>
>    0   0       0   0       0   0        0   0       0   0        0
> 0       0   0      0   0      0   0       0   0       0   0        0
> 0       0   0        0   0       0   0
>
>    0   0       0   0       0   0        0   0       0   0        0
> 0       0   0      0   0      0   0       0   0       0   0        0
> 0       0   0        0   0       0   0
>
>    0   0       0   0       0   0        0   0       0   0        0
> 0       0   0      0   0      0   0       0   0       0   0        0
> 0       0   0        0   0       0   0
>
>    0   0       0   0       0   0        0   0       0   0        0
> 0       0   0      0   0      0   0       0   0       0   0        0
> 0       0   0        0   0       0   0
>
>
> In the image registration method I use the following components:
>
>
> typedef itk::BSplineDeformableTransform<CoordinateRepType, Dimension,
> SplineOrder >          TransformType;
> typedef itk::MeanSquaresImageToImageMetric< FixedImageType,
> MovingImageType >              MetricType;
> typedef itk::LinearInterpolateImageFunction< MovingImageType, double >
>                                InterpolatorType;
> typedef itk::RegularStepGradientDescentOptimizer
>                                    OptimizerType;
>
> I setup the  transform as shown below (8*8 nodes on the image. Since I
> use cubic BSpline this gives a total of 12*12 nodes):
>
>    gridSizeOnImage.Fill(8);
>    gridBorderSize.Fill(3);    // Border for spline order = 3 ( 1
> lower, 2 upper )
>
>    //gridSizeOnImage.Fill( 5 );
>    //gridBorderSize.Fill( 3 );    // Border for spline order = 3 ( 1
> lower, 2 upper )
>
>    totalGridSize = gridSizeOnImage + gridBorderSize;
>    bsplineRegion.SetSize( totalGridSize );
>    for(unsigned int r=0; r<Dimension; r++) {
>      spacing[r] *= static_cast<double>(fixedImageSize[r] - 1)  /
>        static_cast<double>(gridSizeOnImage[r] - 1);
>    }
>    SpacingType gridOriginOffset = gridDirection * spacing;
>    OriginType gridOrigin = origin - gridOriginOffset;
>    transform->SetGridSpacing(spacing);
>    transform->SetGridOrigin(gridOrigin);
>    transform->SetGridRegion(bsplineRegion);
>    transform->SetGridDirection(gridDirection);
>    const unsigned int numberOfParameters = transform->GetNumberOfParameters();
>    ParametersType parameters(numberOfParameters);
>    parameters.Fill(0.0);
>    transform->SetParameters(parameters);
>    registration->SetInitialTransformParameters(transform->GetParameters());
>
> After 500 iterations the metric outputs 35.85 and the result can be seen below:
>
> http://37133.vs.webtropia.com/apache2-default/test3.jpg
>
>
> But is that not a rather poor result when taking into consideration
> that it has run for 500 iterations? Or is it because I used a finer
> resolution when creating the moving image than when running the image
> registration method?
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list