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  

|
Daniel Glen
November 10, 2009 01:55PM
#!/bin/tcsh
Here is a short script to compute the MAD given a dataset and a mask.

# MAD.csh
# usage;
# MAD.csh dset+orig mask+orig
# compute MAD = Median absolute deviation over a mask at each time point
# MAD = median(abs(a-median))
set dset = $1
set mask = $2
set nv = `3dnvals $dset`
@ nv --
rm -f MAD_???+orig.*
foreach sb (`count -digits 3 0 $nv`)
set median = `3dBrickStat -median -mask $mask $dset"[${sb}]" \
| awk '{print $2}' `
3dcalc -a ${dset}."[${sb}]" -b $mask -expr "step(b) * abs(a - $median)" -prefix MAD_$sb \
>& /dev/null
set MAD = `3dBrickStat -median -mask $mask MAD_${sb}+orig | awk '{print $2}'`
echo "MAD for sub-brick $sb = $MAD"
end
Subject Author Posted

Computing ROI Stats

Andrew Jahn November 10, 2009 01:02PM

Re: Computing ROI Stats

Daniel Glen November 10, 2009 01:55PM