Luis Gonçalves
Luis Gonçalves

Reputation: 47

Exchange data between VTK and ITK in Python

Sorry the naive question.

What is the way to exchange data between the VTK and ITK packages?

Example: Read a .mhd or .mha em VTK and using it in ITK registration.

Thanks,

Luis Gonçalves

Upvotes: 1

Views: 463

Answers (1)

Dave Chen
Dave Chen

Reputation: 2085

Here's an example on how to convert a VTK image to an ITK image in python:

https://itk.org/ITKExamples/src/Bridge/VtkGlue/ConvertvtkImageDataToAnitkImage/Documentation.html

It uses ITK's itk.VTKImageToImageFilter. There is also a filter to go the other direction, ImageToVTKImageFilter.

Note that you can read .mha or .mhd file directly in ITK.

Upvotes: 1

Related Questions