AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

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