@@ -1980,3 +1980,45 @@ class WarpPointsToStd(WarpPoints):
1980
1980
input_spec = WarpPointsToStdInputSpec
1981
1981
output_spec = WarpPointsOutputSpec
1982
1982
_cmd = 'img2stdcoord'
1983
+
1984
+
1985
+ class MotionOutliersInputSpec (FSLCommandInputSpec ):
1986
+ in_file = File (exists = True , mandatory = True , desc = "unfiltered 4D image" , argstr = "-i %s" )
1987
+ out_file = File (argstr = "-o %s" , name_source = 'in_file' , name_template = '%s_outliers.txt' ,
1988
+ keep_extension = True , desc = 'output outlier file name' , hash_files = False )
1989
+ mask = File (exists = True , argstr = "-m %s" , desc = "mask image for calculating metric" )
1990
+ metric = traits .Enum ('refrms' , ['refrms' , 'dvars' , 'refmse' , 'fd' , 'fdrms' ], argstr = "--%s" , desc = "metrics: refrms - RMS intensity difference to reference volume as metric [default metric],\
1991
+ refmse - Mean Square Error version of refrms (used in original version of fsl_motion_outliers) \
1992
+ dvars - DVARS \
1993
+ fd - frame displacement \
1994
+ fdrms - FD with RMS matrix calculation" )
1995
+ threshold = traits .Float (argstr = "--thresh=%g" , desc = "specify absolute threshold value (otherwise use box-plot cutoff = P75 + 1.5*IQR)" )
1996
+ no_motion_correction = traits .Bool (argstr = "--nomoco" , desc = "do not run motion correction (assumed already done)" )
1997
+ dummy = traits .Int (argstr = "--dummy=%d" , desc = 'number of dummy scans to delete (before running anything and creating EVs)' )
1998
+ out_metric_values = File (argstr = "-s %s" , name_source = 'in_file' , name_template = '%s_metrics.txt' ,
1999
+ keep_extension = True , desc = 'output metric values (DVARS etc.) file name' , hash_files = False )
2000
+ out_metric_plot = File (argstr = "-p %s" , name_source = 'in_file' , name_template = '%s_metrics.png' ,
2001
+ keep_extension = True , desc = 'output metric values plot (DVARS etc.) file name' , hash_files = False )
2002
+
2003
+ class MotionOutliersOutputSpec (TraitedSpec ):
2004
+ out_file = File (exists = True )
2005
+ out_metric_values = File (exists = True )
2006
+ out_metric_plot = File (exists = True )
2007
+
2008
+
2009
+ class MotionOutliers (FSLCommand ):
2010
+ """
2011
+ Use FSL fsl_motion_outliers`http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FSLMotionOutliers`_ to find outliers in timeseries (4d) data.
2012
+ Examples
2013
+ --------
2014
+ >>> from nipype.interfaces.fsl import MotionOutliers
2015
+ >>> mo = MotionOutliers()
2016
+ >>> mo.inputs.in_file = "epi.nii"
2017
+ >>> mo.cmdline # doctest: +ELLIPSIS
2018
+ 'fsl_motion_outliers -i epi.nii -o epi_outliers.txt -p epi_metrics.png -s epi_metrics.txt'
2019
+ >>> res = mo.run() # doctest: +SKIP
2020
+ """
2021
+
2022
+ input_spec = MotionOutliersInputSpec
2023
+ output_spec = MotionOutliersOutputSpec
2024
+ _cmd = 'fsl_motion_outliers'
0 commit comments