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  

|
August 24, 2018 01:03PM
Hi, Emily-

I will assume that each "mask" file actually still has the probability value in it-- that isn't just a binary map.

First, you can provide the set of files to 3dTcat to make a single, 4D data set. Then, use 3dTstat to make a mask where there are nonzero voxels at any point across time; finally, provide the concatenated dataset and mask to 3dTstat, and have it make a new dataset whose values tell you which brick contains the maximum value across "time" at each voxel (**Note that I have now edited my answer to correct it, as per my next message in this thread; apologies for confusion. --pt**):
# concatenate data sets of interest
3dTcat -prefix ALLCAT.nii.gz  DSET1 DSET2 DSET3 ...
# make a mask of anywhere that is nonzero across the original data sets
3dTstat -nzcount -prefix MMM.nii.gz ALLCAT.nii.gz
# find the volume index+1 of the subbrick with the maximum value, per voxel
3dTstat -argmax1 -mask MMM.nii.gz -prefix MAP  ALLCAT.nii.gz
*Note* tthe use of argmax1: This is because AFNI starts counting from zero (as all great programs do!), and if the [0]th volume contains the maximum, then it would put a zero at that voxel, which would be indistinguishable from the hoi polloi of the great empty voxels. So, wherever there is a "1" in the final MAP dset, that is where the [0]th volume in the list had greatest value; wherever there is a "2", the [1]st volume had the max value, etc.

--pt



Edited 1 time(s). Last edit at 08/27/2018 04:10PM by ptaylor.
Subject Author Posted

Masks

Emily August 24, 2018 11:34AM

Re: Masks

ptaylor August 24, 2018 01:03PM

Re: Masks

ptaylor August 27, 2018 04:09PM

Re: Masks

Daniel Glen August 27, 2018 02:10PM