Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
from nipype.interfaces.base import (
File,
InputMultiPath,
OutputMultiPath,
TraitedSpec,
traits,
)
from nipype.interfaces.spm.base import SPMCommand, SPMCommandInputSpec
from nipype.interfaces.spm.base import SPMCommandInputSpec
from nipype.interfaces.spm.preprocess import ApplyDeformations
from nipype.utils.filemanip import filename_to_list, list_to_filename


Expand Down Expand Up @@ -129,11 +128,7 @@ class ApplySegmentationDeformationInput(SPMCommandInputSpec):
)


class ApplySegmentationDeformationOutput(TraitedSpec):
out_files = OutputMultiPath(File(exists=True), desc="Transformed files")


class ApplySegmentationDeformation(SPMCommand):
class ApplySegmentationDeformation(ApplyDeformations):
"""Uses SPM to apply a deformation field obtained from Segmentation routine to a given file

Examples
Expand All @@ -147,10 +142,6 @@ class ApplySegmentationDeformation(SPMCommand):
"""

input_spec = ApplySegmentationDeformationInput
output_spec = ApplySegmentationDeformationOutput

_jobtype = "util"
_jobname = "defs"

def _format_arg(self, opt, spec, val):
"""Convert input to appropriate format for spm"""
Expand All @@ -159,11 +150,3 @@ def _format_arg(self, opt, spec, val):
if opt == "in_files":
return np.array(filename_to_list(val), dtype=object)
return val

def _list_outputs(self):
outputs = self._outputs().get()
outputs["out_files"] = []
for filename in self.inputs.in_files:
_, fname = os.path.split(filename)
outputs["out_files"].append(os.path.realpath("w%s" % fname))
return outputs
Loading