[vtkusers] DICOM rescale question

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Mar 24 05:54:58 EDT 2011


Sergio,

  vtkImageShiftScale operation is exactly the opposite from what DICOM
mandates (order of operation). If you use vtkGDCMImageReader you
should get your image with proper Rescale Slope/Intercept applied.

HTH

On Thu, Mar 24, 2011 at 6:13 AM, Sergio Aguirre
<sergio.aguirre at gmail.com> wrote:
> 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
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



-- 
Mathieu



More information about the vtkusers mailing list