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:
-
How can I preserve the full HU range during reslicing so the resulting
vtkImageDatakeeps the same intensity values as the original DICOM? -
Are there specific steps needed to handle signed vs. unsigned data types or rescale intercept/slope?
-
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.