KeyError traced to lib_apqc_tcsh.py

AFNI version info (afni -ver): AFNI_24.0.17 'Caracalla'

I was at the recent bootcamp at the NIH and want to first say thank you for hosting such a helpful workshop - I really enjoyed it and learned a lot!

I am attempting to run the final pre-processing steps and first level analysis on subjects from a data set on Open Neuro (link if it is useful). We did the initial round of pre-processing through fMRIprep. I think I got all of my timing files and confound files converted correctly (thanks to y'alls help in person yesterday!)

This is the script I ran:

#!/usr/bin/env tcsh
# set subject and group identifiers
set subj = 006
set ses = T1
set task = Num

# set data directory
set top_dir = /Volumes/ITALY/derivatives/sub-${subj}

# run afni_proc.py to create a single subject processing script
afni_proc.py -subj_id $subj \
        -blocks tcat blur mask scale regress \
        -copy_anat $top_dir/anat/sub-${subj}_space-MNI152NLin2009cAsym_res-2_desc-preproc_T1w.nii.gz \
        -dsets \
                $top_dir/ses-${ses}/func/sub-${subj}_ses-${ses}_task-${task}_run-01_space-MNI152NLin2009cAsym_res-2_desc-preproc_TR1570_bold.nii \
                $top_dir/ses-${ses}/func/sub-${subj}_ses-${ses}_task-${task}_run-02_space-MNI152NLin2009cAsym_res-2_desc-preproc_TR1570_bold.nii \
        -tcat_remove_first_trs 0 \
        -regress_motion_per_run \
        -regress_motion_file \
               $top_dir/ses-${ses}/func/sub-${subj}_ses-${ses}_task-${task}_mvt-confounds.txt  \
        -regress_censor_motion 0.5 \
        -regress_censor_outliers 0.05 \
        -regress_censor_prev yes \
        -regress_extra_ortvec \
                $top_dir/ses-${ses}/func/sub-${subj}_ses-${ses}_task-${task}_aCompCor-confounds.txt \
        -regress_extra_ortvec_labels  5aCompCor \
        -regress_reml_exec \
        -regress_stim_times \
                $top_dir/ses-${ses}/func/num_hard_ses-T1.1D \
                $top_dir/ses-${ses}/func/num_medium_ses-T1.1D \
                $top_dir/ses-${ses}/func/num_easy_ses-T1.1D \
                $top_dir/ses-${ses}/func/num_control_ses-T1.1D \
              -regress_stim_times_offset -0.785 \
              -regress_stim_labels \
                NumHard NumMedium NumEasy NumControl \
              -regress_basis 'BLOCK(2,1)' \
              -regress_opts_3dD \
            -bout \
            -gltsym 'SYM: NumHard -NumControl' -glt_label 1 NumH-C \
            -gltsym 'SYM: NumMedium -NumControl' -glt_label 2 NumM-C \
            -gltsym 'SYM: NumEasy -NumControl' -glt_label 3 NumE-C \
            -gltsym 'SYM: NumHard NumMedium NumEasy -3*NumControl' -glt_label 4 NumHME-C \
            -regress_est_blur_epits \
            -regress_est_blur_errts \
            -write_3dD_prefix NumFirstLevel \
            -html_review_style pythonic \
            -execute

It seemed like my script ran almost all the way through until it got this error at the very end:

++ Done making (executable) GV pbrun script: 
      run_graphview_pbrun.tcsh
++ APQC create: qc_00_vorig_anat
++ APQC create: qc_01_mot_enormoutlr
++ APQC create: qc_02_mot_VR6
++ APQC create: qc_03_mot_grayplot
++ APQC create: qc_04_regr_ideal
++ APQC create: qc_05_regr_stims
++ APQC create: qc_06_regr_df
++ APQC create: qc_07_radcor_rc_regress
Traceback (most recent call last):
  File "/Users/fmriprep/abin/apqc_make_tcsh.py", line 957, in <module>
    rcname, rcdir, ith_run=ii )
  File "/Users/fmriprep/abin/afnipy/lib_apqc_tcsh.py", line 5712, in apqc_radcor_rcvol
    all_ulay = [ap_ssdict['main_dset']]     # bc errts makes a poor ulay
KeyError: 'main_dset'

I opened up the scripts that are referenced in the error, but I am not a proficient enough coder to understand exactly what is going wrong so hopefully someone here can help!

Hi-

The reason is described here.

This is something that can hopefully be ameliorated over time, but one difficulty is that it looks like there could be multiple options of "final space" from fmriprep output. That will make it difficult for the QC. Maybe we woudl just pick the chosen standard space to be the final space for QC.

--pt