Skip to content

Support full Euler angles (alpha, theta, psi) in parallel Siddon projector - #792

Open
hashimoto-koh wants to merge 1 commit into
CERN:masterfrom
hashimoto-koh:fix/parallel-siddon-euler-angles
Open

hashimoto-koh wants to merge 1 commit into
CERN:masterfrom
hashimoto-koh:fix/parallel-siddon-euler-angles

Conversation

@hashimoto-koh

Copy link
Copy Markdown

Description

For geo.mode == "parallel" with projection_type == "Siddon", the projector previously only applied 2D rotation around the Z-axis using geo.alpha, completely ignoring geo.theta and geo.psi.

This prevented parallel-beam laminography and tilted-axis geometries from being simulated with the Siddon projector.

This PR introduces the 3D ZYZ Euler rotation (eulerZYZ) into Common/CUDA/Siddon_projection_parallel.cu, ensuring that all three view-dependent angles (alpha, theta, psi) are correctly applied to the parallel rays and detector plane according to TIGRE's geometry convention.

In addition, it completes the 3D Siddon kernel by:

  1. Restoring Z-axis plane stepping and ray bounds (azm, azM, kmin, kmax, az, azu).
  2. Ensuring the plane traversal invariant ($a > a_m$) and strictly determining initial voxel indices from ray direction and boundary planes, preventing voxel misidentification and segment dropouts caused by single-precision rounding on grazing/cardinal rays.
  3. Preserving bitwise consistency with upstream baseline for untilted parallel projections (theta=0, psi=0) by retaining original division operators.
  4. Returning early for rays that do not intersect the volume AABB (am >= aM), which is required for correct ray tracking in tilted geometries.

Verification

  • Sensitivity: Verified that varying theta and psi independently alters projections of an asymmetric 3D volume as expected.
  • Untilted Baseline Consistency: Verified across 11 arbitrary alpha views (11,264 detector pixels) on a random 32^3 volume that theta=0, psi=0 matches upstream master baseline with zero error (max absolute error = 0.0).
  • Independent Analytical Ground Truth: Verified ray path lengths against an independent physical-coordinate analytical Ray-Box intersection calculation across 13 views with arbitrary 3D Euler angles, anisotropic voxels, and offsets (max error < 0.02, correlation > 0.99999).
  • Grazing and Boundary Rays: Verified on grazing rays (theta=pi/2) and cardinal entry views (72 views probe) that marcher integration matches actual GPU endpoint Ray-AABB intersection lengths within ~5.4e-5. (Note: as with existing float32 projectors, grazing rays extremely close to voxel boundaries are subject to single-precision coordinate construction rounding).
  • Regression Tests: Added Python/tests/test_parallel_siddon_euler.py containing 7 comprehensive regression test cases (all passing).

…ector

Previously, parallel Siddon projection only considered 2D rotation
around the Z-axis using geo.alpha, completely ignoring theta and psi.
This prevented parallel-beam laminography and tilted-axis geometries
from being simulated with the Siddon projector.

This commit:
- Applies eulerZYZ rotation to ray endpoints and detector planes.
- Completes Z-axis Siddon stepping and ray bounds.
- Enforces plane traversal invariants (a > am) and determines initial
  voxel indices from direction and boundary planes, avoiding voxel
  misidentification on grazing and cardinal rays.
- Retains original division operators to preserve bitwise consistency
  with upstream baseline for untilted parallel projections.
- Returns early for rays not intersecting the volume AABB.
- Adds comprehensive regression tests in Python/tests/test_parallel_siddon_euler.py.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant