I apologize in advance if this forum is the wrong place to raise this issue, which is more related to SimpleElastix than simpleITK. I did not get any answer from the SimpleElastix community, so I’m trying here.
This issue seems to be pretty common, but so far I couldn’t find a solution that worked for me…
I’ve tried to install SimpleElastix on Linux as specified in here: Getting Started — SimpleElastix 0.1 documentation
I activated my python environment then installed SimpleElastix using python Packaging/setup.py install
After installation, when calling sitk.ElastixImageFilter(), the following error appeared: Module ‘SimpleITK’ has no attribute ‘ElastixImageFilter’.
I read in other issues that this might be due to several versions of SimpleITK coexisting on my computer, so I uninstalled SimpleITK and reinstalled SimpleElastix to ensure there was only one version of SimpleITK on my machine.
Now, when I try to import SimpleITK, python doesn’t seem to find it: No module named '_SimpleITK'
I don’t have an idea of what is going wrong for you, just wanted to make you aware that SimpleElastix originally took the SimpleITK code and added the relevant Elastix code, but they kept the name of the package as SimpleITK. As a result you can’t have SimpleITK and SimpleElastix installed together.
I don’t know what you mean by “Uninstalled SimpleITK”. Usually you would be working in a virtual environment and installing packages there. So you would create a clean virtual environment and install SimpleElastix there.
Hopefully this helps a bit, but I really don’t know what SimpleElastix is doing/expecting.
Thank you for pointing this out. I originally did not know that SimpleElastix contained simpleITK, that’s why I had to uninstall SimpleITK from my virtual environment afterwards.
The issue seems to be independent from SimpleITK. When installing SimpleElastix in a clean environment, the issue remains the same (i.e. No module named '_SimpleITK')