[vtkusers] question about vtkOpenGLVolumeRayCastMapper

kingaza at gmail.com kingaza at gmail.com
Wed Dec 15 07:03:11 EST 2004


hi seanm and all, 
i am new in vtk, and now i am learning from other's samples
please help me and tell me where i made mistake

my codes like these:

vtkDICOMImageReader *reader = vtkDICOMImageReader::New();
reader->SetDirectoryName("E:\\myhead");	
reader->SetDataScalarTypeToUnsignedShort(); //it doesn't work!!!!!!!!
 ......
vtkVolumeRayCastMapper *volMapper = vtkVolumeRayCastMapper::New();
volMapper->SetInput(reader->GetOutput());
vtkVolumeRayCastMIPFunction *MIPFunction = vtkVolumeRayCastMIPFunction::New(); 
MIPFunction->SetMaximizeMethodToScalarValue();
volMapper->SetVolumeRayCastFunction(MIPFunction);

vtkVolume *vol = vtkVolume::New();
vol->SetMapper(volMapper);

vtkRenderer *ren = vtkRenderer::New();
ren->AddVolume(vol);	



On Wed, 15 Dec 2004 12:28:07 -0500, Sean McInerney
<seanm at nmr.mgh.harvard.edu> wrote:
> Hi kingaza,
> 
>   Use vtkImageShiftScale to shift and rescale the range of values in
> your data to that of unsigned char (0 - 0xff) or unsigned short (0 -
> 0xffff), also setting the output type of this filter to UnsignedChar or
> UnsignedShort.
> 
> -Sean
> 
> kingaza at gmail.com wrote:
> > hi all,
> > in my application, i use vtkVolumeRayCastMapper to implement
> > ray-casting. i have succeeded in implementing raycasting using volume
> > data,  but when i use dicom file as input source,  one error occurs
> > as:
> > ERROR: In .\vtkVolumeRayCastMapper.cxx, line 326
> > vtkOpenGLVolumeRayCastMapper (01C0CCF0): Cannot volume render data of
> > type short, only unsigned char or unsigned short.
> >
> > how can i do? should i convert dicom file to another format first?
> >
> > regards,
> > kingaza
> > _______________________________________________
> > 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
> >
>



More information about the vtkusers mailing list