History of AFNI updates  

|
November 08, 2004 09:48AM
The box for the AFNI warped datasets (+acpc or +tlrc) is computed in afni.c function AFNI_init_warp(). In particular, cf. lines 9047-9210. The actual new (nx,ny,nz) values are at lines 9204-9206 in the current source code (assignments to variables cleverly named new_nx, etc.).

Perhaps there is a rounding issue -- some datasets computing new_ny as 275.99 and some as 276.01 -- and then the truncation to int is causing the discrepancy? Some quickie debug printouts should settle that issue with your datasets. The calculation in line 9205 is

new_ny = (xnew_top.xyz[1] - xnew_bot.xyz[1])/resam_vox + 1.5 ;

where resam_vox is the grid spacing desired in the new dataset, and the xnew_*.xyz[1] values are the min and max voxel center y-coordinates (-y=A, +y=P; for the new +acpc dataset these values are from the ATLAS_ALIGNBOX_* constants, as you deduced, my dear Watson). We would want in the ideal world (new_ny-1)*resam_vox==(xnew_top.xyz[1] - xnew_bot.xyz[1]); the extrac +0.5 is to convert the (implicit) cast from float to int in the assignment into a rounding operation.

bob cox
Subject Author Posted

acpc resample dimensions, how calculated?

Graham Wideman November 04, 2004 06:11PM

Re: acpc resample dimensions, how calculated?

rick reynolds November 04, 2004 06:40PM

Re: acpc resample dimensions, how calculated?

Graham Wideman November 04, 2004 07:17PM

Re: acpc resample dimensions, how calculated?

Robert Cox November 05, 2004 09:14AM

Re: acpc resample dimensions, how calculated?

Graham Wideman November 05, 2004 07:18PM

Re: acpc resample dimensions, how calculated?

bob cox November 05, 2004 08:17PM

Re: acpc resample dimensions, how calculated?

Graham Wideman November 07, 2004 11:32PM

Re: acpc resample dimensions, how calculated?

Robert Cox November 08, 2004 09:48AM

Re: acpc resample dimensions, how calculated?

Graham Wideman November 08, 2004 03:42PM