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  

|
September 02, 2015 04:28AM
Hi-

Just a couple of preliminary things-- I think if you 'binarize' something, by definition the only values can be 0 or 1 (i..e, you can't binarize and have values 0,1,2,3,4,5). Also, generally a 'mask' is specifically *nonzero* numbers, so I don't believe it is accurate to say "I have a mask of 0/1" values. Instead, you could have a mask of 1s, surrounded by a sea of nonmasked area of value 0.

To your question, a simple way to make a binarized mask (only values of ones in the mask, zero elsewhere) from a file with values >=0 would be the following:
$ 3dcalc -a FILENAME -expr 'step(a)' -prefix NEWMASK
The 'step()' function creates a dataset with value 1 wherever a voxel in 'a' >0, and 0 where a voxel in 'a' is zero. That sounds like what you want?

--pt
Subject Author Posted

Creating a mask filled only with 1/0

ssyong715 September 02, 2015 03:25AM

Adding a question

ssyong715 September 02, 2015 03:53AM

Re: Creating a mask filled only with 1/0

ptaylor September 02, 2015 04:28AM

Re: Creating a mask filled only with 1/0

ssyong715 September 02, 2015 01:56PM

Re: Creating a mask filled only with 1/0

Kirk January 26, 2018 10:55AM

Re: Creating a mask filled only with 1/0

Kirk January 26, 2018 11:01AM

Re: Creating a mask filled only with 1/0

ptaylor January 26, 2018 11:47AM