Skip to content

Commit

Permalink
Merge pull request #1495 from robbietuk/get_axial_length_for_cylindrical
Browse files Browse the repository at this point in the history
Add support for get_axial_length for cylindrical scanners.
  • Loading branch information
KrisThielemans authored Aug 25, 2024
2 parents e03fbd0 + a014eda commit c51067d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/include/stir/Scanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ class Scanner
inline float get_transaxial_block_spacing() const;
/*! get total axial length covered by the detectors (incl. any gaps between blocks etc.)
\todo Need to update this function when enabling different spacing between blocks and buckets etc.
For cylindrical scanners, calculates the length by the ring spacing.
*/
inline float get_axial_length() const;
//@} (end of get block geometry info)
Expand Down
8 changes: 8 additions & 0 deletions src/include/stir/Scanner.inl
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,14 @@ Scanner::get_axial_block_spacing() const
float
Scanner::get_axial_length() const
{
if (get_scanner_geometry() == "Cylindrical")
{
return get_num_rings() * get_ring_spacing();
}
else if (get_scanner_geometry() == "Generic")
{
error("get_axial_length not yet implemented for Generic scanner geometry");
}
return get_num_axial_buckets() * get_num_axial_blocks_per_bucket() * get_axial_block_spacing()
- (get_axial_block_spacing() - (get_num_axial_crystals_per_block() - 1) * get_axial_crystal_spacing());
}
Expand Down

0 comments on commit c51067d

Please sign in to comment.