Skip to content

Commit e37bb4a

Browse files
authored
Merge pull request #1524 from satra/fix/fast
Fix/fast
2 parents df8d607 + 84f6c58 commit e37bb4a

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

nipype/interfaces/fsl/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ def _gen_fname(self, name):
15711571
path, outname, ext = split_filename(self.inputs.out_file)
15721572

15731573
method = 'none'
1574-
if isdefined(self.inputs.method) and self.inputs.method == 'fast':
1574+
if isdefined(self.inputs.method) and self.inputs.method != 'none':
15751575
method = 'fast'
15761576

15771577
if isdefined(self.inputs.method_as_numerical_threshold):

nipype/interfaces/fsl/tests/test_preprocess.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
skipif)
1111

1212
from nipype.utils.filemanip import split_filename
13-
import nipype.interfaces.fsl.preprocess as fsl
13+
from .. import preprocess as fsl
1414
from nipype.interfaces.fsl import Info
1515
from nipype.interfaces.base import File, TraitError, Undefined, isdefined
1616
from nipype.interfaces.fsl import no_fsl
@@ -564,3 +564,18 @@ def test_fugue():
564564
yield assert_equal, op.basename(res.outputs.unwarped_file), out_name
565565

566566
teardown_fugue(tmpdir)
567+
568+
569+
@skipif(no_fsl)
570+
def test_first_genfname():
571+
first = fsl.FIRST()
572+
first.inputs.out_file = 'segment.nii'
573+
first.inputs.output_type = "NIFTI_GZ"
574+
575+
value = first._gen_fname(name='original_segmentations')
576+
expected_value = os.path.abspath('segment_all_fast_origsegs.nii.gz')
577+
yield assert_equal, value, expected_value
578+
first.inputs.method = 'none'
579+
value = first._gen_fname(name='original_segmentations')
580+
expected_value = os.path.abspath('segment_all_none_origsegs.nii.gz')
581+
yield assert_equal, value, expected_value

0 commit comments

Comments
 (0)