Skip to content

Proposals for new features major changes

Ashley Gillman edited this page Aug 14, 2018 · 3 revisions

This page provides links to our current proposals for new features or major changes of STIR such that they can be discussed by the community. Not all features are listed here. Check also our issues and projects pages.

Vendor-based coordinate system

Ashley Gillman, Richard Brown, David Atkinson, Ben Thomas, Johannes Mayer, Evgueni Ovtchinni, Casper da Costa-Luis, Kris Thielemans

Please add any comments or questions to https://github.com/UCL/STIR/issues/223 rather than editing directly here.

Please see https://github.com/CCPPETMR/SIRF/wiki/Proposals-for-new-features#coordinate-systems for a brief introduction to coordinate systems.

Purpose

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.

STIR's coordinate systems, current and proposed

Projection Data

This refers to functionality in ProjDataInfo, such as get_s, get_t, get_theta, get_phi.

  • reference: Gantry
  • origin: Middle of the gantry. Also, middle of the first ring for some deprecated functions.
  • axes-directions: (x, y, z) = more right, more up, more into the gantry, as you face the scanner from the bed side.

Discretised Density

Currently <2018-08-09 Thu>:

  • physical_coord interface
    • reference: Gantry
    • origin: middle of the first ring
    • axes-directions: (x, y, z) = more right, more up, more into the gantry, as you face the scanner from the bed side.
  • voxel space
    • reference: Gantry
    • origin: Middle of the gantry.
    • axes-directions: (x, y, z) = more right, more up, more into the gantry, as you face the scanner from the bed side.

Proposed

A new DICOM_LPS interface will be added, the origin of the physical_coord interface will be modified to be the vendor origin.

  • DICOM_LPS interface
    • reference: Patient
    • origin: vendor-origin
    • axes-directions: LPS
  • physical_coord interface
    • reference: Bed
    • origin: vendor-origin
    • axes-directions: (x, y, z) = more right, more up, more into the gantry, as you face the scanner from the bed side.
  • voxel space
    • reference: Gantry
    • origin: Middle of the gantry.
    • axes-directions: (x, y, z) = more right, more up, more into the gantry, as you face the scanner from the bed side.

Changes

This requires:

  • New member: CartesianCoordinate DiscretisedDensity::get_DICOM_LPS_for_indices(BasicCoordinate idx)

  • New private members: CartesianCoordinate DiscretisedDensity::reorient_physical_coordinate_using_patient_orientation(CartesianCoordinate coord)

    NB: patient orientation is available via ExamInfo. When loading image formats that don't encode this information (e.g., NIfTI), this will be assumed to be head-first, supine.

DiscretisedDensity should only contain information available in a vendor-supplied reconstructed image (i.e. in DICOM), but it should be able to return DICOM_LPS coordinates. This means that DiscretisedDensity has no information on bed position and may not know on which scanner it was acquired.

This potentially implies:

  • Projectors need to be aware of the vendor origin, and project to/from an image which is defined w.r.t. it.
  • Projectors get physical locations of detectors etc., from ProjData, so ProjData should define a new set of methods which report detector and LOR locations w.r.t. the vendor origin.

In addition, IO via ITK in STIR will be modified to read/write in DICOM-LPS:

  • Modifications to ITKOutputFileFormat and ITKImageInputFileFormat to save DICOM/NIfTI/etc. with correct axes directions and with correct origin at the vendor origin.

Note that STIR internally will operate internally in a bed-based coordinate system (i.e., the image geometry won't change with patient orientation). However, images offsets will change such that the new origin will be defined by the vendor (it was previously the centre of the first ring). STIR's DiscretisedDensity will then have adequate information to store the image in DICOM's patient-based coordinate system.

Backwards compatibility

Since STIR's internal origin has changed, all saved images after this change would have different offset. It theory, the image content should be voxel-wise-identical.

More detailed plan of 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.