TimeseriesExtractor.report_qc#

TimeseriesExtractor.report_qc(output_dir=None, filename=None, return_df=True)[source]#

Report Quality Control Information.

Converts per-subject, per-run quality control metrics (frame scrubbing and interpolation) stored in self.qc dictionary to a pandas DataFrame for analysis and reporting.

Parameters:
  • output_dir (str, default=None) – Directory to save a pickle file to. The directory will be created if it does not exist. The file will not be saved if an output directory is not provided.

  • filename (str or None, default=None) – Name of the file with or without the “csv” extension.

  • return_df (bool, default=True) – If True, returns the dataframe.

Returns:

pandas.Dataframe – Pandas dataframe containing the colums: “Subject_ID”, “Run”, “Frames_Scrubbed”, “Frames_Interpolated”, “Mean_High_Motion_Length”, “Std_High_Motion_Length”, “Mean_FD”, “Std_FD”,

Important

Reporting: Statistics for each subject’s run are only reported when fd_threshold is specified, a valid confound tsv file containing the “framewise_displacement” column is found, and the run is not skipped. Additionally, all reported statistics exclude any dummy volumes, as they are calculated after dummy volumes are removed from the analysis.

Note that if a condition was specified in self.get_bold(), all the reported statistics are specific to the frames assigned to the condition (as determined by the equation in “Extraction of Task Conditions” in the documentation of self.get_bold()), which are treated as one continuous event window for computational simplicity.

Mean & Standard Deviation of Framewise Displacement: “Mean_FD” and “Std_FD” represent the statistics prior to scrubbing or interpolating.

Censored & Interpolated Frames: The metrics for scrubbed frames and interpolated frames are independent. For instance, 2 scrubbed frames and 3 interpolated frames means that 3 frames were interpolated while 2 were scrubbed due to excessive motion.

Note that only censored frames with bounded by non-censored frames on both sides are interpolated, while censored frames at the edge of the timeseries (including frames that border censored edges) are always scrubbed and counted in “Frames_Scrubbed”. For instance, if the full sample mask is computed as [0, 0, 1, 0, 0, 1, 0] where “0” are censored and “1” is not censored, then when no interpolation is requested, then “Frames_Scrubbed” will be 5 and “Frames_Interpolated” will be 0. If interpolation is requested, then “Frames_Scrubbed” would be 3 and “Frames_Interpolated” would be 2 (indexes 3 and 4).

High Motion Length Computation: “Mean_High_Motion_Length” and “Std_High_Motion_Length” represent the average length and population standard deviation of contiguous segments of frames flagged for high-motion frames, respectively.