[vtkusers] vtkRayCaseVolume mapper in VTK 4.0

Lisa S. Avila lisa.avila at kitware.com
Fri Dec 27 01:33:08 EST 2002


Hello,

The main issue is that the transfer function is sampled into an array, and 
the array is indexed by the scalar value during rendering. To have this 
work with signed data we must add an offset to the scalar value to use it 
as an index (since we can't index with negative values). This is fairly 
straightforward, and should be done with both a scale and a bias to support 
bigger data (unsigned short leads to an array with 65535 elements - more 
than this would not be a good idea so a scale is needed to handle integer 
data).  This change has been on my list of "things to do when I get some 
time" for a few years now..... :-)

Lisa




At 04:39 AM 12/23/2002, Alex Romadinoff wrote:
>Bill,
>
>Thank you for answer.
>It seams to be very reasonable. In fact if other types are permitted,
>mapper should implement improper function of data filtering, i.e.
>negative data to something meaningful translation. So this translation
>should be performed in color transfer function, but such solution breaks
>vtkPiecewiseFunction usage for opacity idiom, so present solution is
>very rational.
>
>But the problem is that the solution isn't documented :(
>
>Alex
>
>-----Original Message-----
>From: Bill Lorensen [mailto:wlorens1 at nycap.rr.com]
>Sent: Saturday, December 21, 2002 12:39 AM
>To: Alex Romadinoff; 'Amy Henderson'; vtkusers at public.kitware.com
>Subject: RE: [vtkusers] vtkRayCaseVolume mapper in VTK 4.0
>
>Alex,
>
>There is really not a good justification for the limitation. I believe
>the concern is that the transfer functions cannot handle negative
>independent variables, but this, in my opinion, is an implementation
>flaw.
>
>Although I'm not a volume rendering guy, one of these days, I'll remove
>this limitation...
>
>Bill
>
>
>At 09:49 PM 12/20/02 +0300, Alex Romadinoff wrote:
> >But what's the reason for such limitations?
> >
> >Alex
> >
> >-----Original Message-----
> >From: Amy Henderson [mailto:amy.henderson at kitware.com]
> >Sent: Friday, December 20, 2002 9:44 PM
> >To: Alex Romadinoff; vtkusers at public.kitware.com
> >Subject: Re: [vtkusers] vtkRayCaseVolume mapper in VTK 4.0
> >
> >At 09:42 PM 12/20/2002 +0300, Alex Romadinoff wrote:
> >>Dear all,
> >>
> >>I try to render volume data with the following code
> >>
> >>// :skipped:
> >>short* data=new short [1000000];
> >>
> >>  for (int i=0; i<1000000; i++){
> >>      data[i]=120+200*sin(i)*((i+1)%20);
> >>  }
> >>
> >>  vtkImageImport *img=vtkImageImport::New();
> >>
> >>  img->SetImportVoidPointer (data);
> >>  img->SetDataScalarTypeToShort ();
> >>  img->SetWholeExtent (0, 100, 0, 100, 0, 100);
> >>  img->SetDataExtentToWholeExtent ();
> >>// ..skipped..
> >>vtkVolumeRayCastMapper* volumeMapper=vtkVolumeRayCastMapper::New();
> >>volumeMapper->SetVolumeRayCastFunction (compositeFunction);
> >>volumeMapper->SetInput (img->GetOutput());
> >>// ..skipped
> >>
> >>When I use short or double type for data array and do
> >>SetDataScalarTypeTo{Short|Double} the resultant rendered image is
> >empty.
> >>
> >>When I use unsigned char for data transition, volume is visualized
> >well.
> >>
> >>What's up ?
> >>Is vtkVolumeRayCastMapper works only for unsigned char data ?
> >
> >It will handle unsigned char or unsigned short data.
> >- Amy
> >
> >>With best wishes,
> >>Alex
> >>
> >>
> >>
> >>
> >>
> >>_______________________________________________
> >>This is the private VTK discussion list.
> >>Please keep messages on-topic. Check the FAQ at:
> >><http://public.kitware.com/cgi-bin/vtkfaq>
> >>Follow this link to subscribe/unsubscribe:
> >>http://public.kitware.com/mailman/listinfo/vtkusers
> >
> >
> >
> >_______________________________________________
> >This is the private VTK discussion list.
> >Please keep messages on-topic. Check the FAQ at:
><http://public.kitware.com/cgi-bin/vtkfaq>
> >Follow this link to subscribe/unsubscribe:
> >http://public.kitware.com/mailman/listinfo/vtkusers
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers






More information about the vtkusers mailing list