[Insight-users] about itkResampleImageFilter

Yixun Liu yxliu at fudan.edu.cn
Tue Jul 25 22:09:23 EDT 2006


Hi,

The fixedImage and the movingImage have the same spacing, origin, and size. Both are 256 x 256 x 48. I use the grid with size 256 x 256 x 1 and start index (0,0,24) as the resample grid. I do as below,

typedef itk::Image<short, 3> ImageType;
typedef itk::ResampleImageFilter<ImageType, ImageType>  ResampleFilterType;
ResampleFilterType::Pointer resampler = ResampleFilterType::New();

 resampler->SetTransform( transform );
// resampler->SetInterpolator(this->interpolator);
 resampler->SetInput( movingImage );
 size =  fixedImage->GetLargestPossibleRegion().GetSize();
 size[2] = 1;
 index[2] = 24;
 index[0] = index[1] = 0;
 this->resampler->SetSize(size);
 this->resampler->SetOutputStartIndex(index);
 this->resampler->SetOutputOrigin(  fixedImage->GetOrigin() );
 this->resampler->SetOutputSpacing( fixedImage->GetSpacing() );
 this->resampler->SetDefaultPixelValue( 100 );
 this->resampler->Update();

I use a identity transform. However, when I show the resampled image, it roate 90 degree relative to the correct position. I am confused about it.

Regards,

Yixun Liu


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060726/0a9ea279/attachment.htm


More information about the Insight-users mailing list