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  

|
May 13, 2004 10:00AM
Hi Graham,

It seems that the programs that will rotate a volume do not have an
option for doing "nearest neighbor" interpolation, as you have seen.

There are two options that I can think of to try, but neither is
particularly nice. The fast but inaccurate way would be to just rotate
the volume, and then truncate every real number to an integer, via:

3dcalc -a input_dset+orig -expr 'int(a)' -prefix output_dset

But that is not accurate (if you have only 3's and 19's, then some
truncation to 8 (or whatever) gives you a value that is not in your
dataset to begin with).

The more accurate work-around, which is more difficult to do, is to
break the mask into separate bricks first, rotate each one, then set
all values in the new brick to the proper value, and then put them
together.

The hard part there (beyond writing the shell script to do the rest
of it) is putting the bricks back together. Some output voxels will
be set in more than one dataset, so you would have to decide what
value to give them. If you chose "min", for example, then you could
put them together with:

3dcalc -a d1+orig -b d2+orig .... -expr '(orstat(1,a,b,c,...))' -prefix OUT

Note that orstat() returns the ordered value of the inputs, in
ascending order. So if you have 5 inputs, a through e, then
orstat(1,a,b,c,d,e) is the minimum and orstat(5,a,b,c,d,e) is the
maximum.

Another 3dcalc function to consider is median(a,b,c,...), but then
you would probably have to worry about zeros.

Please see "3dcalc -help" for more information.

- rick

Subject Author Posted

is there an afni tool for rotating a label volume?

Graham Wideman May 13, 2004 02:39AM

Re: is there an afni tool for rotating a label volume?

Ziad S. Saad May 13, 2004 09:46AM

Re: is there an afni tool for rotating a label volume?

rick reynolds May 13, 2004 10:11AM

Re: is there an afni tool for rotating a label volume?

Ziad S. Saad May 13, 2004 11:38AM

Re: is there an afni tool for rotating a label volume?

rick reynolds May 13, 2004 10:00AM

Re: is there an afni tool for rotating a label volume?

Graham Wideman May 13, 2004 05:36PM

Re: is there an afni tool for rotating a label volume?

rick reynolds May 14, 2004 07:58AM

Re: is there an afni tool for rotating a label volume?

Graham Wideman May 14, 2004 07:14PM