[vtkusers] Howto supply vector of itk::OrientedImage::Pointer to ImageToVTKImageFilter

Divya Rathore divyarathore at gmail.com
Wed Oct 19 10:29:00 EDT 2011


I am trying to transfer DICOM files read in ITK to VTK for a 3D rendering.

I have a vector of ImageType::Pointer in ITK:

typedef	itk::OrientedImage<signed short, 3> ImageType;

typedef std::vector<ImageType::Pointer> ImageArray;


Each element in this vector (ImageArray) contains a slice of DICOM read in
'signed short' for certain reasons beyond my control.
I would like to transfer this ImageArray to ImageToVTKImageFilter as
follows:

typedef itk::ImageToVTKImageFilter< ImageType> itkVtkConverter;


itkVtkConverter::Pointer conv;


 // QUESTION: HOW TO SUPPLY THE VECTOR ImageArray here?

conv->SetInput(_**_WHAT_GOES_HERE?_**_);
conv->Update();

as the data is signed short, I will need to convert it to 'unsigned
short' that I can achieve as follows:


vtkSmartPointer<vtkImageCast> dataCast = vtkSmartPointer<vtkImageCast>::New();
dataCast->SetInput(conv->GetOutput());
dataCast->SetOutputScalarTypeToUnsignedShort();
dataCast->Update();

finally forwarding this to the vtkVolumeRayCastMapper:


volumeMapper->SetInput(dataCast->GetOutput());


How to supply the vector ImageArray to ImageToVTKImageFilter?


best regards,

Divya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111019/d1ddd2c6/attachment.htm>


More information about the vtkusers mailing list