Skip to content

Commit

Permalink
Add support for get_axial_length for cylindrical scanners.
Browse files Browse the repository at this point in the history
  • Loading branch information
robbietuk committed Aug 23, 2024
1 parent e03fbd0 commit 8f948ed
Show file tree
Hide file tree
Showing 2 changed files with 5 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
4 changes: 4 additions & 0 deletions src/include/stir/Scanner.inl
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ Scanner::get_axial_block_spacing() const
float
Scanner::get_axial_length() const
{
if (get_scanner_geometry() == "Cylindrical")
{
return get_num_rings() * get_ring_spacing();
}
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 8f948ed

Please sign in to comment.