AW: [vtkusers] How to realize volume raycast?

Chunyan Jiang jiang at TI.FhG.DE
Fri Oct 25 09:47:37 EDT 2002

Hi, Andrew,
Thank you for your help. It will be helpful if I want to shift data type
some time. Now my problem is not data type. I imported short int data to
vtkImageImport. Since I must do some operation on data, I have to import
them from array to vtk pointer, instead of using vtk reader.
Now it can be shown by vtkDataSetMapper. However, it can not be shown by
vtkVolumeRayCastMapper. How can I solve this problem?
By the way, the output of vtkImageImport is vtkImageData, not



-----Ursprungliche Nachricht-----
Von: Andrew Porter [mailto:Andrew.R.Porter at]
Gesendet: Donnerstag, 24. Oktober 2002 18:49
An: Chunyan Jiang
Betreff: Re: [vtkusers] How to realize volume raycast?

Hi Chunyan,

The volume renderer will only deal with byte data.  If you have anything
else (eg floats) then you have to filter them first:

  vtkStructuredPoints* structPts = reader->GetOutput();

  printf("Input field range: min = %.3f, max = %.3f\n",range[0],range[1]);

  // Convert to byte data because that's what the vol. renderer needs
  vtkImageShiftScale *imageShift = vtkImageShiftScale::New();

and you'll be needing a



Hope this helps.


> Dear VTK users,
> I import 3d image data to vtkImageImport. Now I want to realize volume
> rendering. So I use the example SimpleRayCast and add the vtkImageImport
> the line:
> volumeMapper->SetInput(importer->GetOutput());
> instead of
> volumeMapper->SetInput(reader->GetOutput());
> But the data can not be displayed on the screen. How should I do?
> Thanks in advance!
> Chunyan
> ***********************************************************************
> Chunyan Jiang, Dipl.-Inform.,
> Institut for Telematic
> Bahnhofstrasse 30-32, D-54292 Trier, Germany
> Phone: (+49) (0)651-97551-34
> Fax: (+49) (0)651-97551-12
> ***********************************************************************
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> Follow this link to subscribe/unsubscribe:

Andrew Porter

Software engineer, RealityGrid      Tel. :  +44 (0)161 2757184
Manchester Computing                Fax. :  +44 (0)161 2756040
University of Manchester            Email:  Andrew.Porter at
Oxford Road                         Web  :
Manchester, M13 9PL                      :

More information about the vtkusers mailing list