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  

|
March 02, 2004 05:55PM
Hi Lukas,

Those tag coordinates can be subtracted from the origin via
the '3drefit -dxorigin ...' command. The only difficulty is
getting the xyz order correct. The 3drefit command takes xyz
to be RAI.

For example, if a dataset is ASL orientation, then 'A' is the
second coordinate of RAI, 'S' is the third (I/S is third), and
L is the first. See the 'set order' command near the top of
the following script. Modify that line for your orientation.

Note that 'awk' is used in case 3dAttribute outputs values
(near 0.0) in scientific notation.

You will have to re-indent the script, or let me know if you
would like a nicely formatted version sent via email.

- rick


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


#!/bin/tcsh

if ( $#argv != 2 ) then
echo usage: $0 inset outset_prefix
exit
endif

set inset = $1
set outset = $2


# -----------------------------------------------------------------
# first note the orientation order
#
# since this dataset is in ASL orientation, RAI xyz leads to subscripts:
# 2 (A/P is 2 in RAI), 3 (I/S is 3 in RAI), 1 (L/R is 1 in RAI)

set order = ( 2 3 1 )


# -----------------------------------------------------------------
# get negative tag locations to subtract them via "3drefit -dxorigin..."

set tags = ( `3dAttribute TAGSET_FLOATS $inset | \
awk '{printf "%f %f %f", -$1, -$2, -$3}' ` )
echo tags = $tags


# -----------------------------------------------------------------
# make a new dataset

3dcopy $inset $outset
if ( $status ) then
echo "command failed: 3dcopy $inset $outset"
echo "does output file '$outset' already exist?"
exit
endif


# -----------------------------------------------------------------
# carry out 3drefit command
#

3drefit -dxorigin $tags[$order[1]] -dyorigin $tags[$order[2]] \
-dzorigin $tags[$order[3]] $outset+orig

Subject Author Posted

Setting Origins

Lukas Pezawas March 01, 2004 07:29PM

Re: Setting Origins

rick reynolds March 02, 2004 05:55PM

Re: Setting Origins

Lukas Pezawas March 02, 2004 06:19PM

Re: Setting Origins

rick reynolds March 02, 2004 06:53PM