diff --git a/src/include/stir/Scanner.h b/src/include/stir/Scanner.h index 3fc5a6f26..e5b7332bd 100644 --- a/src/include/stir/Scanner.h +++ b/src/include/stir/Scanner.h @@ -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) diff --git a/src/include/stir/Scanner.inl b/src/include/stir/Scanner.inl index 2c742d21c..050e80d17 100644 --- a/src/include/stir/Scanner.inl +++ b/src/include/stir/Scanner.inl @@ -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()); }