[Insight-users] problems with resample filter

Bryn Alexander Lloyd blloyd at bwh.harvard.edu
Wed May 25 19:09:40 EDT 2005


Hi,

I am trying to use the itk::ResampleImageFilter to upsample an image.
As an example I would like create an image with 256x256 pixels from an
image with 50x50 pixels.

For some reason if I try to access the output image data with an iterator,
I get a segmentation fault.
The same happens if I try to write an image after setting the
BufferedRegion to the LargestPossibleRegion. (It seems to work if don't
set the region to the largest possible). I am using the
LinearImageInterpolatorFunction.


Why is this? Can anybody help me with this?

Thanks,



  resamplefilter->SetOutputSpacing(Ioriginal->GetSpacing );
  resamplefilter->SetOutputOrigin( Ioriginal->GetOrigin() );

  resamplefilter->SetInput( Isubsampled );
  resamplefilter->Update();
  Inew = resamplefilter->GetOutput();

  //Inew->SetBufferedRegion(Inew->GetLargestPossibleRegion());
  //Inew->SetRequestedRegion(Inew->GetLargestPossibleRegion());

  writer->SetInput( Inew );
  writer->SetFileName("Inew.mhd");
  writer->Update();




More information about the Insight-users mailing list