Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Community » Message Board

History of AFNI updates   Suggested reading for beginners   Add yourself to the AFNI map!

Re: Creating functional ROI based on voxel size

|
August 09, 2012 11:52AM
Sort of. It's basically the same idea as before - using the range selector. We also have to change the clustering to sort based on cluster intensity. In the script below, I chose the output to be based on cluster mean, but you may want the cluster maximum instead, or to account for negative activations too. See if this short script is what you want.

#!/bin/tcsh
# clust_mean_max.csh
#
# extract only the cluster with the largest mean for a min vol and rmm
# usage:
# clust_mean_max.csh dset+tlrc thresholdmin
#
#
set dset = "$1"
set thresh = $2
set rmm = 1
set vmul = 20
set bname = `@GetAfniPrefix "$dset"`
set bview = `@GetAfniView "$dset"`

# remove any previous output if any
rm ${bname}_clmean${bview}.*
rm ${bname}_clmaxmean${bview}.*

# put mean value of cluster in each voxel of cluster output
# ...may want 1clust_max or 1clust_amax instead
3dmerge -dxyz=1 -1clust_mean $rmm $vmul -1thresh $thresh \
-prefix ${bname}_clmean "$dset"

# find maximum (most positive) value of cluster means
set maxmean = `3dBrickStat -max -slow ${bname}_clmean${bview}`

# extract just that value from dataset with small range for roundoff
set mm_min = `ccalc "${maxmean}-0.001"`
set mm_max = `ccalc "${maxmean}+0.001"`

3dcalc -a ${bname}_clmean${bview}"<${mm_min}..${mm_max}>" -expr a \
-prefix ${bname}_clmaxmean${bview}
Subject Author Posted

Creating functional ROI based on voxel size

Oliver August 08, 2012 01:34PM

Re: Creating functional ROI based on voxel size

Daniel Glen August 08, 2012 01:51PM

Re: Creating functional ROI based on voxel size

O August 08, 2012 11:51PM

Re: Creating functional ROI based on voxel size

Daniel Glen August 09, 2012 11:52AM



Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
CAPTCHA
Message:

Powered by Plone

phorum.org

This site conforms to the following standards: