History of AFNI updates  

|
January 19, 2016 09:40AM
Assuming the mask dataset has each ROI marked with a different integer, you could do something like (using csh syntax)

3dhistog -omit 0 -unq U.1D maskdataset+tlrc > /dev/null
foreach uuu ( `1dcat U.1D` )
3dcalc -a maskdataset+tlrc -expr "equals(a,$uuu)" -prefix maskdataset.$uuu
end
\rm -f U.1D

For an ROI labeled with "3" (e.g.), you would get a dataset named maskdataset.3+tlrc whose values are 1 at each voxel where the input was 3, and whose values are 0 at all other voxels. If you with to preserve the input value, change the expression to "a*equals(a,$uuu)".

To become a Jedi AFNI Master, important it is to learn shell scripting.
Subject Author Posted

Extract ROI from Mask

3dFoodie January 18, 2016 06:01PM

Re: Extract ROI from Mask

Emperor Zhark January 19, 2016 09:40AM

Re: Extract ROI from Mask

Emperor Zhark January 19, 2016 11:26AM

Re: Extract ROI from Mask

3dFoodie January 19, 2016 12:35PM