I'm trying to read a nrrd file by itk and show it by vtk. But I have some trouble on convert itk to vtk.
import itk
file_name = '/home/yao/workspace/test/1.nrrd'
image_type = itk.Image[itk.UC, 2]
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()
and I got the message
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'
I'm using itk3.20, python2.7. How can I fix it?
Regards.
Yao