Skip to content

Commit

Permalink
fix TOF swap in find_cartesian_coordinates_given_scanner_coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisThielemans committed Dec 31, 2023
1 parent 12e0fff commit 52808c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/buildblock/ProjDataInfoCylindricalNoArcCorr.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ find_cartesian_coordinates_given_scanner_coordinates (CartesianCoordinate3D<floa
get_scanner_ptr()->get_num_detectors_per_ring();

int d1, d2, r1, r2;
int tpos = timing_pos_num;

this->initialise_det1det2_to_uncompressed_view_tangpos_if_not_done_yet();

Expand All @@ -510,6 +511,7 @@ find_cartesian_coordinates_given_scanner_coordinates (CartesianCoordinate3D<floa
d2 = det1;
r1 = Ring_B;
r2 = Ring_A;
tpos *= -1;
}
else
{
Expand Down Expand Up @@ -547,7 +549,7 @@ find_cartesian_coordinates_given_scanner_coordinates (CartesianCoordinate3D<floa
coord_2 = lor.p2();

#endif
if (timing_pos_num < 0)
if (tpos < 0)
std::swap(coord_1, coord_2);
}

Expand Down
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 = this->get_delta_time() < 0.F;
const bool swap = true;// this->get_delta_time() < 0.F;
// 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

0 comments on commit 52808c3

Please sign in to comment.