InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.43k stars 668 forks source link

python-itk: module 'itk' has no attribute 'GPUImage' #1605

Closed zhang-qiang-github closed 4 years ago

zhang-qiang-github commented 4 years ago

I want to use the GPU based itk for registrdation. Thus, I compile the itk from the source code, and set the ITK_USE_GPU to ON. The compiling is OK. 捕获

The itk can be imported in python:

import itk itk.Image[itk.F, 3] <class 'itkImagePython.itkImageF3'>

However, when I want to import the GPU module, bug is reported:

itk.GPUImage[itk.F, 3] Traceback (most recent call last): File "", line 1, in File "D:\Anaconda3\envs\ITK_gpu\lib\site-packages\itkLazy.py", line 48, in getattribute value = types.ModuleType.getattribute(self, attr) AttributeError: module 'itk' has no attribute 'GPUImage'

Also, module 'itk' has no attribute 'GPUDemonsRegistrationFilter'. How can I use GPU based itk for registration in python? Could somebody provide a demo?

thewtex commented 4 years ago

There are alpha Python packages available on Linux as described here and demo here.