[Insight-users] Convert VTK image to ITK image

Félix C. Morency felix.morency at gmail.com
Wed Feb 1 14:34:23 EST 2012


Karl,

Try double instead of float in your image type.

Also, could you tell me what version of ITK you are using?

Thanks,
-Félix

On Wed, Feb 1, 2012 at 1:53 PM, Karl Diedrich
<karl.diedrich at azeresearch.com> wrote:
> Hello,
>
> I am trying to use itk::VTKImageToImageFilter to to convert a VTK image to
> an ITK image.
> The call vtkImageToImageFilter->Update(); never returns but there is no
> error message and program simply stops.
>
> vtkImageData* vtkInput;
>
>
>         typedef itk::Image<float, 3> ImageType;
>
>         typedef itk::VTKImageToImageFilter<ImageType> VTKImageToImageType;
>
>         typename VTKImageToImageType::Pointer vtkImageToImageFilter =
> VTKImageToImageType::New();
>         QLOG_DEBUG() << "Prepared Filter";
>         vtkImageToImageFilter->SetInput(vtkInput);
>         QLOG_DEBUG() << "Set input to filter";
>         vtkImageToImageFilter->Update();
>         QLOG_DEBUG() << "Updated filter";
>         typename ImageType::ConstPointer itkOutput =
> vtkImageToImageFilter->GetOutput();
>         QLOG_DEBUG() << "Got output";
>
>
>
>
> --
> Karl Diedrich, Ph.D.
> Principal Engineer
> ----------------------------------------
> AZE Research and Development
> 1 Broadway, 14th floor
> Cambridge, MA 02142
> Tel: +1 (617) 475-1502
> Cell: +1 (801) 350-1251
> www.azeofamerica.com
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>



-- 
--
Félix C. Morency, M.Sc.
Plateforme d’analyse et de visualisation d’images
Centre Hospitalier Universitaire de Sherbrooke
Centre de recherche clinique Étienne-Le Bel
Local Z5-3031 | 819.346.1110 ext 16634


More information about the Insight-users mailing list