<div dir="ltr">First try to convert your 2D slices into a 3D volume using itk. Have a look at this<br><br><a href="http://www.vtk.org/Wiki/ITK/Examples/IO/VolumeFromSlices">http://www.vtk.org/Wiki/ITK/Examples/IO/VolumeFromSlices</a><br>
<br>Then convert the itk 3D image into vtk 3D image.<br><br>HTH<br><br>Jothy<br><br><br><div class="gmail_quote">On Wed, Oct 19, 2011 at 3:29 PM, Divya Rathore <span dir="ltr"><<a href="mailto:divyarathore@gmail.com">divyarathore@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>I am trying to transfer DICOM files read in ITK to VTK for a 3D rendering.</div><div><br></div>I have a vector of ImageType::Pointer in ITK:<div>
<pre style="font-family:Consolas;font-size:13px;background-color:white;background-repeat:initial initial"><span style="color:blue">typedef</span> itk::OrientedImage<<span style="color:blue">signed</span> <span style="color:blue">short</span>, 3> ImageType;</pre>
<pre style="font-family:Consolas;font-size:13;color:black;background:white"><pre style="font-family:Consolas;font-size:13;color:black;background:white"><span style="color:blue">typedef</span> std::vector<ImageType::Pointer> ImageArray;
</pre></pre><div><br></div><div>Each element in this vector (ImageArray) contains a slice of DICOM read in 'signed short' for certain reasons beyond my control.</div></div><div>I would like to transfer this ImageArray to ImageToVTKImageFilter as follows:</div>
<div><br></div><div><pre style="font-family:Consolas;font-size:13;color:black;background:white"><span style="color:blue">typedef</span> itk::ImageToVTKImageFilter< ImageType> itkVtkConverter;</pre></div><div><pre style="font-family:Consolas;font-size:13;color:black;background:white">
itkVtkConverter::Pointer conv;
</pre><pre style="font-family:Consolas;font-size:13;color:black;background:white"><span style="font-family:monospace;font-size:small"><pre style="font-family:Consolas;font-size:13px;color:black;background-color:white"> // QUESTION: HOW TO SUPPLY THE VECTOR ImageArray here?</pre>
</span></pre><pre style="background-color:white;background-repeat:initial initial"><pre style="font-family:Consolas;font-size:13px;color:black;background-color:white">conv->SetInput(_**_WHAT_GOES_HERE?_**_);
conv->Update();</pre><pre style="font-size:13px;color:black;background-color:white"><span style="font-family:arial, helvetica, sans-serif">as the data is signed short, I will need to convert it to 'unsigned short' that I can achieve as follows:</span></pre>
<pre style="font-size:13px;color:black;background-color:white"><font face="arial, helvetica, sans-serif"><pre style="font-family:Consolas;font-size:13;color:black;background:white">vtkSmartPointer<vtkImageCast> dataCast = vtkSmartPointer<vtkImageCast>::New();
dataCast->SetInput(conv->GetOutput());
dataCast->SetOutputScalarTypeToUnsignedShort();
dataCast->Update();</pre></font></pre><pre style="font-size:13px;color:black;background-color:white"><font face="arial, helvetica, sans-serif">finally forwarding this to the vtkVolumeRayCastMapper:</font></pre><pre style="background-color:white">
<pre style="font-family:Consolas;font-size:13px;color:black;background-color:white;background-repeat:initial initial">volumeMapper->SetInput(dataCast->GetOutput());
</pre><pre style="color:black;background-color:white"><font face="arial, helvetica, sans-serif"><br>
</font></pre><pre style="background-color:white"><font face="arial, helvetica, sans-serif">How to supply the vector ImageArray to ImageToVTKImageFilter?<span style="color:black">
</span></font></pre><pre style="background-color:white"><font face="arial, helvetica, sans-serif"><br>
</font></pre><pre style="background-color:white"><font face="arial, helvetica, sans-serif">best regards,</font></pre>
<font color="#888888"><pre style="background-color:white"><font face="arial, helvetica, sans-serif">Divya</font></pre>
<div style="color:black;font-family:Consolas;font-size:13px"><br></div></font></pre></pre></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Jothybasu K Selvaraj<br>PhD Student<br>University of Liverpool<br>Liverpool,UK<br></div><br>
</div>