Apologies for talking to myself so much, but I think I almost got there
set nvi = `3dinfo -nvi ${IntBrainUARM}`
foreach atlas_level ( `seq 0 1 ${nvi}` )
3dROIstats -mask "${IntBrainUARM}+tlrc[${atlas_level}]" \
-nomeanout -key \
"${IntBrainUARM}+tlrc[${atlas_level}]" \
> ${IntBrainUARM}_${atlas_level}_ROIs.txt
end
The format of the resulting files is still wrong for my purpose (rows instead of columns, some unnecessary info, each level preceded with Key_), but that's a matter of reformatting, doable. Probably even in tcsh.
Edited 1 time(s). Last edit at 10/28/2021 04:15PM by Pawel.