[vtkusers] vtkDICOMImageReader volume rendering problem
Peter
meancity at gmail.com
Tue Dec 27 03:38:20 EST 2005
hi my friends,
when i am trying to do some volume rendering using
vtkDICOMImageReader, it shows some error likes this.
ERROR: In C:\VTK4.4\Rendering\vtkVolumeRayCastMapper.cxx, line 325
vtkOpenGLVolumeRayCastMapper (026A2BB0): Cannot volume render data of
type short, only unsigned char or unsigned short.
my code is roughly like:
=======
vtkDICOMImageReader reader
reader SetDataByteOrderToLittleEndian;
reader SetDirectoryName "C:\\dicom"
[reader GetOutput] ReleaseDataFlagOn
reader SetDataSpacing 0.938 0.938 1.3
reader Update
vtkPiecewiseFunction volOpacityTransferFunctiono
...
...
vtkColorTransferFunction colorTransferFunction
....
....
vtkVolumeProperty vol_prop
vol_prop SetColor colorTransferFunction
vol_prop SetScalarOpacity volOpacityTransferFunction
vol_prop SetInterpolationTypeToLinear
vol_prop ShadeOn
vtkVolumeRayCastCompositeFunction comp_func
vtkVolumeRayCastMapper volmap
volmap SetInput [reader GetOutput]
volmap SetVolumeRayCastFunction comp_func
volmap SetSampleDistance 1.0
vtkVolume vol
vol SetProperty vol_prop
vol SetMapper volmap
ren1 AddVolume vol
===============
can anyone out there help me out for how to use vtkDICOMImageReader to
do some volume rendering. it seems fine when using vtkVolume16Reader.
Thank you very much
Yours
Peter Pan
More information about the vtkusers
mailing list