[Insight-users] about itkResampleImageFilter

Yixun Liu yxliu at fudan.edu.cn
Wed Jul 26 22:13:12 EDT 2006


Hi,

The fixedImage and movingImage 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();

After resampled I change the index from (0,0,24) to (0,0,16). However itk exception throwed. I debug into ITK and found the possiblelargestregion change from (0,0,24) to (0,0,16), but the requestregion still is (0,0,24). The requestregion is not in the range of the possiblelargestregion, so the exception throw. Why not ITK automatically change the requestregion when the largestpossibleregion change? 



Regards,

Yixun Liu


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060727/26d38045/attachment-0001.html


More information about the Insight-users mailing list