File tree Expand file tree Collapse file tree 2 files changed +19
-9
lines changed
Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change 44
55import nibabel as nb
66
7- from nipype .interfaces .base import traits
7+ from nipype .interfaces .base import traits , InputMultiObject , File
88from nipype .utils .filemanip import fname_presuffix
9- from nipype .interfaces .ants .resampling import ApplyTransforms
9+ from nipype .interfaces .ants .resampling import ApplyTransforms , ApplyTransformsInputSpec
1010from nipype .interfaces .ants .registration import Registration
1111from nipype .interfaces .ants .segmentation import (
1212 N4BiasFieldCorrection as VanillaN4 ,
1717from .utils import _copyxform
1818
1919
20+ class FixTraitApplyTransformsInputSpec (ApplyTransformsInputSpec ):
21+ transforms = InputMultiObject (
22+ traits .Either (File (exists = True ), 'identity' ),
23+ argstr = "%s" ,
24+ mandatory = True ,
25+ desc = "transform files: will be applied in reverse order. For "
26+ "example, the last specified transform will be applied first." ,
27+ )
28+
2029class FixHeaderApplyTransforms (ApplyTransforms ):
2130 """
2231 A replacement for nipype.interfaces.ants.resampling.ApplyTransforms that
2332 fixes the resampled image header to match the xform of the reference
2433 image
2534 """
35+ input_spec = FixTraitApplyTransformsInputSpec
2636
2737 def _run_interface (self , runtime , correct_return_codes = (0 ,)):
2838 # Run normally
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments