HU values incorrect after vtkImageReslice

I’m trying to reslice a DICOM volume using vtkImageReslice, but I’m having trouble preserving the original Hounsfield Unit (HU) values

reslice->SetInputConnection(extractVOI->GetOutputPort());
reslice->SetResliceTransform(inverseTransform);

reslice->SetInterpolationModeToLinear();
reslice->SetOutputSpacing(reader->GetOutput()->GetSpacing());
reslice->SetOutputOrigin(reader->GetOutput()->GetOrigin());
reslice->SetOutputExtent(reader->GetOutput()->GetExtent());

reslice->SetOutputScalarType(extractVOI->GetOutput()->GetScalarType());
// I also tried using VTK_UNSIGNED_SHORT explicitly

reslice->AutoCropOutputOn();
reslice->SetBackgroundLevel(0.0);
reslice->Update();

UpdatedImageData = reslice->GetOutput();

Problem:

  • When I keep the scalar type from the input, the HU values of the resliced image do not match the original DICOM values. Some areas appear gray instead of matching the original intensities.

  • When I explicitly set the scalar type to VTK_UNSIGNED_SHORT, only the bone is visible and all soft tissue becomes black—clearly indicating HU values are being lost or clipped.

Questions:

  1. How can I preserve the full HU range during reslicing so the resulting vtkImageData keeps the same intensity values as the original DICOM?

  2. Are there specific steps needed to handle signed vs. unsigned data types or rescale intercept/slope?

  3. Should I avoid forcing the scalar type and instead use a different approach?

Any guidance on how to maintain correct HU values after vtkImageReslice would be greatly appreciated.

Typical HU values range from -1000 to +3000, so VTK_UNSIGNED_SHORT is not a suitable data type. Likewise, for CT data in HU, BackgroundLevel should be -1000.

What is the data type of the output of your extractVOI filter? If its output is HU, then a signed type must be used. Really, it all comes back to what reader you are using for the DICOM data.

  1. By default, vtkImageReslice keeps the same data type as its input and does no rescaling or clipping. In typical usage, you should not explicitly set the output type.
  2. How you handle rescale intercept/slope is up to you, just make sure that whatever filter or reader performs the rescale uses a signed data type, or else the HU will be clipped at zero and soft tissue contrast will be lost
  3. See 1.

Thank you, David. I will take a look accordingly.