[Insight-users] ICP Registration

Luis Ibanez luis.ibanez at kitware.com
Sun Aug 12 09:03:23 EDT 2007


Hi Zhixi,

Yes, you can simply use the transform parameter to initialize
the Transform that you will give to the ResampleImageFilter.

Note that you should copy also the Center of rotation of the
transform, but since here you are planning to reuse the transform
object that you employed for the point-based registration, the two
lines that you suggested should do the trick:


   finalTransform->SetParameters( transform->GetParameters() );
   resample->SetTransform( finalTransform );


Please let us know if you find any problems,


   Thanks,


      Luis


-----------------
zhixi wrote:
> 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


More information about the Insight-users mailing list