STIR icon indicating copy to clipboard operation
STIR copied to clipboard

tangential position range inconsistency

Open SomayehSaghamanesh opened this issue 1 year ago • 4 comments

There are two different definitions (as below), which result in inconsistency in tangential position range. This is problematic at least in cases handling full tangential positions. In ProjDataInfo.cxx: min_tangential_pos_num = -(num_tang_poss / 2); max_tangential_pos_num = min_tangential_pos_num + num_tang_poss - 1;

In ProjDataInfoCylindricalNoArcCorr.cxx and ProjDataInfoGenericNoArcCorr.cxx : const int min_tang_pos_num = -(num_detectors / 2) + 1; const int max_tang_pos_num = -(num_detectors / 2) + num_detectors;

SomayehSaghamanesh avatar Sep 10 '24 08:09 SomayehSaghamanesh

The class inheritance is as follows image

I suggest using this https://github.com/UCL/STIR/blob/e168b074b3f7d21b4ebf8872680b4bb115022719/src/buildblock/ProjDataInfo.cxx#L123-L129 in the child classes for consistency?

Maybe worth noting, the definition of the max/min tang poss in ProjDataInfoCylindricalNoArcCorr is very old (circa 2003). Somethings may break because they were built upon this methodology.

robbietuk avatar Sep 10 '24 17:09 robbietuk

Yes, I have already followed it in PR #1508, changed two classes to be consistent with ProjDataInfo.cxx.

SomayehSaghamanesh avatar Sep 11 '24 07:09 SomayehSaghamanesh

I am sorry, I reread the full function. These values are used for slightly odd checks in initialise_uncompressed_view_tangpos_to_det1det2. I'm not sure what these https://github.com/UCL/STIR/blob/e168b074b3f7d21b4ebf8872680b4bb115022719/src/buildblock/ProjDataInfoGenericNoArcCorr.cxx#L152-L163 checks are, but since both classes' methods are a copy and paste of one another. Your fix in #1508 seems correct to me.

robbietuk avatar Sep 12 '24 20:09 robbietuk

Just not sure why 8 tests (including FBP, OSMAPOSL, etc) are failed after these changes. Haven't gone through them yet. Any comment is appreciated.

SomayehSaghamanesh avatar Sep 17 '24 10:09 SomayehSaghamanesh

I think your num_tangential_poss is too large. As discussed in https://github.com/UCL/STIR/pull/1508/files#r2517867942, the max is num_detectors_per_ring -1. As long as you use that, there is no inconsistency in the above code.

KrisThielemans avatar Nov 12 '25 11:11 KrisThielemans