3dClusterize vs 3dclust

Hi everyone,
I’ve just been comparing commands with 3dClusterize and 3dclust and I’m wondering why the mean, SEM and max intensity differ?

3dclust -nosum -no_1Dformat -1dindex 5 -1tindex 6 -2thresh -2.8 2.8 -NN2 33 file+tlrc
Volume CM RL CM AP CM IS minRL maxRL minAP maxAP minIS maxIS Mean SEM Max Int MI RL MI AP MI IS

45  -40.0  -40.1  -14.6  -43.5  -37.5  -47.5  -29.5  -16.5  -10.5   [b]0.0852[/b]   0.0025  -0.1195  -39.5  -43.5  -14.5

3dClusterize -nosum -no_1Dformat -idat 5 -ithr 6 -bisided -2.8 2.8 -NN 2 -clust_nvox 33 -inset file+tlrc
Volume CM RL CM AP CM IS minRL maxRL minAP maxAP minIS maxIS Mean SEM Max Int MI RL MI AP MI IS

45  -40.0  -40.1  -14.6  -43.5  -37.5  -47.5  -29.5  -16.5  -10.5   [b]8323.4[/b]   242.99   -11670  -39.5  -43.5  -14.5 

It’s the same when I use a different threshold. From 3dClusterize are always round about, but not exactly 100.000 times higher.
Does anyone know why this might be?
Also, is seems to me that both tools are missing a minus (-) in front of the mean… When I click on the voxels of that cluster within AFNI, all the values appear to be negative. This is also logical, as the cluster has negative z values (sub-brick 6), therefore I would assume the beta-values of sub-brick 5 to be negative.

And last but not least, does anyone know to export clusters found by 3dclust/3dCclusterize to separate masks?
-pref_map from 3dClusterize puts them all into one’mask with separate integers. I guess I could use 3dcalc in a loop to only keep voxels with values of 1,2,3… Is there an more efficient method?

Agent 007-

That is a good question. I think the resolution of the SEM differences is this (I am using the AFNI_data6/afni/func_slim* dset for running this–we can compare notes on the same data): your 3dclust command is “2thresh”, or simple 2sided testing, and your 3dClusterize command is “bisided”.

Keeping this 3dclust command constant:

3dclust -nosum -no_1Dformat -1dindex 5 -1tindex 6 -2thresh -2.8 2.8 -NN2 33 func_slim+orig.

… if I run the “bisided” case, results differ:

3dClusterize -nosum -no_1Dformat -idat 5 -ithr 6 -bisided -2.8 2.8 -NN 2 -clust_nvox 33 -inset func_slim+orig.

… but if I run 3dClusterize as “2sided” to match the 3dclust command:

3dClusterize -nosum -no_1Dformat -idat 5 -ithr 6 -2sided -2.8 2.8 -NN 2 -clust_nvox 33 -inset func_slim+orig.

then the tables appear to be the exact same to me. Please check if that sorts our your difference, as well (and this might resolve other issues there…).

The difference between 2sided and bisided is important: the thresholding is the same, but in “bisided”, clusters are only formed between voxels with effects of the same sign; in 2sided, positive and negative voxels that happen to be adjoining will clump together. It is hard to see how “bisided” would not generally be the clusterizing rule of choice.

Re. your question about the Mean values: wow, I never noticed that. Looking in the code, there is actually a switch that the “Mean” actually is the “|Mean|” by default (that is, the absolute value). If you use the option “-noabs”, then you will see the signed Mean.
To be honest, the reason for this is mysterious. I kind of think we should change this default (3dClusterize is just copying 3dclust here, and 3dclust is oooold, as you might notice, with really tough syntax to use). Thanks very much for bringing up this point—I will reply back about this anon.

Re. “bursting” the clusters to separate files: there is no tool for that, so looping over values with 3dcalc would be the way to do it. In general, using subbrick selectors on datasets (e.g., Clust_mask+tlrc"<3>") for given commands is often a pretty efficient way to go (not requiring lots of separate files). Do you have a particular use case in mind for applying individual ROIs?


Hi --pt,

first of all, thanks for your answer!

I was able to replicate your exampe for the AFNI_data6 func slim file, but it still is different for my dataset.
Regarding the difference between bisided and 2sided: Your’re right, I should use bisided, as there’s a chance that positive and negative voxels might happen to be next to each other. But there’s no -bisided option in 3dClust, is there?

I’ve just had a look with 3dinfo -verb …file+tlrc and I’m thinking maybe my issue has something to with internal vs scaled?

-- At sub-brick #5 'Int-Ctlr_over_Time' datum type is short:       -18946 to         32767 [internal]
                                             [*  1.02413e-05]     -0.194032 to      0.335577 [scaled]

So maybe 3dclust and AFNI GUI are using “scaled” and 3dClusterize is using “internal”? Can I get 3dClusterize to use “scaled”, as well?

Thanks for the hint with -noabs, that does indeed make the mean negative :slight_smile:

Do you have a particular use case in mind for applying individual ROIs?
After looking at the rs-fmri data (analyzing a few different ICs), my next step is going to be to correlate scores from a neurophysiological test.
I don’t really know how I’m going to do that yet (I was busy figuring 3dlmer out :D) , but my supervisor pointed me towards
either 1. inserting the score as a covariate into 3dlmer or

  1. getting mean beta values from one of my intermediate steps at each cluster that is observed to be different between Control and Intervention and correlating those with the outcome scores in R.
    I figured option 2 sounds easier and can eventually be done in homeoffice, as well. Instead of setting up multiple 3dlmer models and adding each neurophysological outcome parameter as a covariate separately (I don’t want to control the model for all those outcome measures, I just want see if there’s a correlation between one of them and the imaging data/ the changes observed).
    As I said, I haven’t really looked into this yet. But if I’m totally off track, please do correct me.

– Agent 007 :wink:

Agent 007-

We did a build yesterday, and the newest code has updates+fixes based on your comments—thanks very much for noticing those things.

Firstly, the Mean table values by default will not be absolute valued; if anyone wants that, they can use this new option:

-abs_table_data :(new, from Apr 29, 2021) Use the absolute value of voxel
                 intensities (not the raw values) for calculation of the
                 mean and Standard Error of the Mean (SEM) in the report
                 table. Prior to the cited date, this was default behavior
                 (with '-noabs' switching out of it) but no longer.

Secondly, the scale factors will be applied, too. (I’m not sure when they got ignored in the code, but that is fixed now.)

For what to do with the ROI values in modeling, that might be better to ask as a separate thread. 3dLMEr is probably a good start, but exactly which way to go and how to model depends on what other data you have, what your study design is, etc. Perhaps you have also seen Gang’s note on 3dLMEr.

For some more takes of region-based analysis, this is also some of Gang’s newer work (describes the program RBA for region-based analysis):
Chen G, Xiao Y, Taylor PA, Rajendra JK, Riggins T, Geng F, Redcay E, Cox RW (2019). Handling Multiplicity in Neuroimaging Through Bayesian Lenses with Multilevel Modeling. Neuroinformatics. 17(4):515-545. doi:10.1007/s12021-018-9409-6


Hi pt, thanks for the update and your feedback!
Greatly appreciated!

  • 007