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  

|
December 31, 2019 12:47PM
Hmm, that is a bit of a different beast. In this case, you want to take each ROI mask and splice it into two parts-- a posterior and an anterior one? Based on what information?


Well, you can do something like the following, but note that this doesn't follow anatomical lines-- that kind of subtley would take different info.

Thinking in (x,y,z) coordinates, the anterior-posterior axis is the 'y' variable, and if your data is in RAI coordinates, then "A" is lower/negative values, and "P" is higher/positive values. Let's say you want to define the the posterior region to be everything with y>5, and the anterior to be the complement of that. Then you could use the fact that 3dcalc expressions can recognize special letters as coordinates (x, y, z, and t) and as indexes (i, j, k, and n). See the "COORDINATES and PREDEFINED VALUES" section in 3dcalc, as well as usage example 7 there. You just have to think of y>5 being the same as y-5>0, and then you can use the ispositive() function in 3dcalc expression, or the equivalent step() one.

For the aforementioned case of anterior/posterior division, you could therefore run the following to take all the values in DSET and multiply them by a binary mask based on coordinate location, zeroing out those regions that are not 'true' with the step() or ispositive() function:
3dcalc -a DSET -expr 'a*ispositive(y-5)' -prefix DSET_ANT
3dcalc -a DSET -expr 'a*not(ispositive(y-5))' -prefix DSET_POST
Note that this pair could be written in other ways; using the not() around the ispositive() function in the second case just made it easy to get the complement of the first condition.

Just note the subtleties of the y>5 being either anterior or posterior, depending on the orientation of your dataset (3dinfo -orient DSET). You can try a couple examples and see what works.

--pt
Subject Author Posted

Resting state create mask

JW December 29, 2019 04:47PM

Re: Resting state create mask

ptaylor December 29, 2019 11:18PM

Re: Resting state create mask

JW December 31, 2019 11:31AM

Re: Resting state create mask

ptaylor December 31, 2019 12:47PM

Re: Resting state create mask

JW December 31, 2019 08:49PM

Re: Resting state create mask

ptaylor January 01, 2020 05:01PM

Re: Resting state create mask

Daniel Glen January 02, 2020 01:43AM

Re: Resting state create mask

JW January 03, 2020 04:25PM