EDIT: Paul beat me to this, but just in case there's a bit of extra useful information, I'll leave this here.
Overlap can be computed with the @DiceMetric or 3dABOverlap programs.
Simple masks can be created with 3dcalc like this way from example 3 in its help:
3. Create a simple mask that consists only of values in sub-brick #0
that are greater than 3.14159:
3dcalc -a 'func+orig[0]' -expr 'ispositive(a-3.14159)' \
-prefix mask
You can use the "within" operator to limit data to a range like between(a,-4,-1.5). So we can do something like this to make data that is either 0,1 or 2
3dcalc -a myZdata.nii.gz -expr 'within(a,1.5,4)+2*(within(a,-4,-1.5))' -prefix trinarized.nii.gz
Edited 1 time(s). Last edit at 08/09/2022 10:47AM by Daniel Glen.