Preparing the table¶
fmriqc prep collects the ratings and the quantitative metrics of all participants into one table, df_final.csv, which the dashboard reads. It keeps every numeric metric it finds, so you can add any of them to the dashboard later without running fmriqc prep again.
AFNI¶
fmriqc prep afni \
--input-dir /PATH/AFNI_derivatives \
--task kidvid \
--prefix sub- \
--output-dir /PATH/QC
--input-dirThe folder that holds all participants’ AFNI output.
--taskA part of the path between
--input-dirand each participant’s QC folder, usually the task name. To keep one session only, add it, such asses-01/rest.--prefixWhat comes before the ID in the folder names, usually
sub-. It is removed from the IDs in the table.--output-dirThe folder for
df_final.csv. It is created if needed.
The command reads QC_<ID>/extra_info/out.ss_review.<ID>.json of every participant. A participant with several sessions gets one row per session; the session comes from a ses-<label> folder in the path or from a subject ID that ends in _ses-<label>. This file holds the quantitative summary of afni_proc.py (the qsumm block of the APQC report) and the APQC ratings. In df_final.csv:
Every numeric field becomes a column. A field with several values, such as one per run or one per stimulus class, becomes one column per value, numbered
_1,_2and so on, also for participants with a single value.Text fields, such as the AFNI version or the names of the output datasets, are left out.
Field names have spaces replaced by
_and brackets removed, and the main metrics get short names:
Column |
Field in the review file |
|---|---|
|
num runs found |
|
TRs total (uncensored) |
|
TRs removed (per run) |
|
average censored motion |
|
max censored displacement |
|
final DF fraction |
|
TSNR average |
|
censor fraction |
|
global correlation (GCOR) |
|
fraction TRs censored, per stimulus class |
|
flip guess: 0 for NO_FLIP, 1 otherwise |
The ratings are the columns ending in
_rating(vorig_rating,ve2a_rating, …,FINAL_rating), one per APQC block.
fMRIPrep¶
fmriqc prep fmriprep \
--bold-file /PATH/mriqc/group_bold.tsv \
--rating-dir /PATH/ratings \
--task rest \
--output-dir /PATH/QC \
--t1w-file /PATH/mriqc/group_T1w.tsv
--bold-fileMRIQC’s group table of functional metrics,
group_bold.tsv.--rating-dirOptional. The folder that
fmriqc rating fmriprepsaved the ratings to (its--output-dir). Without it, the table has the MRIQC metrics only.--taskThe task to keep, as it appears in the file names (
task-restgivesrest).--output-dirThe folder for
df_final.csv. It is created if needed.--t1w-fileOptional. MRIQC’s group table of anatomical metrics,
group_T1w.tsv. Its metrics are added to each run of the same participant and session, named with at1w_prefix (t1w_cjv,t1w_snr_total, …). A T1w image without a session counts for all of the participant’s sessions. If a session has several T1w images, itst1w_columns are left empty.
The command takes the rows of group_bold.tsv for --task, reads the participant, session and run from each row’s bids_name (session 1 or run 1 when the name has none), and keeps every numeric metric that MRIQC computed; MRIQC’s documentation describes them in Image quality metrics. It then reads the rating files sub-<ID>_ses-<session>_<task>.csv in --rating-dir and matches them to the metrics by participant, session and run.
Runs that have metrics but no ratings, or ratings but no metrics, are kept, with the missing part left empty. The terminal says how many runs matched; if none did, it warns and shows the labels on each side, which usually means the session or run labels differ between the ratings and MRIQC.
The rating columns are T1mask, Norm, SurfRecon, SDC, Align, CompCor, Variance, BOLD, Corr and Final (see What you rate).
The table, df_final.csv¶
df_final.csv has one row per participant and session (AFNI) or per run (fMRIPrep):
ID,session(for AFNI only when there are sessions), and for fMRIPreprunandtask, which identify the row;the numeric metrics, at full precision;
the ratings, each
good,badorother, or empty when not rated.
The dashboard shows a chosen set of these columns (see Settings tab); downloads from the dashboard keep all of them.
For ratings or metrics from other software, see Your own tables.