12
12
TraitedSpec ,
13
13
BaseInterfaceInputSpec ,
14
14
File ,
15
- InputMultiPath ,
16
- OutputMultiPath ,
15
+ InputMultiObject ,
16
+ OutputMultiObject ,
17
17
SimpleInterface ,
18
18
)
19
- from nipype .interfaces .ants . resampling import ApplyTransformsInputSpec
19
+ from niworkflows .interfaces .fixes import FixTraitApplyTransformsInputSpec
20
20
21
21
LOGGER = logging .getLogger ("nipype.interface" )
22
22
23
23
24
24
class _MCFLIRT2ITKInputSpec (BaseInterfaceInputSpec ):
25
- in_files = InputMultiPath (
25
+ in_files = InputMultiObject (
26
26
File (exists = True ), mandatory = True , desc = "list of MAT files from MCFLIRT"
27
27
)
28
28
in_reference = File (
@@ -96,8 +96,8 @@ def _run_interface(self, runtime):
96
96
return runtime
97
97
98
98
99
- class _MultiApplyTransformsInputSpec (ApplyTransformsInputSpec ):
100
- input_image = InputMultiPath (
99
+ class _MultiApplyTransformsInputSpec (FixTraitApplyTransformsInputSpec ):
100
+ input_image = InputMultiObject (
101
101
File (exists = True ),
102
102
mandatory = True ,
103
103
desc = "input time-series as a list of volumes after splitting"
@@ -115,7 +115,7 @@ class _MultiApplyTransformsInputSpec(ApplyTransformsInputSpec):
115
115
116
116
117
117
class _MultiApplyTransformsOutputSpec (TraitedSpec ):
118
- out_files = OutputMultiPath (File (), desc = "the output ITKTransform file" )
118
+ out_files = OutputMultiObject (File (), desc = "the output ITKTransform file" )
119
119
log_cmdline = File (desc = "a list of command lines used to apply transforms" )
120
120
121
121
@@ -254,6 +254,10 @@ def _arrange_xfms(transforms, num_files, tmp_folder):
254
254
# Initialize the transforms matrix
255
255
xfms_T = []
256
256
for i , tf_file in enumerate (transforms ):
257
+ if tf_file == "identity" :
258
+ xfms_T .append ([tf_file ] * num_files )
259
+ continue
260
+
257
261
# If it is a deformation field, copy to the tfs_matrix directly
258
262
if guess_type (tf_file )[0 ] != "text/plain" :
259
263
xfms_T .append ([tf_file ] * num_files )
0 commit comments