Make a mask based on threshold T-values

3dcalc -a merge.lh.niml.dset[HC-SZ_Tstat] -b mask.lh.niml.dset[‘node label’] -expr ‘(step(a-2.05)+abs(step(a-2.05)-1))*b’ -prefix new_mask.lh.niml.dset
3dcalc: No match.

I do not know why when running this command it gives me that 3dcalc is not found?

I have the problem than when I extract mean beta values from a entire choosen HCP Glasser Parcell it gives me it is not significant. I did whole surface 3dttest and it shows significance but only on a subregion of the entire glasser parcell. Is there a way extract only the subregion of the glasser parcell that is significant instead on the entire parcell?

3dcalc -a merge.lh.niml.dset'[HC-SZ_Tstat]' -b mask.lh.niml.dset'[node label]' -expr '(step(a-2.05)+abs(step(a-2.05)-1))*b' -prefix new_mask.lh.niml.dset

… puts quotes to protext the square brackets from being interpreted by the shell.

However, note that “step(…)” will produce a 1 wherever the interior of the parenthese is True, so there would be no reason to abs(…) it. I am not sure what you are aiming to accomplish in your expr ‘…’? Can you please clarify that?


I am trying to create a new mask that only mask the subregion of a previously choosen Parcell that are significant. I am thresholding based on a t-value of 2.05.

Note that ‘[ …]’ are subbrick selectors, and ‘<…>’ are region selectors. If you have a region with a label ROI_LABEL, yo

Let’s say you have a dset DSET1 that you want to select a subbrick from based on subbrick label (like a t-stat label MY_TSTAT_LABEL) and apply a threshold like “greater than 2.05”, and you have another dset DSET2 that is a map of ROIs and you want to pick one with a particular label MY_ROI_LABEL. Then the following expression should give you what you want:

3dcalc -a DSET1'[MY_TSTAT_LABEL]' -b DSET2'<MY_ROI_LABEL>' -expr 'step(a-2.05)*b' -prefix OUTPUT

… which is the intersection of thresholding the ‘a’ dataset and selecting one ROI from the ‘b’ dataset.

Is that what you would like?


What if I also want the t threshold for values that are less than -2.05?

If you want to take the previous example and have thresholding before values in the ‘a’ (tstat) dataset that are both >2.05 and <-2.05, then you could do this:

3dcalc -a DSET1'[MY_TSTAT_LABEL]' -b DSET2'<MY_ROI_LABEL>' -expr '(step(a-2.05)+step(-2.05-a))*b' -prefix OUTPUT

Of course, please verify this using the AFNI GUI to check…