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  

|
November 30, 2020 11:12PM
Dear All,

I just started using Afni. My routine inputs a CT .nii volume and a Nx3 set of voxel (ijk) coordinates to Afni (extracted from the CT from an upstream external software). Afni then transforms them to RAI xyz (mm) coordinates (1st set), then a subroutine generates a 2nd RAI coordinates after some coregistrations inside Afni. I need to generate back voxel coordinates from this 2nd RAI set, since I need to move the set of point coordinates into another software package using a different coordinate system.

So I need to know how Afni transforms the ijk to xyz, and back (xyz to ijk). I tried the black-box version (3dUndump to construct a 3D vol from these points, then 3dmaskdump with -ijk option to get the voxel indices. However, there is a rounding of the voxel coordinates inside afni (fractional voxel coordinates get rounded with loss of precision after the forward and backward transforms. So, I hope to do these transforms the old way, by using the matrix from the CT header and apply some matrix operations. I would need to know:
1. How one can retrieve such a 4x4 matrix from the header (3dinfo CT generates a .geom line but not sure of the order if trying to organize the line in a 4x4;
2. How is afni internally switching from ijk to xyz, and back (please provide formulas). My CT vol is in RPI orientation, but I can switch to any other with 3dresample -orient if required by these formulas.

Thank you very much, Octavian
Subject Author Posted

ijk to xyz (voxel to mm) coordinate transformations

octavian lie November 30, 2020 11:12PM

Re: ijk to xyz (voxel to mm) coordinate transformations

ptaylor December 01, 2020 01:19PM

Re: ijk to xyz (voxel to mm) coordinate transformations

octavian lie December 01, 2020 07:02PM