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  

|
October 17, 2004 11:14AM
Hi Jon,

Sure, that would be most easily done with 3dcalc. Swapping
the values of 2 ROIs may take 3 steps of the form (tmp=a, a=b,
b=tmp), but replacing one value with another can be done very
easily.

In a script form, change any 17 to a 6:

set oldval = 17
set newval = 6

3dcalc -a OLD_DSET+orig -expr "a*bool(a-$oldval)+$newval*(1-bool(a-$oldval))" -prefix NEW_DSET

------------
Note that bool(a-$oldval) equals 1 anytime a is not 17, and so
1-bool() equals 1 anytime a is exactly 17. Then 'a' and '$newval'
are used to assign the resulting values, respectively.

- rick

Subject Author Posted

Dataset Draw: Flood to Diff/Zero (or 3dcalc replace voxel value with another)

J. Law October 15, 2004 09:28PM

Re: Dataset Draw: Flood to Diff/Zero (or 3dcalc replace voxel value with another

rick reynolds October 17, 2004 11:14AM

Re: Dataset Draw: Flood to Diff/Zero (or 3dcalc replace voxel value with another

Jon October 17, 2004 07:08PM

Re: Dataset Draw: Flood to Diff/Zero (or 3dcalc replace voxel value with another

Graham Wideman October 18, 2004 08:55PM