[vtkusers] vtkVolumeRayCastMapper with float or double scalar

Jim jiksed at yahoo.com
Tue Apr 19 17:34:38 EDT 2005


Hi Amy,
 
Thanks. Say, I have a data set in the range of [-1000, 1000]. I can shift the data to the new
range of [0, 2000]. Do I have to scale the data to the full UNSIGNED-SHORT range of
[0, 65535]? Is it OK to leave the data in the range [0, 2000]? Thank you.
 
Jim


Amy Squillacote <amy.squillacote at kitware.com> wrote:
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 Yahoo! Travel: Now 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
__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050419/96761e5c/attachment.htm>


More information about the vtkusers mailing list