jrkerns / pylinac

An image analysis library for medical physics
MIT License
145 stars 94 forks source link

Winston Lutz Feature Request #424

Closed seandomal closed 1 year ago

seandomal commented 1 year ago

For some Facilities, Winston Lutz is performed with the Varian Isocube were imaging actually reveals a dark bb rather than a light one. The current module cannot locate the bb for this circumstance and I would like to request an update to the thresholding algorithm so I can find the bb. This would be a great addition and very useful in the clinic. Thank you!

Specifically I'm talking about the function: _find_bb in the Winston-Lutz module.

jrkerns commented 1 year ago

Good point. I need to add an invert=True parameter to the analyze method, which should address this. Would you mind uploading a set of these images I can test. https://forms.gle/kvbwZ4Q9dfvi8BtT6

seandomal commented 1 year ago

Just uploaded the files generated for this past monthly QA using the varian isocube, this will be great to be able to address this, thank you!

seandomal commented 1 year ago

Any updates on this? @jrkerns

jrkerns commented 1 year ago

This appears to be unrelated to the inversion. There are a few issues going on here I can't fully grasp.

First, there is a significant artifact in the G270 image causing detection issues.

Figure_1

Second, there are severe pixel normalization issues that dominate the signal. E.g. some of the pixels are 2-3x the signal of the field. I suggest redoing your pixel normalization and pixel defect map if you can.

Figure_2

Again, this is with the 270 image, so maybe that image had a different setting that the others?

If you discount that image it appears to detect correctly.

Figure_3

jrkerns commented 1 year ago

Closing d/t being stale/no response

seandomal commented 1 year ago

@jrkerns I wanted to revisit this issue and provide some additional images. These images don't appear to have any weird artifact but don't seem to be found using the current thresholding in your winston lutz script test.zip

jrkerns commented 1 year ago

Got it, thanks for the dataset. I'll investigate.

seandomal commented 1 year ago

@jrkerns have you had a chance to review those images?

jrkerns commented 1 year ago

Yes. I tried using a Hough circle detection algorithm as that isn't inversion-specific. However, it didn't pan out as it wasn't precise enough. I think I may have to simply add a parameter to analyze to invert the BB detection algorithm.

jrkerns commented 1 year ago

A new parameter has been added and will be in the newest pylinac version, in this case, due around March 16th. The image below is of your image set. The bb and field are very similar so the visual difference isn't super apparent, but if you plot it, you can see the BB (barely). I will also be adding an example in the benchmark section that shows it much more clearly (third image). low density

bb profile low density simulated

seandomal commented 1 year ago

Wonderful, thank you!

jrkerns commented 1 year ago

Now in v3.9