Skip to content

Commit 3c7d0c2

Browse files
committed
better handle default values of slice_encoding_direction
1 parent 169e827 commit 3c7d0c2

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2619,7 +2619,8 @@ class TShiftInputSpec(AFNICommandInputSpec):
26192619
argstr='-tpattern @%s',
26202620
xor=['tpattern'])
26212621
slice_encoding_direction = traits.Enum(
2622-
('k', 'k-'),
2622+
'k', 'k-',
2623+
usedefault=True,
26232624
desc='Direction in which slice_timing is specified (default: k). If negative,'
26242625
'slice_timing is defined in reverse order -- see BIDS specification for details.',)
26252626
rlt = traits.Bool(
@@ -2728,13 +2729,9 @@ def _format_arg(self, name, trait_spec, value):
27282729

27292730
def _write_slice_timing(self):
27302731
slice_timing = self.inputs.slice_timing.copy()
2731-
if not self.inputs.slice_encoding_direction:
2732-
slice_encoding_direction = "k"
2733-
else:
2734-
slice_encoding_direction = self.inputs.slice_encoding_direction
2735-
if slice_encoding_direction.endswith("-"):
2732+
if self.inputs.slice_encoding_direction.endswith("-"):
27362733
slice_timing.reverse()
2737-
2734+
27382735
fname = 'slice_timing.1D'
27392736
with open(fname, 'w') as fobj:
27402737
fobj.write('\t'.join(map(str, slice_timing)))

0 commit comments

Comments
 (0)