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 21
21
import nibabel as nb
22
22
import warnings
23
23
24
+ from ... import logging
24
25
from ...utils .filemanip import split_filename
25
26
from ...utils import NUMPY_MMAP
26
27
@@ -522,18 +523,20 @@ def _num_threads_update(self):
522
523
523
524
@staticmethod
524
525
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' )):
530
533
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' )):
532
535
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'
537
540
538
541
@property
539
542
def _cmd (self ):
You can’t perform that action at this time.
0 commit comments