Howdy-

A couple of options for navigating this.

First, I see you have a T-stat, but you are only looking at positive values. Some software promote the use to using two, 1-sided thresholds to extra information, but that can lead to mathematical malfeasance if users aren't careful and wary. Please see this article for more info on properly analyzing 2-sided tests (which a T-test nearly always is):

To do the mechanics of you what you want, you can see the value and useful stat info out on the command line, with p2dsetstat and using either the subbrick label of the stat or the subbrick number:

```
p2dsetstat \
-inset STAT_DSET"[Face-Fixation_GLT#0_Tstat]" \
-pval 0.0001 \
-2sided
```

**Note:** you must choose to translate 2sidedly or 1sidedly, and again the above paper describes more about this. For T-tests, it is nearly always 2-sidedly that is correct (and pairs of 1-sided testing needs to be adjusted properly, which many people do *not* do). If I run something like the above on the AFNI_data6 teaching example output, the output would look like:

```
p2dsetstat -inset stats.FT+tlrc.'[8]' -pval 0.0001 -2sided
++ Found input file : stats.FT+tlrc.[8]
++ Subbrick label : V-A_GLT#0_Tstat
++ p-value : 0.00010000
++ stat type and par : Ttest(412)
++ sidedness : 2sided
++ Final stat val : 3.929022
```

If you add the `-quiet`

option to the above, then you can get *just* the number of interest out, the "Final stat val"; that is more useful for scripting. You can save that to a variable, and then use that in a 3dcalc command to create a mask of *both the positive and negative sides*:

```
#!/bin/tcsh
set stat_val = `p2dsetstat \
-inset STAT_DSET"[Face-Fixation_GLT#0_Tstat]" \
-pval 0.0001 \
-2sided \
-quiet`
# map where 1 means T>stat_val and -1 means T<-stat_val
3dcalc \
-a STAT_DSET"[Face-Fixation_GLT#0_Tstat]" \
-expr "ispositive(a-${stat_val}) - ispositive(-${stat_val}-a)" \
-prefix MAP_PLUS_MINUS.nii.gz
# map of stat vals where T>stat_val or T<-stat_val
3dcalc \
-a STAT_DSET"[Face-Fixation_GLT#0_Tstat]" \
-expr "a*ispositive(a-${stat_val}) +a*ispositive(-${stat_val}-a)" \
-prefix MAP_EXTRACTED_STAT.nii.gz
# map of coef vals where T>stat_val or T<-stat_val
3dcalc \
-a STAT_DSET"[Face-Fixation_GLT#0_Tstat]" \
-b STAT_DSET"[Face-Fixation_GLT#0_Coef]" \
-expr "b*ispositive(a-${stat_val}) +b*ispositive(-${stat_val}-a)" \
-prefix MAP_EXTRACTED_COEF.nii.gz
```

**Note** about extracting just the statistic values: this leaves out important information of the estimated effect size, esp. if you are processing with afni_proc.py's recommend `scale`

block. More about this is contained in this paper:

You could also use 3dClusterize for this purpose, setting the minimum clustersize to 1 if you want everything out: `-clust_nvox 1`

.

On a final note, and kudos if you have kept reading this looong reply, there is still valuable information below the threshold. We make the case about why this is so important---avoiding mathematical, statistical, biological and interpretational woe, as demonstrated using the NARPS dataset---here:

- Taylor PA, Reynolds RC, Calhoun V, Gonzalez-Castillo J, Handwerker DA, Bandettini PA, Mejia AF, Chen G (2023). Highlight Results, Don’t Hide Them: Enhance interpretation, reduce biases and improve reproducibility. Neuroimage 274:120138. doi: 10.1016/j.neuroimage.2023.120138

Highlight results, don't hide them: Enhance interpretation, reduce biases and improve reproducibility - PubMed

Transparent thresholding is a much better practice that normal arbritrary, opaque thresholding.

--pt