Skip to content

Commit

Permalink
Merge pull request #1332 from KrisThielemans/remove_CListEvent_delta_…
Browse files Browse the repository at this point in the history
…time

Remove CListEvent::delta_time and get_delta_time()
  • Loading branch information
KrisThielemans authored Jan 15, 2024
2 parents a170529 + 86b3f91 commit 2eaacd6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ CListEventScannerWithDiscreteDetectors<ProjDataInfoT>::
get_LOR() const
{
LORAs2Points<float> lor;
const bool swap = true;// this->get_delta_time() < 0.F;
const bool swap = true;
// provide somewhat shorter names for the 2 coordinates, taking swap into account
CartesianCoordinate3D<float>& coord_1 = swap ? lor.p2() : lor.p1();
CartesianCoordinate3D<float>& coord_2 = swap ? lor.p1() : lor.p2();
Expand Down
5 changes: 0 additions & 5 deletions src/include/stir/listmode/CListRecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ class CListEvent : public ListEvent
Succeeded
set_prompt(const bool prompt = true);

double get_delta_time() const { return delta_time; }
protected:
//! The detection time difference, between the two photons.
double delta_time;

}; /*-coincidence event*/

//! Class for records in a PET list mode file
Expand Down
5 changes: 0 additions & 5 deletions src/include/stir/listmode/CListRecordGEHDF5.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,6 @@ dynamic_cast<CListRecordGEHDF5 const *>(&e2) != 0 &&
//ByteOrder::swap_order(this->raw[0]);
}

if (this->is_event())
{
// set TOF info in ps
this->delta_time = this->event_data.get_tof_bin() *this-> get_scanner_ptr()->get_size_of_timing_pos();
}
return Succeeded::yes;
}

Expand Down
6 changes: 5 additions & 1 deletion src/include/stir/listmode/CListRecordROOT.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ class CListEventROOT : public CListEventCylindricalScannerWithDiscreteDetectors
inline bool is_prompt() const
{ return true; }

private:
double get_delta_time() const { return delta_time; }

private:
//! First ring, in order to detector tangestial index
int ring1;
//! Second ring, in order to detector tangestial index
Expand All @@ -60,6 +62,8 @@ class CListEventROOT : public CListEventCylindricalScannerWithDiscreteDetectors
int det1;
//! Second detector, in order to detector tangestial index
int det2;
//! The detection time difference, between the two photons.
double delta_time;
#ifdef STIR_ROOT_ROTATION_AS_V4
//! This is the number of detector we have to rotate in order to
//! align GATE and STIR.
Expand Down
26 changes: 16 additions & 10 deletions src/listmode_utilities/list_lm_events.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ int main(int argc, char *argv[])

shared_ptr<ListModeData> lm_data_ptr(read_from_file<ListModeData>(argv[0]));
auto proj_data_info_sptr = lm_data_ptr->get_proj_data_info_sptr();
auto scanner = lm_data_ptr->get_scanner();
const bool list_TOF_info = scanner.is_tof_ready();

cout << "Scanner: " << lm_data_ptr->get_scanner().get_name() << endl;
cout << "Scanner: " << scanner.get_name() << endl;

unsigned long num_listed_events = 0;
{
Expand Down Expand Up @@ -164,8 +166,12 @@ int main(int argc, char *argv[])
if (record.is_event())
{
recognised=true;
Bin bin;
record.event().get_bin(bin, *proj_data_info_sptr);

if (list_coincidence)
{

if (auto event_ptr =
dynamic_cast<CListEvent *>(&record.event()))
{
Expand All @@ -184,8 +190,8 @@ int main(int argc, char *argv[])
<< ",r:" << det_pos.pos2().axial_coord()
<< ",l:" << det_pos.pos2().radial_coord()
<< ")\t";
cout << " TOF-bin: " << det_pos.timing_pos()
<< " delta time: " << event_ptr->get_delta_time();
if (list_TOF_info)
cout << " TOF-bin: " << det_pos.timing_pos();
listed = true;
}
}
Expand All @@ -201,16 +207,16 @@ int main(int argc, char *argv[])
<< "," << lor.p2().y()
<< "," << lor.p2().x()
<< ")";
if (list_TOF_info)
cout << " k: " << proj_data_info_sptr->get_k(bin);
listed = true;
}
if (list_event_bin)
{
cout << " bin " << bin;
listed = true;
}
}
if (list_event_bin)
{
Bin bin;
record.event().get_bin(bin, *proj_data_info_sptr);
cout << " bin " << bin;
listed = true;
}
if (!recognised && list_unknown)
{
cout << "Unknown type";
Expand Down

0 comments on commit 2eaacd6

Please sign in to comment.