jrkerns / pylinac

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

_plot_analyzed_subimage method returns an empty pyplot #406

Open bearner-hca opened 3 years ago

bearner-hca commented 3 years ago

Describe the bug The _plot_analyzed_subimage method returns an empty pyplot instead of the requested subimage. (Same error for _save_analyzed_subimage which uses _plot_analyzed_subimage ).

To Reproduce

pip install pylinac==3.0
import pylinac
drgs = pylinac.DRGS(image_paths=("rtimage_open.dcm","rtimage_drgs.dcm"))
drgs.analyze()

#Group image correct
drgs.plot_analyzed_image()

#Subimage empty
drgs._plot_analyzed_subimage(subimage="profile")

Screenshots download download (1)

Expected behavior Pyplot of the requested subimage. This method was working in version 2.3.2 download (2)

samaraprass commented 2 years ago

Hi! I'm not sure if you still need help with this, but i went through the same issue. First, you need to import ImageType from vmat module. Then, you need to specify the subimage. Using your code, should look like this:

import pylinac
from pylinac.vmat import ImageType
drgs = pylinac.DRGS(image_paths=("rtimage_open.dcm","rtimage_drgs.dcm"))
drgs.analyze()

#Group image correct
drgs.plot_analyzed_image()

#Subimage
drgs._plot_analyzed_subimage(ImageType.PROFILE)

This is currently working for me.