History of AFNI updates  

|
January 20, 2023 01:06PM
And, separately, note that you can use 'x', 'y', 'z' and 't' to represent spatial and temporal values, respectively, if you haven't used those to load in a dset (as well as 'i', 'j', 'k' and 'l' for their index analogue). See here:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/programs/alpha/3dcalc_sphx.html#coordinates-and-predefined-values

One use here might be to use a full atlas on its own and add 1000 everywhere that the x coordinate is >0:
3dcalc -a atlas.nii.gz -expr "a+1000*a*ispositive(x)" -prefix atlas_adding_1000_to_half.nii.gz -datum short
... which could also be written:
3dcalc -a atlas.nii.gz -expr "a*(1+1000*ispositive(x))" -prefix atlas_adding_1000_to_half.nii.gz -datum short

If it is the negative coords that are on the right side of the brain (like in RAI-DICOM notation), then perhaps:
3dcalc -a atlas.nii.gz -expr "a*(1+1000*isnegative(x))" -prefix atlas_adding_1000_to_half.nii.gz -datum short

Deciding exactly where you want the boundary to be is an important consideration (everything >0, or everything >=0?) You can shift the boundary line algebraically, as needed:
3dcalc -a atlas.nii.gz -expr "a*(1+1000*isnegative(x-17))" -prefix atlas_adding_1000_to_half.nii.gz -datum short

--pt
Subject Author Posted

bug with 3dcalc?

Doughboys January 20, 2023 10:26AM

Re: bug with 3dcalc?

rick reynolds January 20, 2023 10:33AM

Re: bug with 3dcalc?

ptaylor January 20, 2023 01:06PM