-
Notifications
You must be signed in to change notification settings - Fork 95
Proposals for new features major changes
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.
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.
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.
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.
- 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.
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.
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
, soProjData
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
andITKImageInputFileFormat
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.
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.
-
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 on
Scanner::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.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)
.
- 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 in =sample_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.cxx
Zooms around image origin, will have to be changed.