Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nipype does not recognize ANTS #3202

Closed
ghost opened this issue Apr 7, 2020 · 4 comments
Closed

Nipype does not recognize ANTS #3202

ghost opened this issue Apr 7, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 7, 2020

Summary

I am attempting to execute an antsRegistration /antsRegistrationSynQuick node. I recieve an error message indicating that the command 'antsRegistration' cannot be found. I have attempted to sort out my python environment but I am fully capable of running the other nodes from other softwares.

I have checked my .bashrc and my .bashrc_profile (bash is my base/default, although I have also added the paths to a .zshrc) and I can execute both of these from the command line. The following are the results. First from python when running a Registration interace. The second from command line when I run antsRegistration.

Actual behavior

reg = RegistrationSynQuick()
reg.inputs.fixed_image = '/usr/local/fsl/data/standard/MNI152_T1_2mm_brain.nii.gz'
reg.inputs.moving_image = '/Users/James/Desktop/prac/sub-ID01_ses-1_resting_state_fmri.nii.gz'
reg.run()


OSError Traceback (most recent call last)
in
2 reg.inputs.fixed_image = '/usr/local/fsl/data/standard/MNI152_T1_2mm_brain.nii.gz'
3 reg.inputs.moving_image = '/Users/James/Desktop/prac/sub-ID01_ses-1_resting_state_fmri.nii.gz'
----> 4 reg.run()

~/opt/anaconda3/lib/python3.7/site-packages/nipype/interfaces/base/core.py in run(self, cwd, ignore_exception, **inputs)
395 try:
396 runtime = self._pre_run_hook(runtime)
--> 397 runtime = self._run_interface(runtime)
398 runtime = self._post_run_hook(runtime)
399 outputs = self.aggregate_outputs(runtime)

~/opt/anaconda3/lib/python3.7/site-packages/nipype/interfaces/base/core.py in _run_interface(self, runtime, correct_return_codes)
779 'No command "%s" found on host %s. Please check that the '
780 "corresponding package is installed."
--> 781 % (executable_name, runtime.hostname)
782 )
783

OSError: No command "antsRegistrationSyNQuick.sh" found on host Jamess-MBP.broadband. Please check that the corresponding package is installed.

Note that this error also occurs with other ANTs programs like antsRegistration

IN TERMINAL

(base) Jamess-MBP:~ James$ antsRegistrationSynQuick.sh
Usage:

antsRegistrationSyNQuick.sh -d ImageDimension -f FixedImage -m MovingImage -o OutputPrefix

Example Case:

antsRegistrationSyNQuick.sh -d 3 -f fixedImage.nii.gz -m movingImage.nii.gz -o output

ETC ETC. you get the idea. I can run it in terminal without issue.

Expected behavior

I would expect nipype to be able to find the executables following the proper PATH from the .bashrc's but it appears that nipype cannot make that determination for ANTS alone (FSL's FLIRT or AFNI's 3dDespike will execute without issue).

Platform details:

Mac OSX Catalina Version 10.15.4

200407-19:15:42,773 nipype.utils INFO:
	 No new version available.
{'commit_hash': '%h',
 'commit_source': 'archive substitution',
 'networkx_version': '2.4',
 'nibabel_version': '3.0.1',
 'nipype_version': '1.4.2',
 'numpy_version': '1.18.1',
 'pkg_path': '/Users/James/opt/anaconda3/lib/python3.7/site-packages/nipype',
 'scipy_version': '1.4.1',
 'sys_executable': '/Users/James/opt/anaconda3/bin/python',
 'sys_platform': 'darwin',
 'sys_version': '3.7.4 (default, Aug 13 2019, 15:17:50) \n'
                '[Clang 4.0.1 (tags/RELEASE_401/final)]',
 'traits_version': '6.0.0'}
(base) Jamess-MBP:~ James$ 

Execution environment

jupyter lab from Terminal

@effigies
Copy link
Member

effigies commented Apr 7, 2020

Nipype doesn't do anything special relative to Python, so if it can't find the script, then its copy of PATH is probably missing ANTs. Did you start jupyter-lab from a shell session that was able to find the script?

@ghost
Copy link
Author

ghost commented Apr 9, 2020

You're right! In this instance, restarting jupyter lab allowed it to find the ANTs path. Thank you!

@ghost ghost closed this as completed Apr 9, 2020
@lukevano
Copy link

Dear all, I am having the same issue but do not know how to set up m tcsh shell so this command runs. Could you let me know how to do this?

@effigies
Copy link
Member

Please open a new issue with details of how you are running ANTs outside nipype and how you are running nipype.

@nipy nipy locked as resolved and limited conversation to collaborators Jan 29, 2025
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants