From 8f948ed75870a0abc412def5d21abc89b882a7a7 Mon Sep 17 00:00:00 2001 From: rts Date: Fri, 23 Aug 2024 11:19:59 -0700 Subject: [PATCH 1/2] Add support for get_axial_length for cylindrical scanners. --- src/include/stir/Scanner.h | 1 + src/include/stir/Scanner.inl | 4 ++++ 2 files changed, 5 insertions(+) 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..6ab9d78dd 100644 --- a/src/include/stir/Scanner.inl +++ b/src/include/stir/Scanner.inl @@ -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()); } From a014edae32c1bb5b6583b619601debbd0229f6ba Mon Sep 17 00:00:00 2001 From: Kris Thielemans Date: Sat, 24 Aug 2024 19:05:58 +0100 Subject: [PATCH 2/2] get_axial_length calls error for generic Scanner --- src/include/stir/Scanner.inl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/include/stir/Scanner.inl b/src/include/stir/Scanner.inl index 6ab9d78dd..050e80d17 100644 --- a/src/include/stir/Scanner.inl +++ b/src/include/stir/Scanner.inl @@ -299,9 +299,13 @@ float Scanner::get_axial_length() const { if (get_scanner_geometry() == "Cylindrical") - { - return get_num_rings() * get_ring_spacing(); - } + { + 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()); }