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 (related to framewise displacement and dummy volumes) stored in
self.qcdictionary to a pandas DataFrame for analysis and reporting.Note
In versions >= 0.27.0, “NaN” is used to denote a value is not applicable.
- 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 (
strorNone, 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”, and “N_Dummy_Scans”.
Important
Reporting: Statistics for each subject’s run are specific to the specified
fd_thresholdanddummy_scans. Additionally, all reported statistics for framewise displacement are specific to steady-state volumes (ifdummy_scansis not None), as they are only computed after accounting for dummy volumes.Note: If
conditionwas specified inself.get_bold(), all the reported statistics related to framewise displacement are specific to the frames assigned to the condition (as determined by the equation in “Extraction of Task Conditions” in the documentation ofself.get_bold()), which are treated as one continuous event window for computational simplicity. The number of reported dummy volumes is not adjusted for the condition.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: 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 consecutive frames flagged for high-motion frames, respectively.