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  

|
April 27, 2022 05:55PM
Hi, Rookie-

Ah, I see what you mean: you want the Thr value (of a statistic, say) at the peak Olay value (of an effect estimate, say) within each cluster, and the peak effect estimate is not guaranteed to have the peak stat value. Fair enough. Indeed, I do think the "whereami" approach is generally more useful than condensing things down to a single value---I'm not sure that the peak statistic is even very meaningful after thresholding? (e.g., Clustering is a hypothesis-testing-like procedure, and so once things pass threshold, the exact statistical value shouldn't really matter much anymore?)

Addendum to my previous comment: another way to get the column 13 (in onebase) values would be to use AFNI subbrick selectors, as follows to get the same column in a 1D file:
1dcat o.cluster_report.txt'[12]'
Note that AFNI uses zero-based counting (e.g., as in C and Python), hence the number in square brackets.

So, if you did want the above, though, I think the way I would do it would be:
+ set Olay = effect estimate volume
+ set Thr = stat volume
+ Clusterize, get data table
+ From the data table, get the *locations of each Olay peak within the cluster, which would be columns 14, 15 and 16 (in one-based counting, which awk uses):
     MI RL        : Coordinate of the Maximum Intensity value in the
                    Right-Left direction of the volume cluster
 
     MI AP        : Coordinate of the Maximum Intensity value in the
                    Anterior-Posterior direction of the volume cluster
 
     MI IS        : Coordinate of the Maximum Intensity value in the
                    Inferior-Superior direction of the volume cluster
... and you could extract those coordinates from the table with 1dcat, too, note the column numbers:
1dcat o.cluster_report.txt'[13..15]' > o.peak_coords.txt

Then, you could loop over those coordinates and extract the value from the desired dataset at that location.

For example, you extract the value for the first/zeroth coord as follows:
# get 3 coords (likely in RAI notation), and pass those into 3dUndump to make a temporary mask of hopefully 1 voxel
1dcat o.peak_coords.txt'{0}' | 3dUndump -master DSET_FOR_GRID -xyz -overwrite -prefix tmp_mask -
# use that temp mask to extract a value from a dset of interest, such as a stat volume
3dmaskave -quiet -mask tmp_mask+tlrc. DSET_OF_INTEREST

I think those papers would be useful to look at. The danger is that condensing a whole cluster down to one voxel value, esp. a stat, can lose a lot of valuable information.

--pt
Subject Author Posted

How to automate getting Peak t Cluster Values Attachments

Rookie April 27, 2022 01:52PM

Re: How to automate getting Peak t Cluster Values

ptaylor April 27, 2022 03:26PM

Re: How to automate getting Peak t Cluster Values Attachments

Rookie April 27, 2022 04:02PM

Re: How to automate getting Peak t Cluster Values

ptaylor April 27, 2022 05:55PM

Re: How to automate getting Peak t Cluster Values Attachments

Rookie April 28, 2022 04:24PM

Re: How to automate getting Peak t Cluster Values

Rookie April 30, 2022 12:55PM

Re: How to automate getting Peak t Cluster Values

ptaylor April 30, 2022 07:48PM