DevelopmentalImagingMCRI / MCRIBS

Surface version of the M-CRIB atlases.
12 stars 6 forks source link

FileNotFoundError with MCRIBReconAll #4

Open ethompson93 opened 3 years ago

ethompson93 commented 3 years ago

Hi,

Thanks for making this great tool available! I have been trying to run MCRIBReconAll on a dataset, and I have come across the following error:

Running command:
    MCRIBConform RawT2/sub-CC00099AN18.nii.gz volumepreserve RawT2RadiologicalIsotropic/sub-CC00099AN18.nii.gz
Traceback (most recent call last):
  File "./MCRIBReconAll", line 412, in <module>
    main()
  File "./MCRIBReconAll", line 332, in main
    runCommand(cmd, log_file_name = logFileName)
  File "./MCRIBReconAll", line 36, in runCommand
    subprocess.check_call(CMD)
  File "/usr/lib64/python3.6/subprocess.py", line 306, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib64/python3.6/subprocess.py", line 287, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'MCRIBConform': 'MCRIBConform'

The MCRIBConform file is present in the directory, so I'm not sure why this is happening. Any help would be much appreciated!

chrisadamsonmcri commented 3 years ago

It looks like you are running MCRIBReconAll by changing into the directory it is located in. When it tries to run MCRIBConform it is looking for it in your PATH and not finding it. You need to source the set up script SetUpMCRIBS.sh which will add the bin directory to your PATH. It will also allow you to run MCRIBReconAll from any other directory as well, which is the intended method to run it. Let me know if you have any other questions.

ethompson93 commented 3 years ago

Thanks for the quick response! Unfortunately the SetUpMCRIBS.sh script doesn't seem to be working for me. I'm now running from a separate directory - when I run the set up script I get the output MCRIBS_HOME set to /usr/local/MCRIBS, however the MCRIBS folder doesn't get added to my path as intended, and my PYTHONPATH variable is empty.

I've tried setting up my paths manually, which allows me to run the scripts in this new directory, but I then run up against python issues (maybe because of something to do with the PYTHONPATH?):

Running command: MCRIBConform RawT2/sub-CC00099AN18.nii.gz volumepreserve RawT2RadiologicalIsotropic/sub-CC00099AN18.nii.gz Traceback (most recent call last): File "/usr/local/MCRIBS/bin/MCRIBConform", line 3, in <module> import nibabel ModuleNotFoundError: No module named 'nibabel' Command Failed

chrisadamsonmcri commented 3 years ago

Hmm Is that the directory you have MCRIBS installed?

You will need to install nibabel. In debian/ubuntu it is apt install python3-nibabel.

ethompson93 commented 3 years ago

Yes, it is.

OK, thanks! Now I've got the right python libraries installed it runs better. However, I'm now getting this new error in the TissueSegDrawEM step:

/usr/local/MCRIBS/MIRTK/MIRTK-install/lib/tools/convert-image: error while loading shared libraries: libvtkCommonDataModel-7.1.so.1: cannot open shared object file: No such file or directory Error: convert-image command returned non-zero exit status 127

Sorry to keep bothering you with all these issues!