pyplati / platipy

Processing Library and Analysis Toolkit for Medical Imaging in Python
https://pyplati.github.io/platipy/
Apache License 2.0
103 stars 24 forks source link

Contours displayed are slightly off compared to original mask #147

Closed NBarryMedPhys closed 1 year ago

NBarryMedPhys commented 2 years ago

When a contour is generated from a SimpleITK image mask it seems to be slightly off when visually inspected.

Some examples are shown below with the example data provided with PlatiPy. I have used add_scalar_overlay to quickly display the corresponding mask.

Thanks! Nathaniel

plati pltip2 plat3

rnfinnegan commented 1 year ago

Thanks for raising this issue @NBarryMedPhys!

It was a result of matplotlib default behaviour - although honestly I can't be sure of the exact cause.

I have found a solution by specifying the extent of the contour and image, which seems to work. See plots below.

Some additional testing is required, but we will keep this issue open until the fix is merged through in a new release.

Cheers, Rob

Original behaviour: image

New behaviour: image

NBarryMedPhys commented 1 year ago

Big thanks for looking into this issue, it's much appreciated!

pchlap commented 1 year ago

Hi @NBarryMedPhys, with the release of platipy 0.5.0 this issue should be resolved. I'll close this for now but please let us know if you notice this issue after upgrading. Thanks a lot for the bug report!