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  

|
February 01, 2019 05:45PM
Greetings,

I used 3dcalc with a very long list of parameters in an 'amongst()' expression. The program ran but the output was incorrect. I rewrote my code to split the expression into shorter ones and I get the expected result. Thought to let you know however, since this bug can go undetected.

To test, replace the 'a' dataset below with any aparc.a2009s+aseg_rank.nii and try:

Bad output due to large number of parameters:
3dcalc -a aparc.a2009s+aseg_rank.nii -expr 'a*amongst(a,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192)' -prefix bad.nii

Work around for correct output:
3dcalc -a aparc.a2009s+aseg_rank.nii -expr 'a*step(amongst(a,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74)+amongst(a,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104)+amongst(a,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134)+amongst(a,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164)+amongst(a,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192))' -prefix good.nii

Afni version: Precompiled binary macos_10.12_local: Jan 22 2019 (Version AFNI_19.0.01 'Tiberius')


Cheers,
ZXu
Subject Author Posted

amongst extremes

Ziad Saad February 01, 2019 05:45PM

Re: amongst extremes

ptaylor February 01, 2019 06:05PM

Re: amongst extremes

rick reynolds February 05, 2019 10:32AM

Re: amongst extremes

Daniel Glen February 05, 2019 11:28AM