jrkerns / pylinac

An image analysis library for medical physics
https://pylinac.readthedocs.io/en/latest/
MIT License
153 stars 98 forks source link

Leeds TOR incorrectly Phantom Angle When Phantom ~0deg #325

Closed randlet closed 3 years ago

randlet commented 3 years ago

Describe the bug When a Leeds phantom is imaged at roughly 0 deg Pylinac incorrectly determines the phantom angle to be ~350deg.

To Reproduce Run Leeds Tor analysis (with invert=True) on attached image.

Expected behavior

Angle should be detected as 0deg.

Screenshots

The issue is due to the way the circular profile looks when the phantom is at ~0deg. In this case the peak from the lead square gets split between the left and right half of the profile like this:

leeds-at-zero

A second problem is that the LeedsTOR._is_counterclockwise() function doesn't always work correctly if the roll here produces detected peaks like this:

leeds-peak-roll

A more robust method is to roll by the FWXM idx.

PR Incoming!

randlet commented 3 years ago

Example file. (txt added to file name so GitHub lets me upload it). kv-tor18fg-dynrange.dcm.txt

jrkerns commented 3 years ago

Thanks. Looks like this phantom also must be force-inverted due to the closed blades. I guess I never added an open-blade restriction in the docs. I should add that.

randlet commented 3 years ago

Yes, needs to be inverted (as mentioned in the OP!).

jrkerns commented 3 years ago

Yes, needs to be inverted (as mentioned in the OP!).

You know I don't read issues 🤨