niworkflows.interfaces.patches module¶
Temporary patches.
- class niworkflows.interfaces.patches.FreeSurferSource(from_file=None, resource_monitor=None, ignore_exception=False, **inputs)[source]¶
Bases:
FreeSurferSource
Patch to allow grabbing the T2 volume, if available
- Mandatory Inputs:
subject_id (a string) – Subject name for whom to retrieve data.
subjects_dir (a pathlike object or string representing an existing directory) – Freesurfer subjects directory.
- Optional Inputs:
hemi (‘both’ or ‘lh’ or ‘rh’) – Selects hemisphere specific outputs. (Nipype default value:
both
)- Outputs:
BA_stats (a list of items which are a pathlike object or string representing an existing file) – Brodmann Area statistics files.
T1 (a pathlike object or string representing an existing file) – Intensity normalized whole-head volume.
T2 (a pathlike object or string representing a file) – Intensity normalized whole-head volume.
annot (a list of items which are a pathlike object or string representing an existing file) – Surface annotation files.
aparc_a2009s_stats (a list of items which are a pathlike object or string representing an existing file) – Aparc a2009s parcellation statistics files.
aparc_aseg (a list of items which are a pathlike object or string representing an existing file) – Aparc parcellation projected into aseg volume.
aparc_stats (a list of items which are a pathlike object or string representing an existing file) – Aparc parcellation statistics files.
area_pial (a list of items which are a pathlike object or string representing an existing file) – Mean area of triangles each vertex on the pial surface is associated with.
aseg (a pathlike object or string representing an existing file) – Volumetric map of regions from automatic segmentation.
aseg_stats (a list of items which are a pathlike object or string representing an existing file) – Automated segmentation statistics file.
avg_curv (a list of items which are a pathlike object or string representing an existing file) – Average atlas curvature, sampled to subject.
brain (a pathlike object or string representing an existing file) – Intensity normalized brain-only volume.
brainmask (a pathlike object or string representing an existing file) – Skull-stripped (brain-only) volume.
curv (a list of items which are a pathlike object or string representing an existing file) – Maps of surface curvature.
curv_pial (a list of items which are a pathlike object or string representing an existing file) – Curvature of pial surface.
curv_stats (a list of items which are a pathlike object or string representing an existing file) – Curvature statistics files.
entorhinal_exvivo_stats (a list of items which are a pathlike object or string representing an existing file) – Entorhinal exvivo statistics files.
filled (a pathlike object or string representing an existing file) – Subcortical mass volume.
graymid (a list of items which are a pathlike object or string representing an existing file) – Graymid/midthickness surface meshes.
inflated (a list of items which are a pathlike object or string representing an existing file) – Inflated surface meshes.
jacobian_white (a list of items which are a pathlike object or string representing an existing file) – Distortion required to register to spherical atlas.
label (a list of items which are a pathlike object or string representing an existing file) – Volume and surface label files.
norm (a pathlike object or string representing an existing file) – Normalized skull-stripped volume.
nu (a pathlike object or string representing an existing file) – Non-uniformity corrected whole-head volume.
orig (a pathlike object or string representing an existing file) – Base image conformed to Freesurfer space.
pial (a list of items which are a pathlike object or string representing an existing file) – Gray matter/pia matter surface meshes.
rawavg (a pathlike object or string representing an existing file) – Volume formed by averaging input images.
ribbon (a list of items which are a pathlike object or string representing an existing file) – Volumetric maps of cortical ribbons.
smoothwm (a list of items which are a pathlike object or string representing an existing file) – Smoothed original surface meshes.
sphere (a list of items which are a pathlike object or string representing an existing file) – Spherical surface meshes.
sphere_reg (a list of items which are a pathlike object or string representing an existing file) – Spherical registration file.
sulc (a list of items which are a pathlike object or string representing an existing file) – Surface maps of sulcal depth.
thickness (a list of items which are a pathlike object or string representing an existing file) – Surface maps of cortical thickness.
volume (a list of items which are a pathlike object or string representing an existing file) – Surface maps of cortical volume.
white (a list of items which are a pathlike object or string representing an existing file) – White/gray matter surface meshes.
wm (a pathlike object or string representing an existing file) – Segmented white-matter volume.
wmparc (a pathlike object or string representing an existing file) – Aparc parcellation projected into subcortical white matter.
wmparc_stats (a list of items which are a pathlike object or string representing an existing file) – White matter parcellation statistics file.
- class niworkflows.interfaces.patches.RobustACompCor(*args, **kwargs)[source]¶
Bases:
ACompCor
Runs aCompCor several times if it suddenly fails with https://github.com/nipreps/fmriprep/issues/776
- Mandatory Inputs:
realigned_file (a pathlike object or string representing an existing file) – Already realigned brain image (4D).
- Optional Inputs:
components_file (a string) – Filename to store physiological components. (Nipype default value:
components_file.txt
)failure_mode (‘error’ or ‘NaN’) – When no components are found or convergence fails, raise an error or silently return columns of NaNs. (Nipype default value:
error
)header_prefix (a string) – The desired header for the output tsv file (one column). If undefined, will default to “CompCor”.
high_pass_cutoff (a float) – Cutoff (in seconds) for “cosine” pre-filter. (Nipype default value:
128
)ignore_initial_volumes (an integer >= 0) – Number of volumes at start of series to ignore. (Nipype default value:
0
)mask_files (a list of items which are a pathlike object or string representing an existing file) – One or more mask files that determines ROI (3D). When more that one file is provided
merge_method
ormerge_index
must be provided.mask_index (an integer >= 0) – Position of mask in
mask_files
to use - first is the default. Mutually exclusive with inputs:merge_method
. Requires inputs:mask_files
.mask_names (a list of items which are a string) – Names for provided masks (for printing into metadata). If provided, it must be as long as the final mask list (after any merge and indexing operations).
merge_method (‘union’ or ‘intersect’ or ‘none’) – Merge method if multiple masks are present -
union
uses voxels included in at least one input mask,intersect
uses only voxels present in all input masks,none
performs CompCor on each mask individually. Mutually exclusive with inputs:mask_index
. Requires inputs:mask_files
.num_components (an integer >= 1 or ‘all’) – Number of components to return from the decomposition. If
num_components
isall
, then all components will be retained. Mutually exclusive with inputs:variance_threshold
.pre_filter (‘polynomial’ or ‘cosine’ or False) – Detrend time series prior to component extraction. (Nipype default value:
polynomial
)regress_poly_degree (an integer >= 1) – The degree polynomial to use. (Nipype default value:
1
)repetition_time (a float) – Repetition time (TR) of series - derived from image header if unspecified.
save_metadata (a boolean or a pathlike object or string representing a file) – Save component metadata as text file. (Nipype default value:
False
)save_pre_filter (a boolean or a pathlike object or string representing a file) – Save pre-filter basis as text file. (Nipype default value:
False
)use_regress_poly (a boolean) – Use polynomial regression pre-component extraction.
variance_threshold (0.0 < a floating point number < 1.0) – Select the number of components to be returned automatically based on their ability to explain variance in the dataset.
variance_threshold
is a fractional value between 0 and 1; the number of components retained will be equal to the minimum number of components necessary to explain the provided fraction of variance in the masked time series. Mutually exclusive with inputs:num_components
.
- Outputs:
components_file (a pathlike object or string representing an existing file) – Text file containing the noise components.
metadata_file (a pathlike object or string representing a file) – Text file containing component metadata.
pre_filter_file (a pathlike object or string representing a file) – Text file containing high-pass filter basis.
- class niworkflows.interfaces.patches.RobustTCompCor(*args, **kwargs)[source]¶
Bases:
TCompCor
Runs tCompCor several times if it suddenly fails with https://github.com/nipreps/fmriprep/issues/940
- Mandatory Inputs:
realigned_file (a pathlike object or string representing an existing file) – Already realigned brain image (4D).
- Optional Inputs:
components_file (a string) – Filename to store physiological components. (Nipype default value:
components_file.txt
)failure_mode (‘error’ or ‘NaN’) – When no components are found or convergence fails, raise an error or silently return columns of NaNs. (Nipype default value:
error
)header_prefix (a string) – The desired header for the output tsv file (one column). If undefined, will default to “CompCor”.
high_pass_cutoff (a float) – Cutoff (in seconds) for “cosine” pre-filter. (Nipype default value:
128
)ignore_initial_volumes (an integer >= 0) – Number of volumes at start of series to ignore. (Nipype default value:
0
)mask_files (a list of items which are a pathlike object or string representing an existing file) – One or more mask files that determines ROI (3D). When more that one file is provided
merge_method
ormerge_index
must be provided.mask_index (an integer >= 0) – Position of mask in
mask_files
to use - first is the default. Mutually exclusive with inputs:merge_method
. Requires inputs:mask_files
.mask_names (a list of items which are a string) – Names for provided masks (for printing into metadata). If provided, it must be as long as the final mask list (after any merge and indexing operations).
merge_method (‘union’ or ‘intersect’ or ‘none’) – Merge method if multiple masks are present -
union
uses voxels included in at least one input mask,intersect
uses only voxels present in all input masks,none
performs CompCor on each mask individually. Mutually exclusive with inputs:mask_index
. Requires inputs:mask_files
.num_components (an integer >= 1 or ‘all’) – Number of components to return from the decomposition. If
num_components
isall
, then all components will be retained. Mutually exclusive with inputs:variance_threshold
.percentile_threshold (0.0 < a floating point number < 1.0) – The percentile used to select highest-variance voxels, represented by a number between 0 and 1, exclusive. By default, this value is set to .02. That is, the 2% of voxels with the highest variance are used. (Nipype default value:
0.02
)pre_filter (‘polynomial’ or ‘cosine’ or False) – Detrend time series prior to component extraction. (Nipype default value:
polynomial
)regress_poly_degree (an integer >= 1) – The degree polynomial to use. (Nipype default value:
1
)repetition_time (a float) – Repetition time (TR) of series - derived from image header if unspecified.
save_metadata (a boolean or a pathlike object or string representing a file) – Save component metadata as text file. (Nipype default value:
False
)save_pre_filter (a boolean or a pathlike object or string representing a file) – Save pre-filter basis as text file. (Nipype default value:
False
)use_regress_poly (a boolean) – Use polynomial regression pre-component extraction.
variance_threshold (0.0 < a floating point number < 1.0) – Select the number of components to be returned automatically based on their ability to explain variance in the dataset.
variance_threshold
is a fractional value between 0 and 1; the number of components retained will be equal to the minimum number of components necessary to explain the provided fraction of variance in the masked time series. Mutually exclusive with inputs:num_components
.
- Outputs:
components_file (a pathlike object or string representing an existing file) – Text file containing the noise components.
high_variance_masks (a list of items which are a pathlike object or string representing an existing file) – Voxels exceeding the variance threshold.
metadata_file (a pathlike object or string representing a file) – Text file containing component metadata.
pre_filter_file (a pathlike object or string representing a file) – Text file containing high-pass filter basis.