[Insight-users] problems converting itk data to vtk data

Luis Ibanez luis.ibanez at kitware.com
Sun Apr 17 17:38:45 EDT 2005



Hi Abhishek



You are missing to call


           connector->Update()



before you use the output of the
conversion filter.


Please read the ITK Tutorials:

   http://www.itk.org/HTML/Tutorials.htm

In particular "Getting Started II" which
describes how to use ITK and VTK together.



Regards,



      Luis



-------------------
Abhishek wrote:

> Hello All,
> 
>  
> 
> I am using ImageToVTKImageFilter for converting ITK data got from 
> ImageSeriesReader. However, I am loosing all the settings for the 
> spacing, dimensions, origin, etc in vtkImageData (even the scalar type). 
> Why is that? I understand ImageToVTKImageFilter uses VTKImageExport. Can 
> someone please tell me what I could be doing wrong? Thanks a million.
> 
>  
> 
> typedef itk::Image <unsigned short,3> InputImageType;
> 
> typedef itk::ImageToVTKImageFilter<InputImageType> ConnectorType;
> 
> ConnectorType::Pointer connector= ConnectorType::New();
> 
> connector->SetInput(m_pReader->GetOutput());
> 
> vtkImageData* pImgData = connector->GetOutput();
> 
>  
> 
> -Cheers,
> 
> **Abhishek **
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users





More information about the Insight-users mailing list