algorithms.rapidart¶
ArtifactDetect¶
Detects outliers in a functional imaging series
Uses intensity and motion parameters to infer outliers. If use_norm is True, it computes the movement of the center of each face a cuboid centered around the head and returns the maximal movement across the centers. If you wish to use individual thresholds instead, import Undefined from nipype.interfaces.base and set ….inputs.use_norm = Undefined
Examples¶
>>> ad = ArtifactDetect()
>>> ad.inputs.realigned_files = 'functional.nii'
>>> ad.inputs.realignment_parameters = 'functional.par'
>>> ad.inputs.parameter_source = 'FSL'
>>> ad.inputs.norm_threshold = 1
>>> ad.inputs.use_differences = [True, False]
>>> ad.inputs.zintensity_threshold = 3
>>> ad.run() # doctest: +SKIP
Inputs:
[Mandatory]
realigned_files: (a list of items which are a pathlike object or
string representing an existing file)
Names of realigned functional data files
realignment_parameters: (a list of items which are a pathlike object
or string representing an existing file)
Names of realignment parameters corresponding to the functional data
files
parameter_source: ('SPM' or 'FSL' or 'AFNI' or 'NiPy' or 'FSFAST')
Source of movement parameters
norm_threshold: (a float)
Threshold to use to detect motion-related outliers when composite
motion is being used
mutually_exclusive: rotation_threshold, translation_threshold
rotation_threshold: (a float)
Threshold (in radians) to use to detect rotation-related outliers
mutually_exclusive: norm_threshold
translation_threshold: (a float)
Threshold (in mm) to use to detect translation-related outliers
mutually_exclusive: norm_threshold
zintensity_threshold: (a float)
Intensity Z-threshold use to detection images that deviate from the
mean
mask_type: ('spm_global' or 'file' or 'thresh')
Type of mask that should be used to mask the functional data.
*spm_global* uses an spm_global like calculation to determine the
brain mask. *file* specifies a brain mask file (should be an image
file consisting of 0s and 1s). *thresh* specifies a threshold to
use. By default all voxels are used,unless one of these mask types
are defined
[Optional]
use_differences: (a list of items which are a bool or None, nipype
default value: [True, False])
Use differences between successive motion (first element) and
intensity parameter (second element) estimates in order to determine
outliers. (default is [True, False])
use_norm: (a boolean, nipype default value: True)
Uses a composite of the motion parameters in order to determine
outliers.
requires: norm_threshold
mask_file: (a pathlike object or string representing an existing
file)
Mask file to be used if mask_type is 'file'.
mask_threshold: (a float)
Mask threshold to be used if mask_type is 'thresh'.
intersect_mask: (a boolean, nipype default value: True)
Intersect the masks when computed from spm_global.
save_plot: (a boolean, nipype default value: True)
save plots containing outliers
plot_type: ('png' or 'svg' or 'eps' or 'pdf', nipype default value:
png)
file type of the outlier plot
bound_by_brainmask: (a boolean, nipype default value: False)
use the brain mask to determine bounding boxfor composite norm
(worksfor SPM and Nipy - currentlyinaccurate for FSL, AFNI
global_threshold: (a float, nipype default value: 8.0)
use this threshold when mask type equal's spm_global
Outputs:
outlier_files: (a list of items which are a pathlike object or string
representing an existing file)
One file for each functional run containing a list of 0-based
indices corresponding to outlier volumes
intensity_files: (a list of items which are a pathlike object or
string representing an existing file)
One file for each functional run containing the global intensity
values determined from the brainmask
norm_files: (a list of items which are a pathlike object or string
representing a file)
One file for each functional run containing the composite norm
statistic_files: (a list of items which are a pathlike object or
string representing an existing file)
One file for each functional run containing information about the
different types of artifacts and if design info is provided then
details of stimulus correlated motion and a listing or artifacts by
event type.
plot_files: (a list of items which are a pathlike object or string
representing a file)
One image file for each functional run containing the detected
outliers
mask_files: (a list of items which are a pathlike object or string
representing a file)
One image file for each functional run containing the mask used for
global signal calculation
displacement_files: (a list of items which are a pathlike object or
string representing a file)
One image file for each functional run containing the voxel
displacement timeseries
StimulusCorrelation¶
Determines if stimuli are correlated with motion or intensity parameters.
Currently this class supports an SPM generated design matrix and requires intensity parameters. This implies that one must run ArtifactDetect and Level1Design prior to running this or provide an SPM.mat file and intensity parameters through some other means.
Examples¶
>>> sc = StimulusCorrelation()
>>> sc.inputs.realignment_parameters = 'functional.par'
>>> sc.inputs.intensity_values = 'functional.rms'
>>> sc.inputs.spm_mat_file = 'SPM.mat'
>>> sc.inputs.concatenated_design = False
>>> sc.run() # doctest: +SKIP
Inputs:
[Mandatory]
realignment_parameters: (a list of items which are a pathlike object
or string representing an existing file)
Names of realignment parameters corresponding to the functional data
files
intensity_values: (a list of items which are a pathlike object or
string representing an existing file)
Name of file containing intensity values
spm_mat_file: (a pathlike object or string representing an existing
file)
SPM mat file (use pre-estimate SPM.mat file)
concatenated_design: (a boolean)
state if the design matrix contains concatenated sessions
Outputs:
stimcorr_files: (a list of items which are a pathlike object or
string representing an existing file)
List of files containing correlation values