[vtkusers] Possible bug in vtkImageResample or vtkImageReslice when doing de mag

Leue, William M (Research) leue at crd.ge.com
Wed Dec 8 16:52:05 EST 2004


Hi, I appear to have found a bug when using vtkImageResample to do image
demagnification. I am guessing the bug is really in vtkImageReslice because
vtkImageResample is just a thin wrapper object. I am using VTK Release
4.2.2.

The bug symptoms are that an image volume that has been demagnified by
approximately a factor of 2 (not exactly) has a small percentage of voxel
values that are outside the range of the input values. The image volume is
CT data with a range of 0..4095. The image data has been converted from the
original unsigned short format to float before demagnification. The output
volume after demagnification has a range of 0..4938. About 1.5% of the
original voxels now have values that are higher than 4095.

A snippet of the relevant code is:

  vtkImageResample* samp = vtkImageResample::New();
  samp->SetInput(voi->GetOutput());
  samp->SetAxisMagnificationFactor(0, xratio);
  samp->SetAxisMagnificationFactor(1, yratio);
  samp->SetAxisMagnificationFactor(2, zratio);
  samp->SetInterpolationModeToCubic();

xratio and yratio are about 2.0916, and zratio is exactly 2.

Any ideas?
-Bill Leue
William M. Leue
GE Global Research
M/S KWC-211
1 Research Circle
Schenectady, NY 12309
518-387-7210, 8*833-7210
leue at crd.ge.com




More information about the vtkusers mailing list