[vtkusers] DICOM rescale question

Sergio Aguirre sergio.aguirre at gmail.com
Thu Mar 24 01:13:15 EDT 2011


Hi everyone.

I'm sure this has probably been asked before.

I am reading some DICOM images using ITK and visualizing in VTK.

Up until now, I have been using vtkImageViewer2 class with no problems at
all.

But now, I'd like to create a volume stack of the Dicom images using volume
rendering and the MIP raycast function (vtkVolumeRayCastMIPFunction). BUT
the colors are just not right. I see everything a bit gray and see many
sections that are outside of the image with a value.

The steps I follow are:

1) read in ITK as float, I test the RescaleIntercept (0.0) and RescaleSlope
(1.0) values.
2) export to VTK
3) load the images as vtkImageData, I test the Scalar range
(vtkImage->GetScalarRange) and the values I get are -3024 and 1530 (Im
pretty sure it should be -1024 1530)
4) Since vtkVolume needs unsigned chars, I use vtkImageShiftScale but get
incorrect image display.

  vtkImageShiftScale *shift = vtkImageShiftScale::New();
  shift->SetInput(m_vtkImage);
  shift->SetScale(255.0/window);
  shift->SetShift(0.5*window - level);
  shift->ClampOverflowOn();
  shift->SetOutputScalarTypeToUnsignedChar();
  shift->Update();

How should I be adjusting the scalar range to display it correctly, IF I
pass the vtkImageData directly to vtkImageViewer2 it displays OK but not
with vtkVolume and vtkVolumeRayCastMapper

Hope you can help.

Sergio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110323/90ae52bc/attachment.htm>


More information about the vtkusers mailing list