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

yehe_008 yehe_008 at 163.com
Tue Jun 5 12:33:44 EDT 2012


 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_type].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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120606/1a47aa04/attachment.htm>


More information about the Insight-users mailing list