# HU values incorrect after vtkImageReslice

**URL:** <https://discourse.vtk.org/t/hu-values-incorrect-after-vtkimagereslice/16152>\
**Category:** Development\
**Created:** [November 19, 2025, 5:26am UTC](https://discourse.vtk.org/t/hu-values-incorrect-after-vtkimagereslice/16152 "2025-11-19T05:26:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KSJ](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ksj/32/8659_2.png) [@KSJ](https://discourse.vtk.org/u/KSJ)\
**Post date:** [November 19, 2025, 5:26am UTC](https://discourse.vtk.org/t/hu-values-incorrect-after-vtkimagereslice/16152/1 "2025-11-19T05:26:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)\
**Post date:** [November 19, 2025, 12:50pm UTC](https://discourse.vtk.org/t/hu-values-incorrect-after-vtkimagereslice/16152/2 "2025-11-19T12:50:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![KSJ](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ksj/32/8659_2.png) [@KSJ](https://discourse.vtk.org/u/KSJ)\
**Post date:** [November 20, 2025, 5:10am UTC](https://discourse.vtk.org/t/hu-values-incorrect-after-vtkimagereslice/16152/3 "2025-11-20T05:10:29Z")

</div>

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