Simple ITK Elastix installation on Windows 10 from Sources with CMake to run in Python

777 Views Asked by At

I have to try to install SimpleITK Elastix on Windows 10. I have the toolchain (Windows 10, Anaconda3, python 3.7 , MSVS 2019, Cmake 3.7, git,) and source code (SimpleITK v1.2, SimpleElastix KIT). It do all steps all right but after run python setup install I open python interpreter shell for list the modules of SimpleITK package print (dir(istk)) and the modules 'Elastix', 'ElastixImageFilter', 'ElastixImageFilter_swigregister' are not listed. I have tried on Ubuntu 18.04 and I have goten it. I have tried why the same process work on Ubuntu 18.04 and not on Windows 10, but I don't see differences. I need work with SimpleElastix kit on Windows 10, I have list the location of packages and the results are

 import sys
 sys.path

    ['', 'C:\\Users\\usuario\\Anaconda3\\python37.zip', 'C:\\Users\\usuario\\Anaconda3\\DLLs', 'C:\\Users\\usuario\\Anaconda3\\lib', 'C:\\Users\\usuario\\Anaconda3', 'C:\\Users\\usuario\\Anaconda3\\lib\\site-packages', 'C:\\Users\\usuario\\Anaconda3\\lib\\site-packages\\simpleitk-1.2.0rc2.dev1167+gd4cf2-py3.7-win-amd64.egg', 'C:\\Users\\usuario\\Anaconda3\\lib\\site-packages\\win32', 'C:\\Users\\usuario\\Anaconda3\\lib\\site-packages\\win32\\lib', 'C:\\Users\\usuario\\Anaconda3\\lib\\site-packages\\Pythonwin']

I can see the package 'C:\Users\usuario\Anaconda3\lib\site-packages\simpleitk-1.2.0rc2.dev1167+gd4cf2-py3.7-win-amd64.egg'. I think that Elastix modules are anywere in the file system but python dont get to load them.

Can you help me, please? Thanks in advance. PD: I am trying to install this library for a week :(

1

There are 1 best solutions below

0
On

great day for me. The post Install SimpleElastix on Windows for Python is the solution. Specifically the first point:

1- Re-install Anaconda3, add to PATH while installing (although it's not recommended by the installer). Make sure Python can be accessed by the system by checking in cmd. Just type "python" and see if its version pops out.

I would like know why reinstalling Anaconda its the solution. Heuristic method for not experts but the solution its not in the FAQs of tool sources.

Thanks a lot to stackoverflow Cándido