TomD
TomD

Reputation: 21

Install SimpleElastix for Python3 on macOS

I am using macOS Sierra 10.12.6, trying to install the SimpleElastix extension of SimpleITK. I have been following the instructions here. After I got it to work, it turned out the extension seems to be only included in SimpleITK when I use Python 2.7, but not when I use Python 3.6 in the sense that when I try

import SimpleITK as sitk
resultImage = sitk.Elastix(sitk.ReadImage("fixedImage.nii"), sitk.ReadImage("movingImage.nii"))

I get the error

AttributeError: module 'SimpleITK' has no attribute 'Elastix'

I have found this suggestion but have not been able to get it to work on my Mac.

Thanks for any advice,

TomD

Upvotes: 2

Views: 1400

Answers (1)

YU YANG
YU YANG

Reputation: 31

you can follow this link to install:https://simpleelastix.readthedocs.io/GettingStarted.html#compiling-on-linux

Be care for the last python install, I use Ubuntu16.04, and my python is under my user's anaconda, you should use the python install without the sudo, but it will not work. So you need to change the permission of build folder to 777 before run the python setup.py install

Upvotes: 1

Related Questions