Hi everyone.<div><br></div><div>I'm sure this has probably been asked before. </div><div><br></div><div>I am reading some DICOM images using ITK and visualizing in VTK. </div><div><br></div><div>Up until now, I have been using vtkImageViewer2 class with no problems at all. </div>
<div><br></div><div>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. </div>
<div><br></div><div>The steps I follow are: </div><div><br></div><div>1) read in ITK as float, I test the RescaleIntercept (0.0) and RescaleSlope (1.0) values. </div><div>2) export to VTK </div><div>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) </div>
<div>4) Since vtkVolume needs unsigned chars, I use vtkImageShiftScale but get incorrect image display. </div><div><br></div><div><div> vtkImageShiftScale *shift = vtkImageShiftScale::New(); </div><div> shift->SetInput(m_vtkImage); </div>
<div> shift->SetScale(255.0/window); </div><div> shift->SetShift(0.5*window - level); </div><div> shift->ClampOverflowOn();</div><div> shift->SetOutputScalarTypeToUnsignedChar(); </div><div> shift->Update();</div>
</div><div><br></div><div>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</div><div>
<br></div><div>Hope you can help. </div><div><br>Sergio </div><div><br></div>