1
votes

My Python Code is:

import SimpleITK as sitk
resultImage = sitk.Elastix(sitk.ReadImage("fixedImage.nii"), \
                       sitk.ReadImage("movingImage.nii"), \
                       "translation")
sitk.Show(resultImage, 'test', debugOn=True)

I get this error:

Traceback (most recent call last):

File "/home/faps/PycharmProjects/Rigid Registration/code.py", line 5, in <'module> sitk.Show(resultImage, 'test', debugOn=True)

File "/usr/local/lib/python2.7/dist-packages/SimpleITK-1.0.1rc1.dev333+gabf92-py2.7-linux-x86_64.egg/SimpleITK/SimpleITK.py", line 7741, in Show return _SimpleITK.Show(*args, **kwargs)

RuntimeError: Exception thrown in SimpleITK Show: /media/faps/ECF664A5F664722E/SimpleElastix/Code/IO/src/sitkShow.cxx:515: sitk::ERROR: Error in administrating child process: [No such file or directory]

I am working on Ubuntu 16.04 with Pycharm.

I have ImageJ in this address: /media/faps/ECF664A5F664722E

the line sitk.Show(... is cousing this error. Can somebody tell me what this error means and how I can solve it?

1
SimpleITK, by default, uses ImageJ to display images. It seems that cannot find ImageJ. The debugOn flag is supposed to make SimpleITK print out the search path it uses to find ImageJ, but I don't seat in your error message.Dave Chen

1 Answers

0
votes

As my comment said, SimpleITK can't seem to find ImageJ. On Linux systems, the search path includes the current working directory, ${HOME}/bin, /opt and /usr/local.

If your ImageJ executable is in another location, or if you want to use some other application to display images, you can use the SITK_SHOW_COMMAND environment variable.

More documentation about the Show function in the doxygen: https://itk.org/SimpleITKDoxygen100/html/namespaceitk_1_1simple.html#ac8416e6e7f02dedfe8373b83dbea411d