[Insight-users] Resampling for registration output.

Li, George (NIH/NCI) ligeorge at mail.nih.gov
Mon Jan 31 10:32:17 EST 2005


Hi, Luis and ITK users:

I have been using VersorRigid3DTransform<double> and
VersorRigid3DTransformOptimizer with Mattes metric to do
a 3D image registration. However, at the end, I cannot
get the registered image out by ResampleImageFilter.

I compared the moving image with and without resampling,
They are identical. But, the finalRegistrationResults
indicate a versor of [0.20, 0.43, 0.31] and translation
of [-0.9379, -3.4445, -1.3853]. For your information, the
visualization I used is sensitive to any single voxel 
change. So, it is expected to see the small difference
between initial moving image and final resampled moving
image.

I posted the code below, which is modified from the #4
example of registration with Mattes mutual information:

// Do registration first and save the registration in the
// finalParameters for resampling.

	typedef itk::ResampleImageFilter<ImageType, ImageType>
ResampleFilterType;
	ResampleFilterType::Pointer resample = ResampleFilterType::New();
	resample->SetInput( movingImage );

	// Align moving image to fixed image.
	TransformType::Pointer finalTransform = TransformType::New();
	finalTransform->SetParameters( finalParameters );
	resample->SetTransform( finalTransform );
	resample->SetInterpolator(interpolator); // default. 

	resample->SetSize( fixedImage->GetLargestPossibleRegion().GetSize()
);
	resample->SetOutputOrigin( fixedImage->GetOrigin() );
	resample->SetOutputSpacing( fixedImage->GetSpacing() );

	PixelType defaultPixelValue = 0;
	resample->SetDefaultPixelValue( defaultPixelValue );

	resample->Update();

// Use resample->GetOutput() to feed my data output and
// Visualization code.

I assumed that I can directly use the finalParameters
as is to feed the resampleImageFilter, and the voxel
size is isotropic with interpolation among slices in z
dimension, in both registration and resampling.

Please let me know if you can help, or provide guidance.

Thanks,

George


More information about the Insight-users mailing list