Hello! I'm trying to make a separate file for each ROI in the Destrieux atlas. I began by using the following script for the first ROI, typing it directly into my Terminal:
3dcalc -a aparc.a2009s_aseg_REN_all.nii.gz'<1>' -expr 'step(a)' -prefix Destrieux_ROI1_test.nii.gz
This worked, and the Terminal output was:
++ 3dcalc: AFNI version=AFNI_24.2.07 (Sep 18 2024) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ./Destrieux_ROI1_test.nii.gz
I then wrote a script to loop through all the ROIs (in this case starting with 2 as a trial):
!/bin/bash
for i in $(seq 1 2)
do
3dcalc -a "aparc.a2009s_aseg_REN_all.nii.gz'<$i>'" -expr 'step(a)' -prefix "Destrieux_ROI_"$i".nii.gz"
done
This failed with the following output:
++ 3dcalc: AFNI version=AFNI_24.2.07 (Sep 18 2024) [64-bit]
++ Authored by: A cast of thousands
** FATAL ERROR: can't open dataset aparc.a2009s_aseg_REN_all.nii.gz'<1>'
** Program compile date = Sep 18 2024
++ 3dcalc: AFNI version=AFNI_24.2.07 (Sep 18 2024) [64-bit]
++ Authored by: A cast of thousands
** FATAL ERROR: can't open dataset aparc.a2009s_aseg_REN_all.nii.gz'<2>'
** Program compile date = Sep 18 2024
I'm wondering why it says it can't open dataset aparc.a2009s_aseg_REN_all.nii.gz'<1>' when that is what was typed directly into the Terminal (same directory) in the single test that worked?