Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion nipype/interfaces/fsl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .utils import (Smooth, Merge, ExtractROI, Split, ImageMaths, ImageMeants,
ImageStats, FilterRegressor, Overlay, Slicer,
PlotTimeSeries, PlotMotionParams, ConvertXFM,
SwapDimensions, PowerSpectrum)
SwapDimensions, PowerSpectrum, Reorient2Std)
from .dti import (EddyCorrect, BEDPOSTX, DTIFit, ProbTrackX, VecReg, ProjThresh,
FindTheBiggest, DistanceMap, TractSkeleton, XFibres,
MakeDyadicVectors)
Expand Down
36 changes: 36 additions & 0 deletions nipype/interfaces/fsl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1151,3 +1151,39 @@ def _list_outputs(self):
outputs['exf_mask'] = self._gen_fname(cwd=self.inputs.tmpdir,
basename='maskexf')
return outputs

class Reorient2StdInputSpec(FSLCommandInputSpec):
in_file = File(exists=True, mandatory=True, argstr="%s")
out_file = File(genfile=True, hash_files=False, argstr="%s")

class Reorient2StdOutputSpec(TraitedSpec):
out_file = File(exists=True)

class Reorient2Std(FSLCommand):
"""fslreorient2std is a tool for reorienting the image to match the
approximate orientation of the standard template images (MNI152).

Examples
--------
>>> reorient = Reorient2Std()
>>> reorient.inputs.in_file = "functional.nii"
>>> res = reorient.run() # doctest: +SKIP


"""
_cmd = 'fslreorient2std'
input_spec = Reorient2StdInputSpec
output_spec = Reorient2StdOutputSpec

def _gen_filename(self, name):
if name == 'out_file':
return self._gen_fname(self.inputs.in_file,
suffix="_reoriented")
return None

def _list_outputs(self):
outputs = self.output_spec().get()
if not isdefined(self.inputs.out_file):
outputs['out_file'] = self._gen_filename('out_file')
else:
outputs['out_file'] = os.path.abspath(self.inputs.out_file)