File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -588,6 +588,13 @@ class SelectFiles(IOBase):
588
588
>>> dg.outputs.get()
589
589
{'T1': <undefined>, 'epi': <undefined>}
590
590
591
+ The same thing with dynamic grabbing of specific files:
592
+
593
+ >>> templates["epi"] = "{subject_id}/func/f{run!s}.nii"
594
+ >>> dg = Node(SelectFiles(templates), "selectfiles")
595
+ >>> dg.inputs.subject_id = "subj1"
596
+ >>> dg.inputs.run = [2, 4]
597
+
591
598
"""
592
599
input_spec = SelectFilesInputSpec
593
600
output_spec = DynamicTraitedSpec
Original file line number Diff line number Diff line change @@ -42,6 +42,13 @@ def test_selectfiles():
42
42
"interfaces/spm/preprocess.py" )
43
43
yield assert_equal , res .outputs .preprocess , [wanted ]
44
44
45
+ templates = {"converter" : "interfaces/dcm{to!s}nii.py" }
46
+ dg = nio .SelectFiles (templates , base_directory = base_dir )
47
+ dg .inputs .to = 2
48
+ res = dg .run ()
49
+ wanted = op .join (base_dir , "interfaces/dcm2nii.py" )
50
+ yield assert_equal , res .outputs .converter , wanted
51
+
45
52
46
53
def test_datasink ():
47
54
ds = nio .DataSink ()
You can’t perform that action at this time.
0 commit comments