[Insight-users] ICP Registration
zhixi
liZhixi at cc.nih.gov
Fri Aug 10 17:19:14 EDT 2007
Hello,
I am trying to do a rigid registration of two 3D images with ICP. Following
the ICP ex. 2 in the patented examples folder, I extracted the surface
points of the two images and passed them into the moving and fixed point
containers. Then, using the euler 3d transform and LevenbergMarquatd
optimizer, the ICP algorithm seems to give me 6 parameters for the final
transform in an array form.
my problem is now the actual resampling of the images.
my specific question is, can I simply pass the transform parameters into the
resampler? Will it know what to do with them?
i.e., with this pathway, where transform->GetParameters() gets me the
transfrom from the ICP.
finalTransform->SetParameters( transform->GetParameters() );
resample->SetTransform( finalTransform );
here is my resampling code:
typedef itk::Image< float, 3 > ImageType_3D;
ImageType_3D::Pointer ITKim_3D1 = ImageType_3D::New();
ImageType_3D::Pointer ITKim_3D2 = ImageType_3D::New();
Copy_CISImage_to_ITKImage(img3Din1, ITKim_3D1);
Copy_CISImage_to_ITKImage(img3Din2, ITKim_3D2);
typedef itk:: NearestNeighborInterpolateImageFunction <ImageType_3D ,
double> InterpolatorType;
InterpolatorType::Pointer interpolator = InterpolatorType::New();
typedef itk::ResampleImageFilter< ImageType_3D, ImageType_3D >
ResampleFilterType;
TransformType::Pointer finalTransform = TransformType::New();
finalTransform->SetParameters( transform->GetParameters() );
ResampleFilterType::Pointer resample = ResampleFilterType::New();
resample->SetTransform( finalTransform );
resample->SetInput( ITKim_3D2);
resample->SetSize( ITKim_3D1->GetLargestPossibleRegion().GetSize() );
resample->SetOutputOrigin( ITKim_3D1->GetOrigin() );
resample->SetOutputSpacing( ITKim_3D1->GetSpacing() );
resample->SetDefaultPixelValue( 1 );
resample->SetInterpolator( interpolator );
resample->Update();
Copy_ITKImage_to_CISImage(resample->GetOutput(), img3Dout );
}
Any help is greatly appreciated,
Zhixi Li
--
View this message in context: http://www.nabble.com/ICP-Registration-tf4251126.html#a12099225
Sent from the ITK - Users mailing list archive at Nabble.com.
More information about the Insight-users
mailing list