History of AFNI updates  

|
Daniel Glen
September 10, 2007 11:01AM
A similar question was recently asked via e-mail. Assuming you have the conjunction ROI defined or for any ROI including atlas-based masks (as in the e-mail question), there are a lot of ways to accomplish computing the maximum and minimum within a specific region for a single sub-brick of a dataset - 3dROIstats, 3dExtrema, 3dmaxima, 3dclust and 3dBrickStat with 3dmaskdump.


The specific instructions for finding both maxima and minima follow. Each method has it's own idiosyncrasies - no mask option, no positive non-zero minimum, short integer format, odd default options, inappropriate sorting for this purpose and perhaps more information than you care to know. There is also a Maxima plug-in that is similar to the 3dmaxima command.

__________________________________
% 3dROIstats -nzminmax -mask 'TT_Daemon::amygdala' func_slim+tlrc.'[0]'
File Sub-brick Mean_71 NZMin_71 NZMax_71
func_slim+tlrc.[0] 0 4.193859 0.856051 11.929490
__________________________________

% 3dExtrema -maxima -volume -mask_file 'TT_Daemon::amygdala' -closure func_slim+tlrc.'[0]' | head -50
++ 3dExtrema: AFNI version=AFNI_2007_05_29_1644 (Jul 17 2007) [32-bit]
++ Authored by: B. Douglas Ward
Reading mask dataset: TT_Daemon::amygdala
Number of voxels above mask threshold = 2296
Reading input dataset: func_slim+tlrc.[0]
Reading input dataset: func_slim+tlrc.[0]
Reading volume #0
Number of volumes = 1

Maxima for Volume #0 (Coordinates Order = RAI):
Index Intensity RL[mm] AP[mm] IS[mm] Count Dist[mm]
----- --------- ------ ------ ------ ----- --------
1 11.929 -28.00 7.00 -17.00 1 5.196
2 11.087 23.00 7.00 -17.00 1 6.083
3 10.273 18.00 4.00 -13.00 1 4.690
4 10.162 -18.00 3.00 -14.00 1 9.849
...
% 3dExtrema -minima -volume -mask_file 'TT_Daemon::amygdala' -closure func_slim+tlrc.'[0]' | head -50

++ 3dExtrema: AFNI version=AFNI_2007_05_29_1644 (Jul 17 2007) [32-bit]
++ Authored by: B. Douglas Ward
Reading mask dataset: TT_Daemon::amygdala
Number of voxels above mask threshold = 2296
Reading input dataset: func_slim+tlrc.[0]
Reading input dataset: func_slim+tlrc.[0]
Reading volume #0
Number of volumes = 1

Minima for Volume #0 (Coordinates Order = RAI):
Index Intensity RL[mm] AP[mm] IS[mm] Count Dist[mm]
----- --------- ------ ------ ------ ----- --------
1 0.856 -24.00 10.00 -8.00 1 5.099
2 0.953 -23.00 7.00 -12.00 1 5.099
3 1.118 22.00 10.00 -8.00 1 5.477
4 1.215 -24.00 2.00 -10.00 1 5.000
5 1.270 27.00 7.00 -12.00 1 4.472
...
_________________________________________


% 3dcalc -a func_float+tlrc. -b 'TT_Daemon::amygdala' -expr 'a * step(b)' -prefix 'func_mask_amyg' -datum short
% 3dmaxima -min_dist 512 -input func_mask_amyg+tlrc
---------------------------------------------
RAI mm coordinates:

( -28.00 7.00 -17.00) : val = 11.929488

number of extrema = 1
---------------------------------------------

__________________________________


% 3dclust -dxyz=1 1 1 func_mask_amyg+tlrc. | head -20
++ 3dclust: AFNI version=AFNI_2007_05_29_1644 (Jul 17 2007) [32-bit]
++ Authored by: RW Cox et al
#
#Cluster report for file func_mask_amyg+tlrc.
#[Connectivity radius = 1.00 mm Volume threshold = 1.00 ]
#[Single voxel volume = 1.0 (microliters) ]
#[Voxel datum type = short ]
#[Voxel dimensions = 1.000 mm X 1.000 mm X 1.000 mm ]
#[Coordinates Order = RAI ]
#[Fake voxel dimen = 1.000 mm X 1.000 mm X 1.000 mm ]
#Mean and SEM based on Absolute Value of voxel intensities:
#
#Volume CM RL CM AP CM IS minRL maxRL minAP maxAP minIS maxIS Mean SEM Max Int MI RL MI AP MI IS
#------ ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ------- ------- ----- ----- -----
1149 22.7 4.8 -14.9 16.0 30.0 -1.0 11.0 -22.0 -7.0 4.2531 0.0465 11.087 23.0 7.0 -17.0
1147 -24.2 4.8 -15.0 -30.0 -17.0 -1.0 11.0 -22.0 -7.0 4.1345 0.0635 11.929 -28.0 7.0 -17.0
#------ ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ------- ------- ----- ----- -----
# 2296 -0.4 4.8 -14.9 4.1939 0.0393

_______________________________

This short script will also probably do what you want.

#/bin/tcsh
# find maximum within atlas mask on a dataset and show position

set dset = func_float+tlrc'[0]'
set tal_region = 'TT_Daemon::amygdala'

set maskmax = `3dBrickStat -mask ${tal_region} -min -max -non-zero -slow "${dset}"`
echo dataset "${dset}", region, ${tal_region}, min, $maskmax[1], max $maskmax[2]
# print coordinates and value for maximum in region
3dmaskdump -mask $tal_region -cmask "-a $dset -expr step(a+0.001-${maskmax[2]})" \
-xyz -noijk "$dset"
# print coordinates and value for minimum in region
3dmaskdump -mask $tal_region -cmask "-a $dset -expr step(${maskmax[1]}+0.001-a)" \
-xyz -noijk "$dset"
Subject Author Posted

conjunction analysis

qinpm September 09, 2007 11:47PM

Re: conjunction analysis

Daniel Glen September 10, 2007 11:01AM