Hi AFNI Experts,
I’ve encountered an issue during my analysis pipeline where I expected to see mm
and mm_delt
files generated for all runs of my data, but they are only present for one run. Here’s a summary of my setup and the problem:
Pipeline Details
- I’m using
afni_proc.py
for preprocessing with the following blocks:tcat
,align
,tlrc
,volreg
,blur
,scale
,regress
. - The
volreg
block includes the-volreg_opts_vr -twopass -twodup -maxdisp1D mm
option to compute motion metrics. - I have 3 runs in the experiment, I am concatenating all of them into one as a part of preprocesisng.
Problem
- After running the pipeline, I find that the
mm
(max displacement) andmm_delt
(delta motion metrics) files are generated, but only for one run instead of all runs. - I expected separate
mm
andmm_delt
files for each run in the results directory (or maybe one file with all runs concatenated, similar to how other motion parameters (e.g.,motion_demean.1D
andmotion_deriv.1D
) are provided).
Questions
- Is this the intended behavior of AFNI, or should
mm
andmm_delt
files be generated for all runs? - If this is not expected, could it be related to the way I’ve structured my input files or pipeline options?
- Are there specific flags or settings in
afni_proc.py
that I need to adjust to ensuremm
andmm_delt
files are created for all runs?
Additional Details
-
AFNI version: Precompiled binary linux_ubuntu_16_64: Feb 6 2023 (Version AFNI_23.0.03 ‘Commodus’)
-
OS: Linux 5.4.0-113-generic #127-Ubuntu SMP Wed May 18 14:30:56 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
-
The command used:
#!/bin/bash
...
afni_proc.py \
-subj_id "$subject_id" \
-script "$script_path" \
-out_dir "$results_path" \
-dsets "$data_folder"/"$subject_id"/*movt*_"$run1".nii \
"$data_folder"/"$subject_id"/*movt*_"$run2".nii \
"$data_folder"/"$subject_id"/*movt*_"$run3".nii \
-blip_reverse_dset "$data_folder"/"$subject_id"/*PErev*_"$phasereverse".nii \
-blocks tcat align tlrc volreg blur scale regress \
-radial_correlate_blocks volreg regress \
-tlrc_base MNI152_2009_template.nii.gz \
-tcat_remove_first_trs "$n_trs_remove" \
-copy_anat "$data_folder"/"$subject_id"/*MPRAGE*_"$mprage".nii \
-volreg_align_to first \
-volreg_opts_vr -twopass -twodup -maxdisp1D mm \
-volreg_compute_tsnr yes \
-remove_preproc_files \
-html_review_style pythonic
(
tcsh -xef "$script_path" 2>&1 | tee "$output_path"
) & # Run in the background
...
I look into my proc. script and it seems like the file is overwritten in each iteration. Correct me if I am wrong:
# ================================= volreg =================================
# align each dset to base volume, blip warp
# (final warp input is same as blip input)
foreach run ( $runs )
# register each volume to the base image
3dvolreg -verbose -zpad 1 -base vr_base+orig
-1Dfile dfile.r$run.1D -prefix rm.epi.volreg.r$run
-cubic
-twopass -twodup -maxdisp1D mm
-1Dmatrix_save mat.r$run.vr.aff12.1D
pb01.$subj.r$run.blip+orig
...
end
If anyone has encountered a similar issue or knows how to ensure mm
and mm_delt
files are generated for all runs, I’d greatly appreciate your insights.
Thank you in advance for your help!
Best regards,
Egor Levchenko