AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
October 27, 2022 04:03PM
How about the following? It uses integer division, so you have to decide how you want to round things.

#!/bin/tcsh

set dset_roi = THE_DATASET_NAME

# get the 6 extents in terms of IJK slice indices
set extent = `3dAutobox -extent_ijk "${dset_roi}"`

# select out the min/max along the AP axis
set apmin = ${extent[3]}
set apmax = ${extent[4]}

set div1 = `echo "scale=0; ${apmin} + (${apmax} - ${apmin}) / 3" | bc`
set div2 = `echo "scale=0; ${apmin} + 2*(${apmax} - ${apmin}) / 3" | bc`

# report results in terminal
cat << EOF
Slice values are:
${apmin}
${div1}
${div2}
${apmax}
EOF

# apply results
3dcalc                                  \
    -overwrite                          \
    -a "${dset_roi}"                    \
    -expr "step(a)*(1+ispositive(j-${div1})+ispositive(j-${div2}))" \
    -prefix TRIPLE_ROI.nii.gz

Subject Author Posted

Splitting ROI into thirds along anterior posterior axis

naailk90 October 27, 2022 02:39PM

Re: Splitting ROI into thirds along anterior posterior axis

ptaylor October 27, 2022 04:03PM

Re: Splitting ROI into thirds along anterior posterior axis

naailk90 November 07, 2022 12:07PM

Re: Splitting ROI into thirds along anterior posterior axis

Daniel Glen October 27, 2022 06:44PM