File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 2121import nibabel as nb
2222import warnings
2323
24+ from ... import logging
2425from ...utils .filemanip import split_filename
2526from ...utils import NUMPY_MMAP
2627
@@ -522,18 +523,20 @@ def _num_threads_update(self):
522523
523524 @staticmethod
524525 def _eddycmd (use_cuda ):
525- if 'FSL_BIN' not in os .environ :
526- raise RuntimeError ("eddy command requires environment variable "
527- "FSL_BIN to be set" )
528- FSL_BIN = os .environ ['FSL_BIN' ]
529- if use_cuda and os .path .exists (os .path .join (FSL_BIN , 'eddy_cuda' )):
526+ logger = logging .getLogger ('interface' )
527+ if 'FSLDIR' not in os .environ :
528+ logger .warn ("FSLDIR not set: assuming command 'eddy'" )
529+ return 'eddy'
530+
531+ FSLDIR = os .environ ['FSLDIR' ]
532+ if use_cuda and os .path .exists (os .path .join (FSLDIR , 'eddy_cuda' )):
530533 return 'eddy_cuda'
531- elif os .path .exists (os .path .join (FSL_BIN , 'eddy_openmp' )):
534+ elif os .path .exists (os .path .join (FSLDIR , 'eddy_openmp' )):
532535 return 'eddy_openmp'
533- elif os .path .exists (os .path .join (FSL_BIN , 'eddy' )):
534- return ' eddy'
535- raise RuntimeError ( "eddy command not found in FSL_BIN: "
536- "'{}'" . format ( FSL_BIN ))
536+ elif not os .path .exists (os .path .join (FSLDIR , 'eddy' )):
537+ logger . warn ( "No eddy binary found in FSLDIR; assuming command "
538+ "'eddy' \n FSLDIR: '{}'" . format ( FSLDIR ))
539+ return 'eddy'
537540
538541 @property
539542 def _cmd (self ):
You can’t perform that action at this time.
0 commit comments