[Insight-users] Poor results with the BSplineDeformableTransform
motes motes
mort.motes at gmail.com
Thu Nov 12 06:19:50 EST 2009
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?
More information about the Insight-users
mailing list