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 05, 2003 12:55AM
Krista:

There is an easier way to do what you want. You need to multiply the mask dataset bob suggested ROI_STAT by a clust_order mask dataset from 3dmerge.

If 34_mask+tlrc is your file with 34 ROIs, then type:

3dmerge -1clust_order rmm vol -prefix 34_mask_clustorder 34_mask+tlrc

input whatever clustering options you want, but since you already have your ROIs you may want to be lenient here just to make sure you dont eliminate any small ROIs.

The -1clust_order option labels each 'cluster' in your mask file with a unique number based on the ROI volume size. Largest ROI = 1, smallest = 34.

Next, multiply this dataset by ROI_STAT+tlrc

3dcalc -expr 'a*b' -a ROI_STAT+tlrc -b 34_mask_clustorder+tlrc -prefix 34_mask_clustorder_threshold

The output file now contains threhsolded data for each ROI, with different numbers assigned to each ROI. For example, all 1's are the voxels in your largest cluster that passed threshold, all 2's are the voxels in your second largest cluster that passed threshold, etc.

Use the 3dmaskavg option -mrange to select only the ROI you want to output.

-mrange .9 1.9 will grab all 1's in your mask. I guess you will have to create 34 command lines, stepping up the mrange as you go to just grab 1's, then 2's, then 3's etc.

Alternativley, if you are just after the average timecourse for all thresholded values for each ROI in your ROI mask, the program 3dROIstats may be an easier route. It automatically detects how many uniquely numbered ROIs there are in your mask and averages each of them separately. You can even tell it not to average in any zeros, if some subjects dont have coverage over an entire ROI. Also, this program can handle input files with multiple subbricks, so you can get the average evoked response for timepoint 1, then timepoint 2, etc.

Hope this helps,

Christine Smith
Subject Author Posted

global timecourse with threshold

Krista April 03, 2003 04:23PM

Re: global timecourse with threshold

bob cox April 03, 2003 06:58PM

Re: global timecourse with threshold

Krista April 04, 2003 11:33AM

Re: global timecourse with threshold

Christine Smith April 05, 2003 12:55AM