[vtkusers] vtkVolumeRayCastMapper with float or double scalar

Amy Squillacote amy.squillacote at kitware.com
Tue Apr 19 17:01:48 EDT 2005


Hi Jim,

Your data has to be converted to either the range of unsigned char [0, 255] 
or unsigned short [0, 65535] in order to use the 
vtkVolumeRayCastMapper.  Try using vtkImageShiftScale instead of 
vtkImageCast to convert your data to the appropriate range.  You will need 
to calculate the appropriate shift (absolute value of the largest negative 
value in your data set) and scale (value to make the range of your data lie 
within either 255 or 65535) to convert your data to one of these ranges.

- Amy

At 04:48 PM 4/19/2005, Jim wrote:
>Hi vktusers,
>
>I am trying to volume-render a double-precision scalar with 
>vtkVolumeRayCastMapper.
>My raw data (scalar data) are double-precision numbers and they can be 
>negative. I created
>my vtkImageData from unstructured scalar data using vtkShepardMethod. My 
>questions are
>
>1) Do I have to scale my raw scalar data to the range of [0, 255] before 
>creating my
>     vtkImageData?
>2) What does vtkImageCast->SetOutputScalarTypeToUnsignedShort() do if my 
>ImageData
>     is not scaled to the range of [0, 255]? Will it set any number less 
> than 0 to 0, any
>     number greater than 255 to 255?
>
>Thank you.
>
>Jim
>
>
>Do you Yahoo!?
>Plan great trips with 
><http://us.lrd.yahoo.com/_ylc=X3oDMTFmZ2htMTlyBF9TAzMyOTc1MDIEX3MDODYyNzYxNwRwb3MDMQRzZWMDbWFpbARzbGsDZm9vdGVy/SIG=10tesb5j9/**http%3a//travel.yahoo.com/>Yahoo! 
>Travel: Now 
><http://us.lrd.yahoo.com/_ylc=X3oDMTFmMnFhajhhBF9TAzMyOTc1MDIEX3MDODYyNzYxNwRwb3MDMgRzZWMDbWFpbARzbGsDZm9vdGVy/SIG=12jqk5n45/**http%3a//travel.yahoo.com/p-travelguide-191500002-destination_guides_vacations-i>over 
>17,000 guides!
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050419/5247e36b/attachment.htm>


More information about the vtkusers mailing list