1212 TraitedSpec ,
1313 BaseInterfaceInputSpec ,
1414 File ,
15- InputMultiPath ,
16- OutputMultiPath ,
15+ InputMultiObject ,
16+ OutputMultiObject ,
1717 SimpleInterface ,
1818)
19- from nipype .interfaces .ants . resampling import ApplyTransformsInputSpec
19+ from niworkflows .interfaces .fixes import FixTraitApplyTransformsInputSpec
2020
2121LOGGER = logging .getLogger ("nipype.interface" )
2222
2323
2424class _MCFLIRT2ITKInputSpec (BaseInterfaceInputSpec ):
25- in_files = InputMultiPath (
25+ in_files = InputMultiObject (
2626 File (exists = True ), mandatory = True , desc = "list of MAT files from MCFLIRT"
2727 )
2828 in_reference = File (
@@ -96,8 +96,8 @@ def _run_interface(self, runtime):
9696 return runtime
9797
9898
99- class _MultiApplyTransformsInputSpec (ApplyTransformsInputSpec ):
100- input_image = InputMultiPath (
99+ class _MultiApplyTransformsInputSpec (FixTraitApplyTransformsInputSpec ):
100+ input_image = InputMultiObject (
101101 File (exists = True ),
102102 mandatory = True ,
103103 desc = "input time-series as a list of volumes after splitting"
@@ -115,7 +115,7 @@ class _MultiApplyTransformsInputSpec(ApplyTransformsInputSpec):
115115
116116
117117class _MultiApplyTransformsOutputSpec (TraitedSpec ):
118- out_files = OutputMultiPath (File (), desc = "the output ITKTransform file" )
118+ out_files = OutputMultiObject (File (), desc = "the output ITKTransform file" )
119119 log_cmdline = File (desc = "a list of command lines used to apply transforms" )
120120
121121
@@ -254,6 +254,10 @@ def _arrange_xfms(transforms, num_files, tmp_folder):
254254 # Initialize the transforms matrix
255255 xfms_T = []
256256 for i , tf_file in enumerate (transforms ):
257+ if tf_file == "identity" :
258+ xfms_T .append ([tf_file ] * num_files )
259+ continue
260+
257261 # If it is a deformation field, copy to the tfs_matrix directly
258262 if guess_type (tf_file )[0 ] != "text/plain" :
259263 xfms_T .append ([tf_file ] * num_files )
0 commit comments