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

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


Thanks for the response, Jothy.

I did came across this sample. Unfortunately, the data has already been read
and re-reading is not an option here (the example you refered to reads the
data using itk::ImageSeriesReader).

I have no choice but to supply vector<ImageType::Pointer> ImageArray into
the itk::ImageToVTKImageFilter.

Any suggestions?

best regards,
Divya


On Wed, Oct 19, 2011 at 3:35 PM, Jothybasu Selvaraj <jothybasu at gmail.com>wrote:

> First try to convert your 2D slices into a 3D volume using itk. Have a look
> at this
>
> http://www.vtk.org/Wiki/ITK/Examples/IO/VolumeFromSlices
>
> Then convert the itk 3D image into vtk 3D image.
>
> HTH
>
> Jothy
>
>
> On Wed, Oct 19, 2011 at 3:29 PM, Divya Rathore <divyarathore at gmail.com>wrote:
>
>> 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
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
>
> --
> Jothybasu K Selvaraj
> PhD Student
> University of Liverpool
> Liverpool,UK
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111019/291d292f/attachment.htm>


More information about the vtkusers mailing list