Move internal DiscretisedDensity origin to vendor defined origin
@KrisThielemans is already working on this.
Since Jun 26, 2026.
- Dominant language
- C++
- Stars
- 160
- Forks
- 113
- Avg merge
- 12d 15h
- Merged PRs (30d)
- 1
Description
For latest info on this, see:
https://github.com/UCL/STIR/wiki/Proposals-for-new-features-major-changes#vendor-based-coordinate-system
I will attempt to keep it in-line with latest developments and discussion.
The proposal is to move STIR's reference system for images in line with the vendor's system. This would mean that reconstructed images can be directly compared with vendor reconstructions. The main change required is for DiscretisedDensity to be able to express voxel locations in DICOM-standard LPS space. However, this in turn requires that the internal origin for DiscretisedDensity to align with the vendor origin.
Proposed changes
-
ProjDataInfo.h- Private
float bed_position- TODO:
float bed_height? OrCoordinate bed_position?
- Public
- ONE OF:
LOR ProjDataInfo::lor_gantry_to_bed(LOR lor)Maps a LOR (i.e., encoded
via s, ϕ, t, θ) from Gantry space with origin at middle of scanner
to Bed space with origin at vendor origin.BasicCoordinate ProjDataInfo::point_gantry_to_bed(BasicCoordinate point)Maps a point (i.e., encoded by x, y, z) from Gantry space with
origin at middle of scanner to Bed space with origin at vendor
origin.- Currently these functions will simply apply an offset to t and
z based onScanner::default_vendor_origin_in_gantry_space
andProjDataInfo::bed_position. - Plus inverse functions.
- OR
float ProjDataInfo::get_s_bed(Bin bin)float ProjDataInfo::get_phi_bed(Bin bin)float ProjDataInfo::get_t_bed(Bin bin)float ProjDataInfo::get_m_bed(Bin bin)float ProjDataInfo::get_theta_bed(Bin bin)- etc.
- OR
LOR ProjDataInfo::get_LOR(Bin bin)LOR ProjDataInfo::get_LOR_in_bed_space(Bin bin)float LOR::get_s()- etc.
- ONE OF:
- Private
-
Everything inheriting will have to be checked for z offsets.
-
Scanner.hBasicCoordinate default_vendor_origin_in_gantry_space
-
ProjMatrixByBinUsingRayTracingcalculate_proj_matrix_elems_for_one_bin()- Where s, ϕ, etc. are calculated, we will then convert this into the bed space
-
Other
ProjMatrixByBin- Likely will have to change on a case-by-case basis.
-
DiscretisedDensity- New member:
CartesianCoordinate DiscretisedDensity::get_DICOM_LPS_for_indices(BasicCoordinate idx).
- New member:
-
ScatterEstimationByBin- This does its own manual projection in
integral_between_2_points
https://github.com/UCL/STIR/blob/db0b3e9b67ac45bdd250fbaf07257e5a690276b7/src/scatter_buildblock/single_scatter_integrals.cxx#L100-L141
and uses a z offset. Also
beforehand insample_scatter_points()
https://github.com/UCL/STIR/blob/db0b3e9b67ac45bdd250fbaf07257e5a690276b7/src/scatter_buildblock/sample_scatter_points.cxx#L65-L95 - These could use something like:
proj_data_info_ptr->image_bed_to_gantry(scatter_point)/voxel_size,proj_data_info_ptr->image_bed_to_gantry(detector_coord)/voxel_size,
eliminating the need fororigin.
- This does its own manual projection in
-
Symmetries
- TODO
-
zoom.cxxZooms around image origin, will have to be changed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.