Skip to content

Commit

Permalink
Merge pull request #1228 from KrisThielemans/updates_for_STIR6.0
Browse files Browse the repository at this point in the history
updates for STIR 6.0 compatibility
  • Loading branch information
KrisThielemans authored Jan 8, 2024
2 parents d034e4c + bde0e74 commit 20f9ad5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
7 changes: 6 additions & 1 deletion src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,13 @@ The actual algorithm is described in
if (LmToProjData::set_up() == Succeeded::no)
THROW("LmToProjData setup failed");
fan_size = -1;
const int max_fan_size =
#if STIR_VERSION < 060000
const auto max_fan_size =
lm_data_ptr->get_scanner_ptr()->get_max_num_non_arccorrected_bins();
#else
const auto max_fan_size =
lm_data_ptr->get_scanner().get_max_num_non_arccorrected_bins();
#endif
if (fan_size == -1)
fan_size = max_fan_size;
else
Expand Down
21 changes: 13 additions & 8 deletions src/xSTIR/cSTIR/stir_x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ void
ListmodeToSinograms::compute_fan_sums_(bool prompt_fansum)
{
//*********** get Scanner details
const int num_rings =
lm_data_ptr->get_scanner_ptr()->get_num_rings();
const int num_detectors_per_ring =
lm_data_ptr->get_scanner_ptr()->get_num_detectors_per_ring();

#if STIR_VERSION < 060000
const auto& scanner = *lm_data_ptr->get_scanner_ptr();
#else
const auto& scanner = lm_data_ptr->get_scanner();
#endif
const auto num_rings = scanner.get_num_rings();
const auto num_detectors_per_ring = scanner.get_num_detectors_per_ring();

//*********** Finally, do the real work

Expand All @@ -118,12 +120,11 @@ ListmodeToSinograms::compute_fan_sums_(bool prompt_fansum)
// go to the beginning of the binary data
lm_data_ptr->reset();

// TODO have to use lm_data_ptr->get_proj_data_info_sptr() once STIR PR 108 is merged
max_ring_diff_for_fansums = 60;
if (*lm_data_ptr->get_scanner_ptr() != Scanner(Scanner::Siemens_mMR))
if (scanner != Scanner(Scanner::Siemens_mMR))
{
warning("This is not mMR data. Assuming all possible ring differences are in the listmode file");
max_ring_diff_for_fansums = lm_data_ptr->get_scanner_ptr()->get_num_rings() - 1;
max_ring_diff_for_fansums = num_rings - 1;
}
unsigned int current_frame_num = 1;
{
Expand Down Expand Up @@ -447,7 +448,11 @@ PETAttenuationModel::unnormalise(STIRAcquisitionData& ad) const
BinNormalisation* norm = norm_.get();
stir::shared_ptr<DataSymmetriesForViewSegmentNumbers>
symmetries_sptr(sptr_forw_projector_->get_symmetries_used()->clone());
#if STIR_VERSION < 050000
norm->undo(*ad.data(), 0, 1, symmetries_sptr);
#else
norm->undo(*ad.data(), symmetries_sptr);
#endif
}

void
Expand Down

0 comments on commit 20f9ad5

Please sign in to comment.