History of AFNI updates  

|
September 12, 2022 06:39AM
Hey ptaylor,
I have tried to use your script stated above to do a Z-standardization of ALFF-values in AFNI. I don't quite get if you use all images or just one here... I have adapted the script in the following way:

#!/bin/bash
PREPROC_DATA=/mypath/to/preprocessed/data
PROGS_DIR=/mypath/to/scripts

# generate a txt file with all datapaths of ALFF BRIK files calculated using 3dRSFC
for sub in ${PREPROC_DATA}/*/01-session/rs-fMRI/SLOMOCO5/ALFF_fns_0.01_0.08_striatum/RSFC_fns_ALFF+tlrc.BRIK; do 
echo $sub > ${PROGS_DIR}/ALFF_analysis/alff_fns_for_z.txt; 
done


# user input sets
cd ${PROGS_DIR}/ALFF_analysis
my_dset=`cat alff_fns_for_z.txt`
my_mask=${MASK_DIR}/striatum-structural-2mm-bin.nii
echo $my_mask


# calculate summary stats within brain mask
dset_mean=`3dBrickStat -mean -mask $my_mask $my_dset`

dset_stdev=`3dBrickStat -stdev -mask $my_mask $my_dset`

echo "\n\n"
echo "The mean of values within the mask is:   $dset_mean"
echo "The stdev of values within the mask is:  $dset_stdev"
echo "\n"

# get new dset of values
3dcalc \
    -echo_edu \
    -a $my_dset \
    -b $my_mask \
    -expr "step(b)*(a - $dset_mean) / ($dset_stdev)" \
    -prefix NEW_DSET_Z


The summary stats (mean, std) should of course be calculated on the basis of the whole dataset. But when I apply 3dcalc, the output NEW_DSET_Z is a 3D file (although I would assume it to be 4D as every subject's ALFF image should be zstandardized, right?). How could I adapt the script so that every subject's ALFF image is z-standardized based on the cohort's mean and std?
Best, Melissa
Subject Author Posted

3dRSFC

sondosayyash April 27, 2017 09:54AM

Re: 3dRSFC

ptaylor April 27, 2017 10:58AM

Re: 3dRSFC

sondosayyash May 04, 2017 11:36AM

Re: 3dRSFC

ptaylor May 04, 2017 11:40AM

Re: 3dRSFC

sondosayyash May 07, 2017 01:50AM

Re: 3dRSFC

ptaylor May 08, 2017 11:56AM

Re: 3dRSFC

melissaneuro September 12, 2022 06:39AM

Re: 3dRSFC

ptaylor September 12, 2022 08:01PM