afni_proc.py error: FileNotFoundError: [Errno 2] No such file or directory: 'QC_OBJ/media/qc_10_regr_corr_errts.pbar.json'

AFNI version info (afni -ver):
Precompiled binary linux_ubuntu_16_64: Apr 10 2026 (Version AFNI_26.1.00 'Balbinus')

Hello, I used the proc.xxx generated by afni_proc.py for preprocessing, but encountered some errors. Does anyone know why?

Command in afni_proc.py:

afni_proc.py -subj_id OBJ \
-dsets raw/briks/OBJ/epiobj01+orig. raw/briks/OBJ/epiobj02+orig. raw/briks/OBJ/epiobj03+orig. raw/briks/OBJ/epiobj04+orig. \
-tcat_remove_first_trs 5                           \
-volreg_align_to last \
-volreg_align_e2a \
-align_opts_aea -ginormous_move \
-copy_anat raw/briks/OBJ/anat+orig. 	\
-regress_censor_motion 0.5 	\
-regress_censor_outliers 0.1 	\
-regress_opts_3dD -jobs 24 	\
-blocks align volreg regress

Error message:

apqc_make_tcsh.py -review_style pythonic -subj_dir . -uvar_json out.ss_review_uvars.json
+* Found no corr_brain+*.HEAD dset, but continuing
++ APQC create: blurred errts for IC & corr_brain
      errts.OBJ.tproject_blur_for_qc.nii.gz
      corr_brain_blur_for_qc.nii.gz
++ Done making (executable) IC errts script: 
      run_instacorr_errts.tcsh
++ Done making (executable) GV errts script: 
      run_graphview_errts.tcsh
++ Done making (executable) IC pbrun script: 
      run_instacorr_pbrun.tcsh
++ Done making (executable) GV pbrun script: 
      run_graphview_pbrun.tcsh
++ APQC create: qc_00_vorig_EPI
++ APQC create: qc_01_vorig_EPI_variance
++ APQC create: qc_02_vorig_anat
++ APQC create: qc_03_vorig_olap
++ APQC create: qc_04_ve2a_epi2anat
++ APQC create: calc some seed locations
++ APQC create: qc_05_vstat_seed_lh-seed
++ APQC create: qc_06_vstat_seed_rh-seed
++ APQC create: qc_07_mot_enormoutlr
++ APQC create: qc_08_mot_VR6
++ APQC create: qc_09_regr_df
++ APQC create: qc_10_regr_corr_errts
Traceback (most recent call last):
  File "/home/supermicro/abin/apqc_make_tcsh.py", line 912, in <module>
    cmd      = lat.apqc_regr_corr_errts( ap_ssdict, obase, "regr", 
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/supermicro/abin/afnipy/lib_apqc_tcsh.py", line 3392, in apqc_regr_corr_errts
    with open(pbar_json, 'r') as fff:
         ^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'QC_OBJ/media/qc_10_regr_corr_errts.pbar.json'

System check output:

-------------------------------- general ---------------------------------
architecture:         64bit ELF
cpu type:             x86_64
system:               Linux
release:              6.8.0-87-generic
version:              #88~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Oct 14 14:03:14 UTC 2
distribution:         ubuntu 22.04 Jammy Jellyfish
number of CPUs:       96
user:                 supermicro
apparent login shell: bash
shell RC file:        .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /home/supermicro/abin/afni
afni version         : Precompiled binary linux_ubuntu_16_64: Apr 10 2026 
                     : AFNI_26.1.00 'Balbinus'
AFNI_version.txt     : AFNI_26.1.00, linux_ubuntu_16_64, Apr 10 2026, official
afnipy version       : AFNI_26.1.00
which python         : /home/supermicro/anaconda3/bin/python
python version       : 3.12.7
which R              : /usr/bin/R
R version            : R version 4.5.3 (x86_64-pc-linux-gnu)

instances of various programs found in PATH:
    afni    : 1   (/home/supermicro/abin/afni)
    R       : 1   (/usr/bin/R)
    python  : 2 
      /home/supermicro/anaconda3/bin/python3.12
      /usr/bin/python3.10
    python2 : 0 
    python3 : 2 
      /home/supermicro/anaconda3/bin/python3.12
      /usr/bin/python3.10

testing ability to start various programs...
    afni                 : success
    suma                 : success
    3dSkullStrip         : success
    3dAllineate          : success
    3dRSFC               : success
    SurfMesh             : success
    3dClustSim           : success
    build_afni.py        : success
    uber_subject.py      : success
    3dMVM                : success
    rPkgsInstall         : success

------------------------ dependent program tests -------------------------
checking for dependent programs...

which tcsh           : /usr/bin/tcsh
tcsh version         : 6.21.00
which Xvfb           : /usr/bin/Xvfb

checking for R packages...
    rPkgsInstall -pkgs ALL -check : success

R RHOME : /usr/lib/R

------------------------------ python libs -------------------------------

++ module loaded: matplotlib.pyplot
   module file : /home/supermicro/anaconda3/lib/python3.12/site-packages/matplotlib/pyplot.py
   matplotlib version : 3.9.2

++ module loaded: flask
   module file : /home/supermicro/anaconda3/lib/python3.12/site-packages/flask/__init__.py
   flask version : 3.1.3

++ module loaded: flask_cors
   module file : /home/supermicro/anaconda3/lib/python3.12/site-packages/flask_cors/__init__.py
   flask_cors version : 6.0.2

-------------------------------- env vars --------------------------------
PATH                       = /home/supermicro/anaconda3/bin:/home/supermicro/anaconda3/condabin:/usr/local/freesurfer/7.3.2/bin:/usr/local/freesurfer/7.3.2/fsfast/bin:/usr/local/freesurfer/7.3.2/tktools:/usr/local/freesurfer/7.3.2/mni/bin:/home/supermicro/MATLAB_2024/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/supermicro/abin

PYTHONPATH                 = 
R_LIBS                     = /home/supermicro/R
LD_LIBRARY_PATH            = 
DYLD_LIBRARY_PATH          = 
DYLD_FALLBACK_LIBRARY_PATH = 
CONDA_SHLVL                = 1
CONDA_DEFAULT_ENV          = base
CC                         = 
HOMEBREW_PREFIX            = 

----------------------------- eval dot files -----------------------------

----------- AFNI $HOME files -----------

    .afnirc                   : found
    .sumarc                   : found
    .afni/help/all_progs.COMP : found

--------- shell startup files ----------

   -- considered operations: path, apsearch
   
   -- note: followers should not need edits, so edit flags should be 0
      (have 0 follower(s), which can be ignored)
   
   no modifications needed across 1 dot files
   
------------------------------ data checks -------------------------------
data dir : found AFNI_data6   under $HOME (936G Avail)
           top history: ...026 [rickr]: rename GroupAna_cases results to save.*
data dir : found AFNI_data7   under $HOME
           top history: ...025 [PT/RCR]: init with do_ scripts and sub-000 data
data dir : found AFNI_demos   under $HOME
           top history: 22 May 2025 [taylorp]: update subject QC directories
data dir : found suma_demo    under $HOME
           top history: ...s_New/data/Build_tmp on Mon Mar  4 11:56:45 EST 2013
data dir : found afni_handouts under $HOME
atlas    : found TT_N27+tlrc  under /home/supermicro/abin

------------------------------ OS specific -------------------------------
which apt-get        : /usr/bin/apt-get
apt-get version      : apt 2.4.14 (amd64)

which git            : /usr/bin/git
git version          : git version 2.34.1
which gcc            : /usr/bin/gcc
gcc version          : gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

have Ubuntu system: ubuntu 22.04 Jammy Jellyfish
have Ubuntu afni  : Precompiled binary linux_ubuntu_16_64: Apr 10 2026 

=========================  nothing to fix, yay!  =========================

I would greatly appreciate it if there is any reply!

Thanks,
Donna

Hi, Donna-

Hmm, could you please re-run the APQC HTML generation, adding an option to log all run outputs into text file, by running this in your AP results directory:

apqc_make_tcsh.py -run -do_log

... and then email me the log file that should be created, called log_apqc_tcsh.txt?

thanks,
pt

Hi again-

Separately, for your AP command:

afni_proc.py                                                                 \
    -subj_id                  OBJ                                            \
    -dsets                    raw/briks/OBJ/epiobj01+orig.                   \
                              raw/briks/OBJ/epiobj02+orig.                   \
                              raw/briks/OBJ/epiobj03+orig.                   \
                              raw/briks/OBJ/epiobj04+orig.                   \
    -copy_anat                raw/briks/OBJ/anat+orig.                       \
    -blocks                   align volreg regress                           \
    -tcat_remove_first_trs    5                                              \
    -volreg_align_to          last                                           \
    -volreg_align_e2a                                                        \
    -align_opts_aea           -ginormous_move                                \
    -regress_censor_motion    0.5                                            \
    -regress_censor_outliers  0.1                                            \
    -regress_opts_3dD         -jobs 24

... there are probably a few suggestions I would make for different options for processing the data. I'm not sure if you would like advice on that or not. This would like include adding a couple other blocks, changing the EPI-anatomical alignment cost function, adding in some more QC, and editing the regress block options.

One place you could start would be with the "simple" AP processing wrapper, where you just need to provide your data, basically, and have it processed like rest, which you are doing anyways. This would be the command, for your datasets specifically:

      ap_run_simple_rest.tcsh \
          -epi       raw/briks/OBJ/epiobj01+orig.                  \
                     raw/briks/OBJ/epiobj02+orig.           \
                     raw/briks/OBJ/epiobj03+orig.             \
                     raw/briks/OBJ/epiobj04+orig.    \
          -anat      raw/briks/OBJ/anat+orig.    \
          -subjid    OBJ                               \
          -nt_rm     5                                     \
          -run_proc

--pt

... and to the original issue, @rickr has provided a critical insight (as usual).

Currently, the generation of the corr_brain dset assumes a mask is available. In your AP command, there is no mask block, and the current APQC HTML builder doesn't checked to see whether one is available is not---it was just assumed to be there. I can/will likely adjust that in the code. But in the meantime, you can avoid this by editing your current command to include a mask block between the "volreg" and "regress" blocks:

afni_proc.py                                                                 \
    -subj_id                  OBJ                                            \
    -dsets                    raw/briks/OBJ/epiobj01+orig.                   \
                              raw/briks/OBJ/epiobj02+orig.                   \
                              raw/briks/OBJ/epiobj03+orig.                   \
                              raw/briks/OBJ/epiobj04+orig.                   \
    -copy_anat                raw/briks/OBJ/anat+orig.                       \
    -blocks                   align volreg mask regress                           \
    -tcat_remove_first_trs    5                                              \
    -volreg_align_to          last                                           \
    -volreg_align_e2a                                                        \
    -align_opts_aea           -ginormous_move                                \
    -regress_censor_motion    0.5                                            \
    -regress_censor_outliers  0.1                                            \
    -regress_opts_3dD         -jobs 24

Note that, as described here, this mask is not applied to your data (so, it isn't multiplied times your EPI data, hiding data/voxels outside the brain); instead, it exists for useful calculations from time to time (e.g., whole brain averages, stats estimates, etc.).

Please let us know how that goes, and if you would like other suggestions for updating the AP command.

--pt

Hello, thank you for your reply!

I ran the command apqc_make_tcsh.py -run -do_log , but the same error occurred again:

(base) supermicro@mz73:/data/fmri/locobjv2/results/Copy_of_019/OBJ.results$ apqc_make_tcsh.py -run -do_log
+* Found no corr_brain+*.HEAD dset, but continuing
++ APQC create: blurred errts for IC & corr_brain
   -> blurred errts already exists
      corr_brain_blur_for_qc.nii.gz
++ Done making (executable) IC errts script: 
      run_instacorr_errts.tcsh
++ Done making (executable) GV errts script: 
      run_graphview_errts.tcsh
++ Done making (executable) IC pbrun script: 
      run_instacorr_pbrun.tcsh
++ Done making (executable) GV pbrun script: 
      run_graphview_pbrun.tcsh
+* WARN: output QC dir exists already: QC_OBJ
   -> backing it up to: QC_OBJ_2026-04-15-09-17-20
++ APQC create: qc_00_vorig_EPI
++ APQC create: qc_01_vorig_EPI_variance
++ APQC create: qc_02_vorig_anat
++ APQC create: qc_03_vorig_olap
++ APQC create: qc_04_ve2a_epi2anat
++ APQC create: calc some seed locations
+* Removing and remaking vstat-QC dir: vstat_seedcorr
++ APQC create: qc_05_vstat_seed_lh-seed
++ APQC create: qc_06_vstat_seed_rh-seed
++ APQC create: qc_07_mot_enormoutlr
++ APQC create: qc_08_mot_VR6
++ APQC create: qc_09_regr_df
++ APQC create: qc_10_regr_corr_errts
Traceback (most recent call last):
  File "/usr/local/abin/apqc_make_tcsh.py", line 912, in <module>
    cmd      = lat.apqc_regr_corr_errts( ap_ssdict, obase, "regr", 
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/abin/afnipy/lib_apqc_tcsh.py", line 3392, in apqc_regr_corr_errts
    with open(pbar_json, 'r') as fff:
         ^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'QC_OBJ/media/qc_10_regr_corr_errts.pbar.json'

Also, in the results folder, I could not find the log_apqc_tcsh.txt file. Below are all the files in the folder:

(base) supermicro@mz73:/data/fmri/locobjv2/results/Copy_of_019/OBJ.results$ ls
all_runs.OBJ+orig.BRIK.gz              mask_epi_extents+orig.HEAD  out.df_info.txt                   run_graphview_pbrun.tcsh
all_runs.OBJ+orig.HEAD                 mat.basewarp.aff12.1D       out.gtkyd.outliers.txt            run_instacorr_errts.tcsh
anat_al_junk_e2a_only_mat.aff12.1D     mat.r01.vr.aff12.1D         out.keep_trs_rall.txt             run_instacorr_pbrun.tcsh
anat_al_junk_mat.aff12.1D              mat.r01.warp.aff12.1D       out.pre_ss_warn.txt               run_qc_00_vorig_EPI.tcsh
anat_al_junk+orig.BRIK.gz              mat.r02.vr.aff12.1D         out.ss_review.OBJ.txt             run_qc_01_vorig_EPI_variance.tcsh
anat_al_junk+orig.HEAD                 mat.r02.warp.aff12.1D       out.ss_review_uvars.json          run_qc_02_vorig_anat.tcsh
anat_final.OBJ+orig.BRIK.gz            mat.r03.vr.aff12.1D         out.vlines.pb00.tcat.txt          run_qc_04_ve2a_epi2anat.tcsh
anat_final.OBJ+orig.HEAD               mat.r03.warp.aff12.1D       out.xmat_warn.txt                 run_qc_05_vstat_seed_lh-seed.tcsh
anat_ns+orig.BRIK.gz                   mat.r04.vr.aff12.1D         pb00.OBJ.r01.tcat+orig.BRIK.gz    run_qc_06_vstat_seed_rh-seed.tcsh
anat_ns+orig.HEAD                      mat.r04.warp.aff12.1D       pb00.OBJ.r01.tcat+orig.HEAD       @ss_review_basic
anat+orig.BRIK                         motion_demean.1D            pb00.OBJ.r02.tcat+orig.BRIK.gz    @ss_review_driver
anat+orig.HEAD                         motion_deriv.1D             pb00.OBJ.r02.tcat+orig.HEAD       @ss_review_driver_commands
censor_OBJ_combined_2.1D               motion_OBJ_censor.1D        pb00.OBJ.r03.tcat+orig.BRIK.gz    stats.REML_cmd
dfile.r01.1D                           motion_OBJ_CENSORTR.txt     pb00.OBJ.r03.tcat+orig.HEAD       stimuli
dfile.r02.1D                           motion_OBJ_enorm.1D         pb00.OBJ.r04.tcat+orig.BRIK.gz    sum_baseline.1D
dfile.r03.1D                           out.4095_all.txt            pb00.OBJ.r04.tcat+orig.HEAD       TSNR.OBJ+orig.BRIK.gz
dfile.r04.1D                           out.4095_warn.txt           pb01.OBJ.r01.volreg+orig.BRIK.gz  TSNR.OBJ+orig.HEAD
dfile_rall.1D                          out.allcostX.txt            pb01.OBJ.r01.volreg+orig.HEAD     vlines.pb00.tcat
@epi_review.OBJ                        out.ap_uvars.json           pb01.OBJ.r02.volreg+orig.BRIK.gz  volumized+orig.BRIK.gz
errts.OBJ.tproject_blur_for_qc.nii.gz  out.ap_uvars.txt            pb01.OBJ.r02.volreg+orig.HEAD     volumized+orig.HEAD
errts.OBJ.tproject+orig.BRIK.gz        out.cormat_warn.txt         pb01.OBJ.r03.volreg+orig.BRIK.gz  vr_base+orig.BRIK.gz
errts.OBJ.tproject+orig.HEAD           outcount_OBJ_censor.1D      pb01.OBJ.r03.volreg+orig.HEAD     vr_base+orig.HEAD
final_epi_vr_base+orig.BRIK.gz         outcount.r01.1D             pb01.OBJ.r04.volreg+orig.BRIK.gz  vstat_seedcorr
final_epi_vr_base+orig.HEAD            outcount.r02.1D             pb01.OBJ.r04.volreg+orig.HEAD     X.jpg
gtkyd                                  outcount.r03.1D             QC_OBJ                            X.nocensor.xmat.1D
gtkyd.xls                              outcount.r04.1D             radcor.pb02.regress               X.stim.xmat.1D
mask_epi_extents+orig.BRIK.gz          outcount_rall.1D            run_graphview_errts.tcsh          X.xmat.1D

Thank you again for your help!
Donna

Thank you again for your reply. I followed your suggestion to include a mask block between the "volreg" and "regress" blocks and re-ran the analysis. I found that the previous error I encountered disappeared. Below is the output:

apqc_make_tcsh.py -review_style pythonic -subj_dir . -uvar_json out.ss_review_uvars.json
++ APQC create: blurred errts for IC & corr_brain
      errts.OBJ_2.tproject_blur_for_qc.nii.gz
      corr_brain_blur_for_qc.nii.gz
++ Done making (executable) IC errts script: 
      run_instacorr_errts.tcsh
++ Done making (executable) GV errts script: 
      run_graphview_errts.tcsh
++ Done making (executable) IC pbrun script: 
      run_instacorr_pbrun.tcsh
++ Done making (executable) GV pbrun script: 
      run_graphview_pbrun.tcsh
++ APQC create: qc_00_vorig_EPI
++ APQC create: qc_01_vorig_EPI_variance
++ APQC create: qc_02_vorig_anat
++ APQC create: qc_03_vorig_olap
++ APQC create: qc_04_ve2a_epi2anat
++ APQC create: qc_05_ve2a_mask2final
++ APQC create: calc some seed locations
++ APQC create: qc_06_vstat_seed_lh-seed
++ APQC create: qc_07_vstat_seed_rh-seed
++ APQC create: qc_08_mot_enormoutlr
++ APQC create: qc_09_mot_VR6
++ APQC create: qc_10_mot_grayplot
++ APQC create: qc_11_regr_df
++ APQC create: qc_12_regr_corr_errts
++ APQC create: qc_13_regr_tsnr_fin
++ APQC create: qc_14_radcor_rc_regress
                run: d02/1
++ APQC create: qc_15_warns_xmat
++ APQC create: qc_16_warns_cen_total
++ APQC create: qc_17_warns_press
++ APQC create: qc_18_warns_sat_4095
++ APQC create: qc_19_warns_vlines
++ APQC create: qc_20_qsumm_ssrev
++ APQC create: copy jsons to info dir
++ APQC create: copy ss_review_basic file
++ APQC create: display ss_review_basic info

# ++++++++++++++ Check output of @ss_review_basic ++++++++++++++ #
------------------------------------------------------------------

It seems that this has solved my problem. However, I would like to know why the absence of the mask block caused the error. Is it simply because my code is too old and needs to be updated?

Thank you very much for your help!

Donna

Hi, Donna-

I'm glad adding the mask block sorted out that issue.

I'll start by taking a step back to explain the APQC HTML creation process: When afni_proc.py (AP) processes your data, it builds up a dictionary of useful inputs, intermediate data and values (like how many time points were censored from motion, what the name of the motion-reference volume is, etc.), and final datasets (stats volume, TSNR volume, etc.). It then goes through a pre-specified list of possible QC items to generate, based on what data is actually present. So, final statistical maps for QC would be different depending on whether you did resting state or task-based FMRI processing, for example.

In the present case, the APQC HTML generating logic for resting state assumed that a corr_brain dataset would be present, but it actually wasn't because no mask was estimated. So, then in that part that crashed, it was looking for a file that didn't exist, which was a fault with the logic when I had written it. So, the current problem was not a deep one, just a mistake on my part with the coding logic, and something I will fix for future code versions. That being so, I still think it is really useful to have a mask dset in existence (and the corr_brain dataset that will also be estimated) in general for resting state (or really for all FMRI) processing. Therefore, I think adding the mask block both solves the current issue (even though it was my fault with the programming) and it leads to a better processing path. Hence, that would just make sense to do, in my view.

(And on a side note, in this case because the code crashed, there indeed was no log_apqc_tcsh.txt file created. Something else I will try to change in the logic, to at least have that output.)

--pt

Hi pt,

Thank you so much for your detailed explanation. I really appreciate your help and for clarifying the issue.

Best regards,
Donna

Hi again, Donna-

In terms of an adapted processing command, I might suggest starting with this one, below. It follows from considerations we have described here as well as various processing considerations discussed in the AFNI Academy videos. Further adjustments could certainly be made. At present, it keeps with choices that appeared in your original command:

  • no blurring is done (which might be most appropriate to prepare for an ROI-based analysis)
  • no standard space alignment/template is included (final space is subject anatomical)
  • no task stimuli are included (data is processed like resting state or naturalistic FMRI)
  • the anatomical is assumed to still have its skull on, so skullstripping will happen as part of AP processing (just explicitly noting that now)

It adds a few things, too:

  • the radial_correlate_blocks adds a couple useful QC output images, as does the volreg_compute_tsnr
  • the volreg_align_to volume is now MIN_OUTLIER, which is the setting for the safest reference volume to choose (fewest outliers, least likelihood of motion during that time point)
  • the EPI-anatomical alignment cost function is lpc+ZZ, which is a bit slower but tends to give most robust alignment between the two datasets that have opposite contrast; adding the -align_unifize_epi local is also something that we have found to generally stabilize/improve the alignment, esp. when EPI volumes can have strong brightness inhomogeneity
  • the mask_epi_anat opt makes the estimated whole brain mask the intersection of the EPI and anatomical volumes, which is often most convenient
  • -regress_motion_per_run should be used when multiple EPI dsets are input, as here, for per-run regressors (avoiding features of "jumps" between run baseline values)
  • we usually regress both the (demeaned) motion estimates as regressors, as well as their derivatives to capture even some extra features
  • despiking is included in the beginning (despike block), because motion spikes can get smeared out during processing
  • the tshift block means that time shifting of time series would be performed, if they files have slice timing included in them, which AFNI datasets can have included directly in the header.

If you want to add alignment to some standard space (esp. nonlinear alignment), we can do that by adding the tlrc block. For nonlinear alignment, we would often run sswarper2 beforehand, and hand the results to afni_proc.py. That is what most of our publication examples do.

If you want to add blurring, then we would add a blur block and specify the size of the blurring to use. For single-echo FMRI data, we would often use 1.5-2 times the minimum voxel dimension.

afni_proc.py                                                                 \
    -subj_id                  OBJ_new                                        \
    -dsets                    raw/briks/OBJ/epiobj01+orig.                   \
                              raw/briks/OBJ/epiobj02+orig.                   \
                              raw/briks/OBJ/epiobj03+orig.                   \
                              raw/briks/OBJ/epiobj04+orig.                   \
    -copy_anat                raw/briks/OBJ/anat+orig.                       \
    -anat_has_skull           no                                             \
    -blocks                   despike tshift align volreg mask scale regress \
    -radial_correlate_blocks  tcat volreg regress                            \
    -tcat_remove_first_trs    5                                              \
    -align_unifize_epi        local                                          \
    -align_opts_aea           -large_move                                    \
                              -cost lpc+ZZ                                   \
                              -check_flip                                    \
    -volreg_align_to          MIN_OUTLIER                                    \
    -volreg_align_e2a                                                        \
    -volreg_compute_tsnr      yes                                            \
    -mask_epi_anat            yes                                            \
    -regress_motion_per_run                                                  \
    -regress_censor_motion    0.5                                            \
    -regress_censor_outliers  0.1                                            \
    -regress_apply_mot_types  demean deriv                                   \
    -regress_est_blur_errts                                                  \
    -regress_run_clustsim     no

Please let us know how that sounds, if it is useful at all.

--pt

Hi pt,

Thank you so very much for your detailed suggestions. I ran the analysis using the parameters you recommended, and the results look quite good. Also, no errors appeared at all.

I really appreciate all your help!

Best regards,
Donna

Hi, Donna-

Glad to hear that was useful and that it ran through fine.

Processing has lots of choices, many of which are made based on the goal for your study. For example, do you want to blur the data or not could depend on whether you want to do a voxelwise or ROI-based analysis, respectively. I tried to point out some of the reasoning for given processing choices above, and I hope those were consistent with you downstream analysis goals.

Often we think of processing as starting from some common, "vanilla mode" options, which can be added (or subtracted) based on a researcher's specific goals. So, if you would like to change processing features/options/arguments to match your study design or the kind of data you have, that is fine. We're happy to discuss how to match those choices with specific processing options.

--pt

Hi pt,

Thank you for your reminder. My analysis is ROI-based. I will combine your suggestions with the tutorial to select the parameters that best suit my needs. Thank you very much for your help!

Best regards,
Donna

Hi, Donna-

Sounds good. And indeed, when processing in preparation for ROI-based analysis, one does not want to blur the data. Averaging of time series/data will be done within each ROI, and one doesn't want push data across boundaries inappropriately.

Note that if you ROIs are defined in the subject anatomical space (like FreeSurfer parcellations), then you can provide one or more of those wtih this option, and the results will be mapped along (correctly mapped as integer values with NN="nearest neighbor" interpolation, and passing along any ROI labels in the header) automatically to your final EPI grid or anatomical grid:

    -anat_follower_ROI LABEL GRID DSET : specify anat follower ROI dataset

        e.g. -anat_follower_ROI aaseg anat aparc.a2009s+aseg_REN_all.nii.gz
        e.g. -anat_follower_ROI FSvent epi fs_ap_latvent.nii.gz

        Use this option to pass any anatomical follower dataset.  Such a
        dataset is warped by any transformations that take the original
        anat to anat_final.

        Similar to -anat_follower, except that these anatomical follower
        datasets are resampled using nearest neighbor (NN) interpolation,
        to preserve data values (as opposed to -anat_follower, which uses
        wsinc5).  That is the only difference between these options.

           LABEL    : to name and refer to this dataset
           GRID     : which grid should this be sampled on, anat or epi?
           DSET     : name of input dataset, changed to copy_af_LABEL

        Labels defined via this option may be used in -regress_ROI or _PC.

So, for example, adding the following would take your FreeSurfer+@SUMA_Make_Spec_FS results and put the full "2000" atlas parcellation on the final anatomical dset grid, and the ROI-like GM "2009" atlas on the final EPI grid:

-anat_follower_ROI           aagm00 anat aparc+aseg_REN_all.nii.gz
-anat_follower_ROI           aegm09 epi  aparc.a2009s+aseg_REN_gmrois.nii.gz 

You could also then choose to make an automatic table in the APQC HTML report about the shape, size and TSNR values from your EPI data for any set/subset of ROIs from any of these imported/regridded atlases. To do that, you would use the defined LABEL of a given atlas and the provide a list of ROI numbers, like:

-regress_compute_tsnr_stats  aegm09 10 11 12 49 50 51 11101 12101

And, even though this doesn't apply in your current processing, just to note if you had ROIs defined in a standard space you were using for your final processing (like if the tlrc block were being used) you could similarly load in those ROIs to end up on your final grid automatically with this option:

    -ROI_import LABEL RSET       : import a final grid ROI with the given label

            e.g. -ROI_import Glasser MNI_Glasser_HCP_v1.0.nii.gz
            e.g. -ROI_import Benny my_habenula_rois.nii.gz
            e.g. -ROI_import Benny path/to/ROIs/my_habenula_rois.nii.gz

        Use this option to import an ROI dataset that is in the final space of
        the EPI data.  It will merely be resampled onto the final EPI grid
        (not transformed).

            o  this might be based on the group template
            o  no warping will be done to this dataset
            o  this dataset WILL be resampled to match the final EPI

        This option was added to be applied with -regress_compute_tsnr_stats,
        for example:

            -ROI_import Glasser MNI_Glasser_HCP_v1.0.nii.gz  \
            -regress_compute_tsnr_stats Glasser 4 41 99 999  \

--pt

A post was split to a new topic: afni_proc.py error: FileNotFoundError: [Errno 2] No such file or directory

Hi pt,

Thank you so much for your great help. I really appreciate it.

Best,
Donna

1 Like