Skip to content

Commit a444faf

Browse files
committed
Merge branch 'master' of https://github.com/nipy/nipype into fix/ersh
2 parents ea5f5e7 + dd1ed4f commit a444faf

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

nipype/interfaces/ants/segmentation.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,12 +1129,30 @@ def _format_arg(self, opt, spec, val):
11291129
retval = ''
11301130
if not isdefined(self.inputs.out_label_fusion):
11311131
retval = '-o {0}'.format(self.inputs.out_intensity_fusion_name_format)
1132+
elif opt == 'atlas_image':
1133+
atlas_image_cmd = " ".join(
1134+
['-g [{0}]'.format(", ".join("'%s'" % fn for fn in ai))
1135+
for ai in self.inputs.atlas_image]
1136+
)
1137+
retval = atlas_image_cmd
1138+
elif opt == 'target_image':
1139+
target_image_cmd = " ".join(
1140+
['-t [{0}]'.format(", ".join("'%s'" % fn for fn in ai))
1141+
for ai in self.inputs.target_image]
1142+
)
1143+
retval = target_image_cmd
1144+
elif opt == 'atlas_segmentation_image':
1145+
assert len(val) == len(self.inputs.atlas_image), "Number of specified " \
1146+
"segmentations should be identical to the number of atlas image " \
1147+
"sets {0}!={1}".format(len(val), len(self.inputs.atlas_image))
1148+
1149+
atlas_segmentation_image_cmd = " ".join(
1150+
['-l {0}'.format(fn) for fn in self.inputs.atlas_segmentation_image]
1151+
)
1152+
retval = atlas_segmentation_image_cmd
11321153
else:
1133-
if opt == 'atlas_segmentation_image':
1134-
assert len(val) == len(self.inputs.atlas_image), "Number of specified " \
1135-
"segmentations should be identical to the number of atlas image " \
1136-
"sets {0}!={1}".format(len(val), len(self.inputs.atlas_image))
1137-
return super(ANTSCommand, self)._format_arg(opt, spec, val)
1154+
1155+
return super(AntsJointFusion, self)._format_arg(opt, spec, val)
11381156
return retval
11391157

11401158
def _list_outputs(self):

nipype/utils/filemanip.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
related_filetype_sets = [
3333
('.hdr', '.img', '.mat'),
34+
('.nii', '.mat'),
3435
('.BRIK', '.HEAD'),
3536
]
3637

nipype/utils/tests/test_filemanip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def test_json():
324324
('/path/test.hdr', 3, ['/path/test.hdr', '/path/test.img', '/path/test.mat']),
325325
('/path/test.BRIK', 2, ['/path/test.BRIK', '/path/test.HEAD']),
326326
('/path/test.HEAD', 2, ['/path/test.BRIK', '/path/test.HEAD']),
327-
('/path/foo.nii', 1, [])
327+
('/path/foo.nii', 2, ['/path/foo.nii', '/path/foo.mat'])
328328
])
329329
def test_related_files(file, length, expected_files):
330330
related_files = get_related_files(file)

0 commit comments

Comments
 (0)