Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Python error: module 'itk' has no attribute 'ParameterObject'

I use ITK in python (https://itkpythonpackage.readthedocs.io/en/master/Quick_start_guide.html) and the package seems to work, but when I want to use a code I found on github (https://github.com/InsightSoftwareConsortium/ITKElastix/blob/master/wrapping/test/itkElastixRegistrationMethodTest.py) it gives me an error:

import itk
parameter_object = itk.ParameterObject.New()

module ‘itk’ has no attribute ‘ParameterObject’

unfortunately I could not find out why my itk has no ParameterObject attribute, but I found other code that also used this attribute. I tried to upgrade itk:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Requirement already satisfied: itk in /…/miniconda3/lib/python3.9/site-packages (5.2.1.post1)

I am new to ITK and I am not quite sure what I did wrong, can someone help me?

>Solution :

You need ITKElastix. Get it via pip install itk-elastix.

If you are building ITK from source, you need to build ITKElastix from source and point to the main ITK build.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading