diff --git a/documentation/release_6.0.htm b/documentation/release_6.0.htm
index 5221c5645..c44345a0b 100644
--- a/documentation/release_6.0.htm
+++ b/documentation/release_6.0.htm
@@ -121,6 +121,11 @@
General
If the radionuclide name is recognised to the STIR database, its values for half-life etc
are used, as opposed to what was recorded in the file (if anything).
+
+ list_lm_events now has an additional option --event-bin which lists the bin
+ assigned for the event (according to the "native" projection data, i.e. without any mashing).
+ In addition, the --event-LOR option now also works for SPECT (it was disabled by accident).
+
Python (and MATLAB)
diff --git a/src/listmode_utilities/list_lm_events.cxx b/src/listmode_utilities/list_lm_events.cxx
index 65802b44a..35847ff19 100644
--- a/src/listmode_utilities/list_lm_events.cxx
+++ b/src/listmode_utilities/list_lm_events.cxx
@@ -29,7 +29,7 @@
#include "stir/listmode/CListEventCylindricalScannerWithDiscreteDetectors.h"
#include "stir/Succeeded.h"
#include "stir/IO/read_from_file.h"
-
+#include "stir/stream.h"
#include "stir/Scanner.h"
#include
#include
@@ -55,6 +55,7 @@ int main(int argc, char *argv[])
bool list_time=true;
bool list_coincidence=false;
bool list_event_LOR=false;
+ bool list_event_bin=false;
bool list_gating=true;
bool list_unknown=false;
unsigned long num_events_to_list = 0;
@@ -80,6 +81,10 @@ int main(int argc, char *argv[])
{
list_event_LOR = atoi(argv[1])!=0;
}
+ else if (strcmp(argv[0], "--event-bin")==0)
+ {
+ list_event_bin = atoi(argv[1])!=0;
+ }
else if (strcmp(argv[0], "--unknown")==0)
{
list_unknown = atoi(argv[1])!=0;
@@ -99,11 +104,15 @@ int main(int argc, char *argv[])
<< "--time 0|1 : list time events or not (default: 1)\n"
<< "--gating 0|1 : list gating events or not (default: 1)\n"
<< "--coincidence 0|1 0|1): list coincidence event info or not (default: 0)\n"
- << "--event-LOR 0|1 : ((identical to --SPECT-event) list LOR end-points if coincidence/gamma event or not (default: 0)\n"
+ << "--event-LOR 0|1 : (identical to --SPECT-event) list LOR end-points if coincidence/gamma event, or not (default: 0)\n"
+ << "--event-bin 0|1 : bin coordinates if coincidence/gamma event, or not (default: 0)\n"
<< "--unknown 0|1 : list if event of unknown type encountered or not (default: 0)\n"
<< "--num-events-to-list : limit number of events written to stdout\n"
+ << "\n--event-bin uses the \"native\" projection data info associated to the\n"
+ << " list-mode file, i.e. without any mashing in views/TOF etc).\n"
<< "\nNote that for some PET scanners, coincidences are listed with crystal info.\n"
- << "For others, you should list LOR coordinates (as well) as the 'coincidence' option will only list prompt/delayed info.\n";
+ << " For others, you should list LOR coordinates or bins (as well) as the 'coincidence' option\n"
+ << " will only list prompt/delayed info.\n";
return EXIT_FAILURE;
}
@@ -111,6 +120,7 @@ int main(int argc, char *argv[])
cout << "LORs will be listed as 2 points (z1,y1,x1)-(z2,y2,x2).\n";
shared_ptr lm_data_ptr(read_from_file(argv[0]));
+ auto proj_data_info_sptr = lm_data_ptr->get_proj_data_info_sptr();
cout << "Scanner: " << lm_data_ptr->get_scanner().get_name() << endl;
@@ -181,9 +191,7 @@ int main(int argc, char *argv[])
}
if (list_event_LOR)
{
- if (auto event_ptr =
- dynamic_cast(&record.event())) // cast not necessary, but looks same as above
- if (event_ptr!=0)
+ if (auto event_ptr = &record.event())
{
LORAs2Points lor;
lor=event_ptr->get_LOR();
@@ -200,6 +208,16 @@ int main(int argc, char *argv[])
}
}
}
+ if (list_event_bin)
+ {
+ if (auto event_ptr = &record.event())
+ {
+ Bin bin;
+ event_ptr->get_bin(bin, *proj_data_info_sptr);
+ cout << " bin " << bin;
+ listed = true;
+ }
+ }
if (!recognised && list_unknown)
{
cout << "Unknown type";