niworkflows.interfaces.reportlets.masks module#

ReportCapableInterfaces for masks tools.

class niworkflows.interfaces.reportlets.masks.ACompCorRPT(generate_report=False, **kwargs)[source]#

Bases: SegmentationRC, ACompCor

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)

  • compress_report (‘auto’ or True or False) – Compress the reportlet using SVGO orWEBP. ‘auto’ - compress if relevant software is installed, True = force,False - don’t attempt to compress. (Nipype default value: auto)

  • 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 or merge_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 is all, then all components will be retained. Mutually exclusive with inputs: variance_threshold.

  • out_report (a pathlike object or string representing a file) – Filename for the visual report. (Nipype default value: report.svg)

  • 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.

  • out_report (a pathlike object or string representing a file) – Filename for the visual report.

  • pre_filter_file (a pathlike object or string representing a file) – Text file containing high-pass filter basis.

class niworkflows.interfaces.reportlets.masks.BETRPT(generate_report=False, **kwargs)[source]#

Bases: SegmentationRC, BET

Wrapped executable: bet.

Mandatory Inputs:

in_file (a pathlike object or string representing an existing file) – Input file to skull strip. Maps to a command-line argument: %s (position: 0).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • center (a list of at most 3 items which are an integer) – Center of gravity in voxels. Maps to a command-line argument: -c %s.

  • compress_report (‘auto’ or True or False) – Compress the reportlet using SVGO orWEBP. ‘auto’ - compress if relevant software is installed, True = force,False - don’t attempt to compress. (Nipype default value: auto)

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • frac (a float) – Fractional intensity threshold. Maps to a command-line argument: -f %.2f.

  • functional (a boolean) – Apply to 4D fMRI data. Maps to a command-line argument: -F. Mutually exclusive with inputs: functional, reduce_bias, robust, padding, remove_eyes, surfaces, t2_guided.

  • mask (a boolean) – Create binary mask image. Maps to a command-line argument: -m.

  • mesh (a boolean) – Generate a vtk mesh brain surface. Maps to a command-line argument: -e.

  • no_output (a boolean) – Don’t generate segmented output. Maps to a command-line argument: -n.

  • out_file (a pathlike object or string representing a file) – Name of output skull stripped image. Maps to a command-line argument: %s (position: 1).

  • out_report (a pathlike object or string representing a file) – Filename for the visual report. (Nipype default value: report.svg)

  • outline (a boolean) – Create surface outline image. Maps to a command-line argument: -o.

  • output_type (‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’) – FSL output type.

  • padding (a boolean) – Improve BET if FOV is very small in Z (by temporarily padding end slices). Maps to a command-line argument: -Z. Mutually exclusive with inputs: functional, reduce_bias, robust, padding, remove_eyes, surfaces, t2_guided.

  • radius (an integer) – Head radius. Maps to a command-line argument: -r %d.

  • reduce_bias (a boolean) – Bias field and neck cleanup. Maps to a command-line argument: -B. Mutually exclusive with inputs: functional, reduce_bias, robust, padding, remove_eyes, surfaces, t2_guided.

  • remove_eyes (a boolean) – Eye & optic nerve cleanup (can be useful in SIENA). Maps to a command-line argument: -S. Mutually exclusive with inputs: functional, reduce_bias, robust, padding, remove_eyes, surfaces, t2_guided.

  • robust (a boolean) – Robust brain centre estimation (iterates BET several times). Maps to a command-line argument: -R. Mutually exclusive with inputs: functional, reduce_bias, robust, padding, remove_eyes, surfaces, t2_guided.

  • skull (a boolean) – Create skull image. Maps to a command-line argument: -s.

  • surfaces (a boolean) – Run bet2 and then betsurf to get additional skull and scalp surfaces (includes registrations). Maps to a command-line argument: -A. Mutually exclusive with inputs: functional, reduce_bias, robust, padding, remove_eyes, surfaces, t2_guided.

  • t2_guided (a pathlike object or string representing a file) – As with creating surfaces, when also feeding in non-brain-extracted T2 (includes registrations). Maps to a command-line argument: -A2 %s. Mutually exclusive with inputs: functional, reduce_bias, robust, padding, remove_eyes, surfaces, t2_guided.

  • threshold (a boolean) – Apply thresholding to segmented brain image and mask. Maps to a command-line argument: -t.

  • vertical_gradient (a float) – Vertical gradient in fractional intensity threshold (-1, 1). Maps to a command-line argument: -g %.2f.

Outputs:
  • inskull_mask_file (a pathlike object or string representing a file) – Path/name of inskull mask (if generated).

  • inskull_mesh_file (a pathlike object or string representing a file) – Path/name of inskull mesh outline (if generated).

  • mask_file (a pathlike object or string representing a file) – Path/name of binary brain mask (if generated).

  • meshfile (a pathlike object or string representing a file) – Path/name of vtk mesh file (if generated).

  • out_file (a pathlike object or string representing a file) – Path/name of skullstripped file (if generated).

  • out_report (a pathlike object or string representing a file) – Filename for the visual report.

  • outline_file (a pathlike object or string representing a file) – Path/name of outline file (if generated).

  • outskin_mask_file (a pathlike object or string representing a file) – Path/name of outskin mask (if generated).

  • outskin_mesh_file (a pathlike object or string representing a file) – Path/name of outskin mesh outline (if generated).

  • outskull_mask_file (a pathlike object or string representing a file) – Path/name of outskull mask (if generated).

  • outskull_mesh_file (a pathlike object or string representing a file) – Path/name of outskull mesh outline (if generated).

  • skull_file (a pathlike object or string representing a file) – Path/name of skull file (if generated).

  • skull_mask_file (a pathlike object or string representing a file) – Path/name of skull mask (if generated).

class niworkflows.interfaces.reportlets.masks.BrainExtractionRPT(generate_report=False, **kwargs)[source]#

Bases: SegmentationRC, BrainExtraction

Wrapped executable: antsBrainExtraction.sh.

Mandatory Inputs:
  • anatomical_image (a pathlike object or string representing an existing file) – Structural image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. Maps to a command-line argument: -a %s.

  • brain_probability_mask (a pathlike object or string representing an existing file) – Brain probability mask created using e.g. LPBA40 data set which have brain masks defined, and warped to anatomical template and averaged resulting in a probability image. Maps to a command-line argument: -m %s.

  • brain_template (a pathlike object or string representing an existing file) – Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. Maps to a command-line argument: -e %s.

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • compress_report (‘auto’ or True or False) – Compress the reportlet using SVGO orWEBP. ‘auto’ - compress if relevant software is installed, True = force,False - don’t attempt to compress. (Nipype default value: auto)

  • debug (a boolean) – If > 0, runs a faster version of the script. Only for testing. Implies -u 0. Requires single thread computation for complete reproducibility. Maps to a command-line argument: -z 1.

  • dimension (3 or 2) – Image dimension (2 or 3). Maps to a command-line argument: -d %d. (Nipype default value: 3)

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • extraction_registration_mask (a pathlike object or string representing an existing file) – Mask (defined in the template space) used during registration for brain extraction. To limit the metric computation to a specific region. Maps to a command-line argument: -f %s.

  • image_suffix (a string) – Any of standard ITK formats, nii.gz is default. Maps to a command-line argument: -s %s. (Nipype default value: nii.gz)

  • keep_temporary_files (an integer) – Keep brain extraction/segmentation warps, etc (default = 0). Maps to a command-line argument: -k %d.

  • num_threads (an integer) – Number of ITK threads to use. (Nipype default value: 1)

  • out_prefix (a string) – Prefix that is prepended to all output files. Maps to a command-line argument: -o %s. (Nipype default value: highres001_)

  • out_report (a pathlike object or string representing a file) – Filename for the visual report. (Nipype default value: report.svg)

  • use_floatingpoint_precision (0 or 1) – Use floating point precision in registrations (default = 0). Maps to a command-line argument: -q %d.

  • use_random_seeding (0 or 1) – Use random number generated from system clock in Atropos (default = 1). Maps to a command-line argument: -u %d.

Outputs:
  • BrainExtractionBrain (a pathlike object or string representing an existing file) – Brain extraction image.

  • BrainExtractionCSF (a pathlike object or string representing an existing file) – Segmentation mask with only CSF.

  • BrainExtractionGM (a pathlike object or string representing an existing file) – Segmentation mask with only grey matter.

  • BrainExtractionInitialAffine (a pathlike object or string representing an existing file)

  • BrainExtractionInitialAffineFixed (a pathlike object or string representing an existing file)

  • BrainExtractionInitialAffineMoving (a pathlike object or string representing an existing file)

  • BrainExtractionLaplacian (a pathlike object or string representing an existing file)

  • BrainExtractionMask (a pathlike object or string representing an existing file) – Brain extraction mask.

  • BrainExtractionPrior0GenericAffine (a pathlike object or string representing an existing file)

  • BrainExtractionPrior1InverseWarp (a pathlike object or string representing an existing file)

  • BrainExtractionPrior1Warp (a pathlike object or string representing an existing file)

  • BrainExtractionPriorWarped (a pathlike object or string representing an existing file)

  • BrainExtractionSegmentation (a pathlike object or string representing an existing file) – Segmentation mask with CSF, GM, and WM.

  • BrainExtractionTemplateLaplacian (a pathlike object or string representing an existing file)

  • BrainExtractionTmp (a pathlike object or string representing an existing file)

  • BrainExtractionWM (a pathlike object or string representing an existing file) – Segmenration mask with only white matter.

  • N4Corrected0 (a pathlike object or string representing an existing file) – N4 bias field corrected image.

  • N4Truncated0 (a pathlike object or string representing an existing file)

  • out_report (a pathlike object or string representing a file) – Filename for the visual report.

class niworkflows.interfaces.reportlets.masks.ROIsPlot(generate_report=True, **kwargs)[source]#

Bases: ReportingInterface

Mandatory Inputs:
  • in_file (a pathlike object or string representing an existing file) – The volume where ROIs are defined.

  • in_rois (a list of items which are a pathlike object or string representing an existing file) – A list of regions to be plotted.

Optional Inputs:
  • colors (a list of items which are a string or None) – Use specific colors for contours. (Nipype default value: None)

  • compress_report (‘auto’ or True or False) – Compress the reportlet using SVGO orWEBP. ‘auto’ - compress if relevant software is installed, True = force,False - don’t attempt to compress. (Nipype default value: auto)

  • in_mask (a pathlike object or string representing an existing file) – A special region, eg. the brain mask.

  • levels (a list of items which are a float or None) – Pass levels to nilearn.plotting. (Nipype default value: None)

  • mask_color (a string) – Color for mask. (Nipype default value: r)

  • masked (a boolean) – Mask in_file prior plotting. (Nipype default value: False)

  • out_report (a pathlike object or string representing a file) – Filename for the visual report. (Nipype default value: report.svg)

Outputs:

out_report (a pathlike object or string representing a file) – Filename for the visual report.

class niworkflows.interfaces.reportlets.masks.SimpleShowMaskRPT(generate_report=True, **kwargs)[source]#

Bases: SegmentationRC, ReportingInterface

Mandatory Inputs:
  • background_file (a pathlike object or string representing an existing file) – File before.

  • mask_file (a pathlike object or string representing an existing file) – File before.

Optional Inputs:
  • compress_report (‘auto’ or True or False) – Compress the reportlet using SVGO orWEBP. ‘auto’ - compress if relevant software is installed, True = force,False - don’t attempt to compress. (Nipype default value: auto)

  • out_report (a pathlike object or string representing a file) – Filename for the visual report. (Nipype default value: report.svg)

Outputs:

out_report (a pathlike object or string representing a file) – Filename for the visual report.

class niworkflows.interfaces.reportlets.masks.TCompCorRPT(generate_report=False, **kwargs)[source]#

Bases: SegmentationRC, TCompCor

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)

  • compress_report (‘auto’ or True or False) – Compress the reportlet using SVGO orWEBP. ‘auto’ - compress if relevant software is installed, True = force,False - don’t attempt to compress. (Nipype default value: auto)

  • 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 or merge_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 is all, then all components will be retained. Mutually exclusive with inputs: variance_threshold.

  • out_report (a pathlike object or string representing a file) – Filename for the visual report. (Nipype default value: report.svg)

  • 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.

  • out_report (a pathlike object or string representing a file) – Filename for the visual report.

  • pre_filter_file (a pathlike object or string representing a file) – Text file containing high-pass filter basis.