nireports.reportlets.xca module

Plotting results of component decompositions (xCA – P/I-CA).

nireports.reportlets.xca.compcor_variance_plot(metadata_files, metadata_sources=None, output_file=None, varexp_thresh=(0.5, 0.7, 0.9), fig=None)[source]
Parameters
  • metadata_files (list) – List of paths to files containing component metadata. If more than one decomposition has been performed (e.g., anatomical and temporal CompCor decompositions), then all metadata files can be provided in the list. However, each metadata file should have a corresponding entry in metadata_sources.

  • metadata_sources (list or None) – List of source names (e.g., [‘aCompCor’]) for decompositions. This list should be of the same length as metadata_files.

  • output_file (str or None) – Path where the output figure should be saved. If this is not defined, then the plotting axes will be returned instead of the saved figure path.

  • varexp_thresh (tuple) – Set of variance thresholds to include in the plot (default 0.5, 0.7, 0.9).

  • fig (figure or None) – Existing figure on which to plot.

Returns

  • ax (axes) – Plotting axes. Returned only if the output_file parameter is None.

  • output_file (str) – The file where the figure is saved.

nireports.reportlets.xca.plot_melodic_components(melodic_dir, in_file, tr=None, out_file='melodic_reportlet.svg', compress='auto', report_mask=None, noise_components_file=None)[source]

Plots the spatiotemporal components extracted by FSL MELODIC from functional MRI data.

Parameters
  • melodic_dir (str) – Path pointing to the outputs of MELODIC

  • in_file (str) – Path pointing to the reference fMRI dataset. This file will be used to extract the TR value, if the tr argument is not set. This file will be used to calculate a mask if report_mask is not provided.

  • tr (float) – Repetition time in seconds

  • out_file (str) – Path where the resulting SVG file will be stored

  • compress ('auto' or bool) – Whether SVG should be compressed. If 'auto', compression will be executed if dependencies are installed (SVGO)

  • report_mask (str) – Path to a brain mask corresponding to in_file

  • noise_components_file (str) – A CSV file listing the indexes of components classified as noise by some manual or automated (e.g. ICA-AROMA) procedure. If a noise_components_file is provided, then components will be plotted with red/green colors (correspondingly to whether they are in the file -noise components, red-, or not -signal, green-). When all or none of the components are in the file, a warning is printed at the top.