Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for get_axial_length for cylindrical scanners. #1495

Merged
merged 2 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading