Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict between module ITKRegistrationCommonPython and RTK ? #390

Open
arobert01 opened this issue Nov 10, 2020 · 0 comments
Open

Conflict between module ITKRegistrationCommonPython and RTK ? #390

arobert01 opened this issue Nov 10, 2020 · 0 comments

Comments

@arobert01
Copy link
Collaborator

Hello,

When I tried to use filters from the module itk.ITKRegistrationCommonPython in Python I got this error:

Traceback (most recent call last):

  File "/export/home/arobert/Documents/code/src/algo/registration.py", line 13, in <module>
    trans_registration = itk.ImageRegistrationMethodv4[image_type, image_type].New()
  File "/export/home/arobert/.local/lib/python3.6/site-packages/itkLazy.py", line 52, in __getattribute__
    itkBase.LoadModule(module, namespace)
  File "/export/home/arobert/.local/lib/python3.6/site-packages/itkBase.py", line 91, in LoadModule
    LoadModule(dep, namespace)
  File "/export/home/arobert/.local/lib/python3.6/site-packages/itkBase.py", line 91, in LoadModule
    LoadModule(dep, namespace)
  File "/export/home/arobert/.local/lib/python3.6/site-packages/itkBase.py", line 61, in LoadModule
    swig.update(this_module.swig)
AttributeError: module 'itk.ITKRegistrationCommonPython' has no attribute 'swig'

I found out that instantiate a RTK filter before using the ITK filter fixed this error. Another way to get rid of this error is to uninstall the package python itk-rtk (not really convenient).

You can use the following code to reproduce this behavior:

import itk
from itk import RTK as rtk

image_type = itk.Image[itk.F,2]
#osem = rtk.OSEMConeBeamReconstructionFilter.New()
trans_registration = itk.ImageRegistrationMethodv4[image_type, image_type].New()

I'am using the itk-rtk package generated here on Linux with Python 3.6.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant