BUG: Define GetOutput() for Python wrapping#40
Conversation
Explicitly define GetOutput() for Python wrapping without the index and with the ResultImageType as a return type.
There was a problem hiding this comment.
Changes look good, but so far I had no luck with getting this to work when used in an object-oriented python script, neither with a self-compiled debug version (https://gitlab.com/romangrothausmann/elastix_scripts/pipelines/127160739) nor with pip install (https://gitlab.com/romangrothausmann/elastix_scripts/pipelines/127159377).
The self-compiled debug version fails on cmake of ITKElastix with
CMake Error at /ITK/Wrapping/Generators/Python/CMakeLists.txt:3 (include_directories):
include_directories given empty-string as include directory.
although things used to work here before #40 and use of ITK-5.1rc01.
The pip install version fails on execution with
selx = itk.ElastixRegistrationMethod[rType, rType].New() # https://itkpythonpackage.readthedocs.io/en/latest/Quick_start_guide.html#instantiate-an-itk-object
File "/usr/local/lib/python3.6/dist-packages/itkLazy.py", line 52, in __getattribute__
itkBase.LoadModule(module, namespace)
File "/usr/local/lib/python3.6/dist-packages/itkBase.py", line 93, in LoadModule
module = loader.load(swigModuleName)
File "/usr/local/lib/python3.6/dist-packages/itkBase.py", line 211, in load
return importlib.import_module(name)
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/local/lib/python3.6/dist-packages/itk/Configuration/../ElastixPython.py", line 114, in <module>
from itkElastixRegistrationMethodPython import *
File "/usr/local/lib/python3.6/dist-packages/itk/Configuration/../itkElastixRegistrationMethodPython.py", line 1661, in <module>
@itkHelpers.accept_numpy_array_like
AttributeError: module 'itkHelpers' has no attribute 'accept_numpy_array_like'
This is an issue in ITK 5.1 RC 2, and we will need ITK 5.1 RC 3 to continue. |
|
Many thanks @thewtex for that info, I was expecting that it was an incomplete/false configuration in the DF. Looking forward to rc3 then;-) While searching for a solution I stumbled over this: |
|
In the meanwhile, @thewtex do you have an idea concerning the pip install failure? Is that related or a different issue for which I should open an issue for tracking? |
|
pip install error are related current limitations of the pip dependency resolver -- it will no longer an issue once 5.1.0 is out. |
|
Many thanks @thewtex for the update. I gave it a try with ITK-5.1rc03 and self-compiling ITKElastix but it seems elastix is not compatible with it: Is that a known problem or should I open a new issue for that? |
|
@romangrothausmann Are you building with
see line 113 in itkImageIOBase.h for the defintion. NOTE: Many duplicate enum values were consolidated and converted to |
|
Many thanks @hjmjohnson for your feedback. So far I did not have |
|
That’s weird. ITK_LEGACY_REMOVE:BOOL=ON should break the build, not fixit. ITK_LEGACY_REMOVE:BOOL=OFF should expose the old enumerations. Hans |
|
I guess we forgot to expose some of the deprecated enums under legacy flag. |
|
I'll update to fix the enum's, and we will have nice-to-install packages after ITK 5.1.0 is out. |
Explicitly define GetOutput() for Python wrapping without the index and
with the ResultImageType as a return type.