Geometry Considerations
This page summarizes the geometry conventions used across SIMIND, STIR/SIRF, and PyTomography in this package.
At-a-Glance Axis Conventions
STIR/SIRF image arrays are handled as
(z, y, x).STIR/SIRF projection arrays are often 4D with a singleton TOF axis:
(tof, bin, view, axial). For these, view 0 isarr[0, :, 0, :].Raw Interfile projection loading in
interfile_numpyis exposed as(views, bins, axial)when no singleton TOF axis is present.PyTomographySimindAdaptorpublic object-space tensors are(x, y, z).PyTomography object space is
(x, y, z)(Lx, Ly, Lz).PyTomography SIMIND projections from
pytomography.io.SPECT.simindare(theta, r, z).
Practical Implication
When comparing STIR/SIRF and PyTomography outputs:
Use PyTomography projections directly for reconstruction (no extra manual flip).
Keep PyTomography object tensors in
(x, y, z)end-to-end (input -> system matrix -> reconstruction).Connector internals convert object tensors to SIMIND image file order
(z, y, x)when writing.smi/.dmiinputs.
Units
SIMIND geometry parameters are configured in cm.
STIR/SIRF image geometry is typically expressed in mm.
Connectors handle conversion internally via voxel-size settings (for example, runtime switch
PXis set in cm for SIMIND).STIR/SIRF adaptor voxel size extraction expects z-spacing in mm. It uses
voxel_sizes()[2]when available, and falls back toget_grid_spacing()using the last spatial element (index 3 for 4-element spacing, index 2 for 3-element spacing).
Example Configuration Guardrails
The OSEM examples intentionally pin key simulation parameters so geometry checks are reproducible:
NN=1(runtime switch) for faster, deterministic iteration.config[29]=24for projection count.config[53]=0to keep collimator modeling geometric-only in these tests.config[19]=2to keep a consistent mapping used by current examples.
Debug Checklist
If reconstruction geometry looks wrong:
Confirm array shape and axis order before plotting/reconstruction.
Confirm you are extracting projection view 0 from the correct axis.
Confirm PyTomography object-space tensors are in
(x, y, z).Confirm attenuation-map orientation matches the reconstruction backend.
Compare hotspot center-of-mass between source and recon in a common axis convention.