Skip to content

Commit 76203b2

Browse files
committed
modified to handle multiple dsort files
1 parent cb96c1e commit 76203b2

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
from ...utils.filemanip import (load_json, save_json, split_filename,
1414
fname_presuffix)
1515
from ..base import (CommandLineInputSpec, CommandLine, TraitedSpec, traits,
16-
isdefined, File, InputMultiPath, Undefined, Str)
16+
isdefined, File, InputMultiPath, Undefined, Str,
17+
InputMultiObject)
1718

1819
from .base import (AFNICommandBase, AFNICommand, AFNICommandInputSpec,
1920
AFNICommandOutputSpec, AFNIPythonCommandInputSpec,
@@ -2492,14 +2493,15 @@ class TProjectInputSpec(AFNICommandInputSpec):
24922493
even if -ort contains constant terms, as all means are
24932494
removed.""",
24942495
argstr="-polort %d")
2495-
dsort = File(
2496+
dsort = InputMultiObject(
2497+
File(
2498+
exists=True,
2499+
copyfile=False),
2500+
argstr="%s",
24962501
desc="""Remove the 3D+time time series in dataset fset.
24972502
++ That is, 'fset' contains a different nuisance time
2498-
series for each voxel (e.g., from AnatICOR).
2499-
++ Multiple -dsort options are allowed.""",
2500-
argstr='-dsort %s',
2501-
exists=True,
2502-
copyfile=False)
2503+
series for each voxel (e.g., from AnatICOR).
2504+
++ Multiple -dsort options are allowed.""")
25032505
bandpass = traits.Tuple(
25042506
traits.Float, traits.Float,
25052507
desc="""Remove all frequencies EXCEPT those in the range""",
@@ -2567,6 +2569,11 @@ class TProject(AFNICommand):
25672569
_cmd = '3dTproject'
25682570
input_spec = TProjectInputSpec
25692571
output_spec = AFNICommandOutputSpec
2572+
2573+
def _format_arg(self, name, spec, value):
2574+
if name == 'dsort':
2575+
return ' '.join(["-dsort %s" % dsort_file for dsort_file in value])
2576+
return super(TProject, self)._format_arg(name, spec, value)
25702577

25712578
class TShiftInputSpec(AFNICommandInputSpec):
25722579
in_file = File(

nipype/interfaces/afni/tests/test_auto_TProject.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def test_TProject_inputs():
1717
censor=dict(argstr='-censor %s', ),
1818
censortr=dict(argstr='-CENSORTR %s', ),
1919
concat=dict(argstr='-concat %s', ),
20+
dsort=dict(argstr='%s', ),
2021
environ=dict(
2122
nohash=True,
2223
usedefault=True,

nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def test_AntsJointFusion_inputs():
5757
hash_files=False,
5858
),
5959
out_label_post_prob_name_format=dict(
60-
requires=['out_label_fusion', 'out_intensity_fusion_name_format'],
61-
),
60+
requires=['out_label_fusion',
61+
'out_intensity_fusion_name_format'], ),
6262
patch_metric=dict(argstr='-m %s', ),
6363
patch_radius=dict(
6464
argstr='-p %s',

0 commit comments

Comments
 (0)