Skip to content
Open
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
16 changes: 14 additions & 2 deletions documentation/release_6.0.htm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,16 @@ <h2>Patch release info</h2>
<h2> Summary for end users (also to be read by developers)</h2>

<h3>Changes breaking backwards compatibility from a user-perspective</h3>
<ul>
<ul>
<li>
When using ECAT7, ECAT8, GEHDF5 or SPECT normalisation, it will
now take the branching ratio of the radionuclide into account, if the radionuclide
for the data is known (you can check with <tt>list_projdata_info</tt> and <tt>list_lm_info</tt>.
For instance, for F-18 this will make reconstructed images 1/0.9686 larger, but
the factor is larger for other radionuclides, certainly in SPECT.
<br>
This was actually already supposed to be the case in previous version, but a bug disabled it.
</li>
<li>
When parsing Interfile headers for projection data and the <tt>originating system</tt>
is not recognised, the previous version of STIR tried to guess the scanner based on the
Expand Down Expand Up @@ -241,9 +250,12 @@ <h3>Backward incompatibities</h3>
<code>virtual ListModeData::get_scanner_ptr()</code> is replaced by <code>ListModeData::get_scanner()</code>.
</li>
<li>
<code>ProjDataInfo*NoArcCorr::get_bin_for_det_pair</code> is now private.
<code>ProjDataInfo*NoArcCorr::get_bin_for_det_pair</code> is now private.
Use <code>get_bin_for_det_pos_pair</code> instead.
</li>
<li><code>BinNormalisatoonWithCalibration::get/set_branching_ratio</code> members have
been removed, as they shouldn't really be part of the normalisation object.
</li>
</ul>

<h3>New functionality</h3>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
//
/*
Copyright (C) 2020-2021, University College London
Copyright (C) 2020-2021, 2024, University College London
Copyright (C) 2020, National Physical Laboratory
This file is part of STIR.

Expand Down Expand Up @@ -34,11 +34,16 @@ START_NAMESPACE_STIR

/*!
\ingroup normalisation
This class provides the facility to use a calibration factor and (isotope) branching ratio when normalising data.
This class provides the facility to use a calibration factor and (isotope) branching ratio when normalising data.
Therefore, if they are set correctly, the reconstructed image will be calibrated as well.

Note that it is the responsibility of the derived classes to set the calibration factor.
The branching ratio is obtained from the radionuclide set in \c ExamInfo (passed by set_up()).

Efficiency is computed as
<pre>
calibration_factor * branching_ratio * uncalibrated_efficiency
</pre>
*/
class BinNormalisationWithCalibration :
public BinNormalisation
Expand All @@ -55,10 +60,8 @@ class BinNormalisationWithCalibration :
//! product of calibration factor etc
float get_calib_decay_branching_ratio_factor(const Bin&) const; // TODO find a better name
float get_calibration_factor() const override;
float get_branching_ratio() const;

void set_calibration_factor(const float);
void set_radionuclide(const Radionuclide&);

// needs to be implemented by derived class
virtual float get_uncalibrated_bin_efficiency(const Bin&) const = 0;
Expand All @@ -81,7 +84,6 @@ class BinNormalisationWithCalibration :
// need to be added to the parsing keywords
// bool use_calibration_factor; // default to true
float calibration_factor;
Radionuclide radionuclide;
//! product of various factors
/*! computed by set_up() */
float _calib_decay_branching_ratio;
Expand Down
38 changes: 13 additions & 25 deletions src/recon_buildblock/BinNormalisationWithCalibration.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

#include "stir/recon_buildblock/BinNormalisationWithCalibration.h"
#include "stir/Succeeded.h"
#include "stir/ExamInfo.h"
#include "stir/Radionuclide.h"
#include "stir/warning.h"
#include "stir/error.h"

Expand All @@ -39,9 +41,8 @@ void
BinNormalisationWithCalibration::
initialise_keymap()
{
base_type::initialise_keymap();/*
this->parser.add_key("calibration_factor", &this->calibration_factor);
this->parser.add_key("branching_ratio", &this->branching_ratio);*/
base_type::initialise_keymap();
// this->parser.add_key("calibration_factor", &this->calibration_factor);
}

bool
Expand All @@ -65,7 +66,15 @@ BinNormalisationWithCalibration::set_up(const shared_ptr<const ExamInfo>& exam_i
if (this->calibration_factor == 1.F)
warning("BinNormalisationWithCalibration:: calibration factor not set. I will use 1, but your data will not be calibrated.");

this->_calib_decay_branching_ratio = this->calibration_factor* this->get_branching_ratio(); //TODO: multiply by decay

float branching_ratio = exam_info_sptr->get_radionuclide().get_branching_ratio(false); // get value without check
if (branching_ratio <= 0.F)
{
warning("BinNormalisationWithCalibration: radionuclide branching_ratio not known. I will use 1.");
branching_ratio = 1.F;
}

this->_calib_decay_branching_ratio = this->calibration_factor * branching_ratio; //TODO: multiply by decay
return base_type::set_up(exam_info_sptr, proj_data_info_sptr);
}

Expand Down Expand Up @@ -93,25 +102,4 @@ set_calibration_factor(const float calib)
this->calibration_factor=calib;
}

float
BinNormalisationWithCalibration::
get_branching_ratio() const
{
float branching_ratio = this->radionuclide.get_branching_ratio(false); // get value without check
if (branching_ratio <=0)
{
warning("BinNormalisationWithCalibration: radionuclide branching_ratio not known. I will use 1.");
return 1.F;
}
return branching_ratio;
}


void
BinNormalisationWithCalibration::
set_radionuclide(const Radionuclide &rnuclide){
this->radionuclide=rnuclide;
}


END_NAMESPACE_STIR