UCL / UCL/STIR

Move internal DiscretisedDensity origin to vendor defined origin

Open
#223 6 comments 0 reactions 1 assignee View on GitHub

@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? Or Coordinate 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 on Scanner::default_vendor_origin_in_gantry_space
          and ProjDataInfo::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.
  • Everything inheriting will have to be checked for z offsets.

  • Scanner.h

    • BasicCoordinate default_vendor_origin_in_gantry_space
  • ProjMatrixByBinUsingRayTracing

    • calculate_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).
  • ScatterEstimationByBin

  • Symmetries

    • TODO
  • zoom.cxx Zooms around image origin, will have to be changed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.