The x'-y'-z' origin for voxelized navigators

Started by mwj12, Dec 07, 2025, 07:15 PM

Previous topic - Next topic

mwj12

*
Newbie
Posts: 26
Logged
In the documentation for voxelized navigators in v1.3, the diagram shows the local coordinate system (x',y',z') of the voxel volume to have its origin at one corner of the voxel grid (I'm not sure if that's supposed to be the center of the first voxel or the voxel's  outermost corner...)

However, all of the behavior I'm seeing suggests that the origin is instead at the center of the voxel grid. In particular, when I set up a phantom with the following
phantom = GGEMSVoxelizedPhantom('anthropomorphic')
phantom.set_phantom('data/anthropomorphic.mhd', 'data/range_anthropomorphic.txt')
phantom.set_rotation(0.0, 0.0, 0.0, 'deg')
phantom.set_position(0.0, 0.0, 0.0, 'mm')
the simulation results I'm getting are consistent with a phantom centered at the world origin.
                             
If the (x',y',z') origin is at the corner of the voxel grid, shouldn't
set_position(0.0, 0.0, 0.0, 'mm') put the corner of the voxel grid at the world origin, rather than the phantom's center?

didier.benoit

Administrator
*****
Newbie
Posts: 18
Logged
Thanks for the detailed observation — this is indeed a point where the GGEMS v1.3 implementation behaves differently from what the documentation suggests.

In the voxelized geometry module of v1.3, the voxel grid is internally indexed from a corner, but when the phantom is constructed and positioned in the world, the engine applies a transformation that implicitly recentres the volume around its geometric centre.
As a result, calling:
phantom.set_position(0.0, 0.0, 0.0, "mm");

places the centre of the phantom at the world origin, not the corner of the voxel grid.This behaviour is consistent with what you are seeing, and it is expected for the current v1.3 implementation. This centring step was historically introduced to simplify rotations and transformations, but it does create an inconsistency between the documented "corner origin" and the effective placement of the object in world coordinates.
We will address this properly in GGEMS v2, where the coordinate conventions will be made fully explicit and consistent (local origin, centre, positioning, and rotations). The goal is to remove this ambiguity entirely and adopt a single, predictable convention across the whole geometry system.

mwj12

*
Newbie
Posts: 26
Logged
Thanks, but to be clear, If I want the center of the voxel grid at world coordinates (tx,ty,tz), then,
set_position(tx, ty, tz, 'mm') is the right thing to do?