diff --git a/documentation/STIR-UsersGuide.tex b/documentation/STIR-UsersGuide.tex index bc0bb6bd6..9a48b5b44 100644 --- a/documentation/STIR-UsersGuide.tex +++ b/documentation/STIR-UsersGuide.tex @@ -774,6 +774,10 @@ \subsubsection{ROOT files as output by OpenGATE} See \texttt{examples/samples/root\_headerECAT.hroot} for an example using the ECAT system. +OpenGATE energy information is recorded in MeV units into the ROOT file. +For STIR files, e.g. \texttt{.hroot} and \texttt{.hs}, should use keV units. +STIR assumes this convention and will convert this automatically. + There are some unfinished classes available on the \textit{STIR} web-site to read \textit{LMF} format files, in conjunction with the \textit{LMF} library. However, these might be obsolete diff --git a/documentation/release_4.1.htm b/documentation/release_4.1.htm index 839007761..49c0e0b2b 100644 --- a/documentation/release_4.1.htm +++ b/documentation/release_4.1.htm @@ -119,6 +119,10 @@

Minor bug fixes

Changes to GATE/root cylindrical PET geometry interpretation, see PR 569. +
  • + OpenGATE energy information is MeV. Added a method to convert between MeV to (STIR convention) keV units when + reading root files. +
  • Documentation changes

    diff --git a/src/IO/InputStreamFromROOTFileForCylindricalPET.cxx b/src/IO/InputStreamFromROOTFileForCylindricalPET.cxx index 514e07656..169818a72 100644 --- a/src/IO/InputStreamFromROOTFileForCylindricalPET.cxx +++ b/src/IO/InputStreamFromROOTFileForCylindricalPET.cxx @@ -81,10 +81,11 @@ get_next_record(CListRecordROOT& record) continue; if ( (this->eventID1 != this->eventID2) && this->exclude_randoms) continue; - if (this->energy1 < this->low_energy_window || - this->energy1 > this->up_energy_window || - this->energy2 < this->low_energy_window || - this->energy2 > this->up_energy_window) + //multiply here by 1000 to convert the list mode energy from MeV to keV + if (this->get_energy1_in_keV() < this->low_energy_window || + this->get_energy1_in_keV() > this->up_energy_window || + this->get_energy2_in_keV() < this->low_energy_window || + this->get_energy2_in_keV() > this->up_energy_window) continue; break; diff --git a/src/IO/InputStreamFromROOTFileForECATPET.cxx b/src/IO/InputStreamFromROOTFileForECATPET.cxx index 345aa77cf..0321dac1a 100644 --- a/src/IO/InputStreamFromROOTFileForECATPET.cxx +++ b/src/IO/InputStreamFromROOTFileForECATPET.cxx @@ -77,10 +77,11 @@ get_next_record(CListRecordROOT& record) continue; if ( eventID1 != eventID2 && exclude_randoms ) continue; - if (energy1 < low_energy_window || - energy1 > up_energy_window || - energy2 < low_energy_window || - energy2 > up_energy_window) + //multiply here by 1000 to convert the list mode energy from MeV to keV + if (this->get_energy1_in_keV() < low_energy_window || + this->get_energy1_in_keV() > up_energy_window || + this->get_energy2_in_keV() < low_energy_window || + this->get_energy2_in_keV() > up_energy_window) continue; break; diff --git a/src/include/stir/IO/InputStreamFromROOTFile.h b/src/include/stir/IO/InputStreamFromROOTFile.h index 87f082177..fd4ec1ace 100644 --- a/src/include/stir/IO/InputStreamFromROOTFile.h +++ b/src/include/stir/IO/InputStreamFromROOTFile.h @@ -204,6 +204,12 @@ class InputStreamFromROOTFile : public RegisteredObject< InputStreamFromROOTFile //! (here ) //! > the readout depth depends upon how the electronic readout functions. int singles_readout_depth; + + //! OpenGATE output ROOT energy information is given in MeV, these methods convert to keV + float get_energy1_in_keV() const + { return energy1 * 1e3; }; + float get_energy2_in_keV() const + { return energy2 * 1e3; }; }; END_NAMESPACE_STIR