[Insight-users] itk ResampleImageFilter??

suresh suresh " <suresh_kb@rediffmail.com
8 Nov 2002 12:44:24 -0000


Hi luis,

About itk ResampleImageFilter..

I have an image of size 256X256X120 which i subsampled to 
128X128X60.
(I just dropped alternate pixels in all the three directions for 
subsampling).

Now i tried to interpolate the image using ResampleImageFilter 
with the following code.
my expectaion is the output should of original size.

      typedef itk::AffineTransform<double, 3> TransformType;
      typedef itk::ResampleImageFilter<UCharImage, UCharImage>  
ResampleFilter;

      ResampleFilter::Pointer resampleFilter = 
ResampleFilter::New();
      TransformType::Pointer transform = TransformType::New();
      transform->SetIdentity();
      UCharImage::Pointer outImage  = NULL;
      resampleFilter ->SetTransform(transform.GetPointer());
      resampleFilter->SetInput(subImage);    // sub sampled 
image
      // mri Image is my original image 256X256X120
      resampleFilter->SetSize( 
mriImage->GetLargestPossibleRegion().GetSize() );
      resampleFilter->SetOutputOrigin(mriImage->GetOrigin());
      resampleFilter->SetOutputSpacing(mriImage->GetSpacing());

 	try
 	{
 		resampleFilter->Update();

 	}catch(itk::ExceptionObject &Eo){
 		AfxMessageBox(Eo.GetDescription());
 	}
 	outImage   = resampleFilter->GetOutput();

//////////////////////////////////////////////////////////////

The input image and the result  image is at this url

  http://www.cspl.org/Resample.htm

The out put image buffer size is growing but the image size is 
reduced to 1/4th.

Can please explain what is happening here.Is my expectation 
correct.?
Is it a bug ResampleImageFilter or the interpolatar??
please help me with this.

Thanks

suresh