[Insight-users] How to make itk.ImageToVTKImageFilter work?

Dženan Zukić dzenanz at gmail.com
Fri Jun 8 06:02:47 EDT 2012


Why are you using such an old version? Why not 4.1? It has significantly
improved itk2vtk bridge.

On Tue, Jun 5, 2012 at 6:33 PM, yehe_008 <yehe_008 at 163.com> wrote:

>  Hello.
>
> I installed itk3.0 and python2.7 on my ubuntu12.04. Now I have trouble to
> convert itk image to vtk image.
> For example:
>
> file_name = '/home/yao/workspace/test/brain.nrrd'
> image_type = itk.Image[itk.UC, 3]
>
> reader = itk.ImageFileReader[image_type].New()
> reader.SetFileName( file_name )
>
> reader.Update()
>
> itk_vtk_converter = itk.ImageToVTKImageFilter[image_type].New()
>
> itk_vtk_converter.SetInput(reader.GetOutput())
> itk_vtk_converter**.Update()
>
> then I got the messge:
>
> Traceback (most recent call last):   File "ex1.py", line 11, in <module>
>
>     itk_vtk_converter = itk.ImageToVTKImageFilter[image_t
>  ype].New()   File "/usr/lib/InsightToolkit/WrapITK/Python/itkLazy.py", line 14, in
>
> __getattribute__
>     value = types.ModuleType.__getattribute__(self, attr) AttributeError: 'LazyITKModule' object has no attribute 'ImageToVTKImageFilter'
>
> How can i make it work?
>
> Cheers
>
> - Lisa
>
>
>
> _____________________________________
> 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.php
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120608/8cae1f86/attachment.htm>


More information about the Insight-users mailing list