Skip to content

Commit 2eaacd6

Browse files
Merge pull request #1332 from KrisThielemans/remove_CListEvent_delta_time
Remove CListEvent::delta_time and get_delta_time()
2 parents a170529 + 86b3f91 commit 2eaacd6

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

src/include/stir/listmode/CListEventScannerWithDiscreteDetectors.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ CListEventScannerWithDiscreteDetectors<ProjDataInfoT>::
6060
get_LOR() const
6161
{
6262
LORAs2Points<float> lor;
63-
const bool swap = true;// this->get_delta_time() < 0.F;
63+
const bool swap = true;
6464
// provide somewhat shorter names for the 2 coordinates, taking swap into account
6565
CartesianCoordinate3D<float>& coord_1 = swap ? lor.p2() : lor.p1();
6666
CartesianCoordinate3D<float>& coord_2 = swap ? lor.p1() : lor.p2();

src/include/stir/listmode/CListRecord.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ class CListEvent : public ListEvent
5757
Succeeded
5858
set_prompt(const bool prompt = true);
5959

60-
double get_delta_time() const { return delta_time; }
61-
protected:
62-
//! The detection time difference, between the two photons.
63-
double delta_time;
64-
6560
}; /*-coincidence event*/
6661

6762
//! Class for records in a PET list mode file

src/include/stir/listmode/CListRecordGEHDF5.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,6 @@ dynamic_cast<CListRecordGEHDF5 const *>(&e2) != 0 &&
313313
//ByteOrder::swap_order(this->raw[0]);
314314
}
315315

316-
if (this->is_event())
317-
{
318-
// set TOF info in ps
319-
this->delta_time = this->event_data.get_tof_bin() *this-> get_scanner_ptr()->get_size_of_timing_pos();
320-
}
321316
return Succeeded::yes;
322317
}
323318

src/include/stir/listmode/CListRecordROOT.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ class CListEventROOT : public CListEventCylindricalScannerWithDiscreteDetectors
5151
inline bool is_prompt() const
5252
{ return true; }
5353

54-
private:
54+
double get_delta_time() const { return delta_time; }
55+
56+
private:
5557
//! First ring, in order to detector tangestial index
5658
int ring1;
5759
//! Second ring, in order to detector tangestial index
@@ -60,6 +62,8 @@ class CListEventROOT : public CListEventCylindricalScannerWithDiscreteDetectors
6062
int det1;
6163
//! Second detector, in order to detector tangestial index
6264
int det2;
65+
//! The detection time difference, between the two photons.
66+
double delta_time;
6367
#ifdef STIR_ROOT_ROTATION_AS_V4
6468
//! This is the number of detector we have to rotate in order to
6569
//! align GATE and STIR.

src/listmode_utilities/list_lm_events.cxx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ int main(int argc, char *argv[])
121121

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

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

127129
unsigned long num_listed_events = 0;
128130
{
@@ -164,8 +166,12 @@ int main(int argc, char *argv[])
164166
if (record.is_event())
165167
{
166168
recognised=true;
169+
Bin bin;
170+
record.event().get_bin(bin, *proj_data_info_sptr);
171+
167172
if (list_coincidence)
168173
{
174+
169175
if (auto event_ptr =
170176
dynamic_cast<CListEvent *>(&record.event()))
171177
{
@@ -184,8 +190,8 @@ int main(int argc, char *argv[])
184190
<< ",r:" << det_pos.pos2().axial_coord()
185191
<< ",l:" << det_pos.pos2().radial_coord()
186192
<< ")\t";
187-
cout << " TOF-bin: " << det_pos.timing_pos()
188-
<< " delta time: " << event_ptr->get_delta_time();
193+
if (list_TOF_info)
194+
cout << " TOF-bin: " << det_pos.timing_pos();
189195
listed = true;
190196
}
191197
}
@@ -201,16 +207,16 @@ int main(int argc, char *argv[])
201207
<< "," << lor.p2().y()
202208
<< "," << lor.p2().x()
203209
<< ")";
210+
if (list_TOF_info)
211+
cout << " k: " << proj_data_info_sptr->get_k(bin);
212+
listed = true;
213+
}
214+
if (list_event_bin)
215+
{
216+
cout << " bin " << bin;
204217
listed = true;
205218
}
206219
}
207-
if (list_event_bin)
208-
{
209-
Bin bin;
210-
record.event().get_bin(bin, *proj_data_info_sptr);
211-
cout << " bin " << bin;
212-
listed = true;
213-
}
214220
if (!recognised && list_unknown)
215221
{
216222
cout << "Unknown type";

0 commit comments

Comments
 (0)