[ITK] (no subject)
Michka Popoff
michkapopoff at gmail.com
Thu Oct 2 07:11:13 EDT 2014
Hi
for the moment, the PyBuffer module has been moved out of ITK, and is no more maintained.
There was a port done for ITK4, but it is not tested so I don’t know how well it is working [1]
I plan to work a little bit on it one day if I can find some time.
The way to move images from itk to vtk is to use the ITKVTKGlue module.
You need to build ITK with:
Module_ITKVtkGlue=ON
Then you can do something like this (for a 2d image for example):
image_type = itk.Image[itk.UC, 2]
reader = itk.ImageFileReader[image_type].New()
reader.SetFileName(“PATH/TO/FILE”)
reader.Update()
vtk_image = itk.ImageToVTKImageFilter[image_type].New()
vtk_image.SetInput(reader.GetOutput())
vtk_image.Update()
Then you can use the vtk_image as a vtk object, that you can render or work on.
Is there a specific error message you get ?
Michka
[1] https://github.com/InsightSoftwareConsortium/itkPyBuffer
On 2 oct. 2014, at 11:45, Paola Volonghi <pola_88 at hotmail.it> wrote:
> Hi all,
> we developed a python program on ubuntu 13.10 using vtk library ver. 5.8.0 and itk library ver. 3.20.1. In our program we used also these command lines:
> itk.VTKImageToImageFilter.IF3.New()
> itk.ImageToVTKImageFilter[image_type].New()
> itk.PyBuffer[image_type].GetArrayFromImage( …. )
> but we discovered that they don't work on itk ver. 4.x.
> Is there another way to convert images from itk to vtk and vice versa, using the newest versions of vtk and itk?
>
> Thanks!
>
> Paola
>
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20141002/80aedbd2/attachment-0002.html>
More information about the Community
mailing list