Hi,<br> I used the following method to convert from IT to VTK. It may not be the perfect codes but it works for me<br><br><span style="font-family: courier new,monospace;">typedef itk::OrientedImage< unsigned char, 3 > SegVolumeImageType;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">typedef itk::ImageToVTKImageFilter<SegVolumeImageType> ITKImageToVTKImageFilterType;</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">vtkSmartPointer<vtkImageData> segmentedVTKImage = vtkSmartPointer<vtkImageData>::New();</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">//segmentedITKImage is a type of SegVolumeImageType</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">ITKImageToVTKImageFilterType::Pointer converter = ITKImageToVTKImageFilterType::New();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">converter->SetInput(segmentedITKImage); </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">segmentedVTKImage = converter->GetOutput();</span><br><br><br> Thiha<br><br><br><div class="gmail_quote">On Fri, Aug 19, 2011 at 9:24 AM, David Brayford <span dir="ltr"><<a href="mailto:dbrayford@gmail.com">dbrayford@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
I've written a function to convert a vtk to itk image data, but know<br>
need a method of converting the itk image data back to a vtk image<br>
data. However, I don't know how to convert from itk to vtk.<br>
<br>
thanks<br>
David<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>
</blockquote></div><br>