jrkerns / pylinac

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

publish_pdf (from field analysis) does not show my logo #451

Closed LuisOlivaresJ closed 1 year ago

LuisOlivaresJ commented 1 year ago

Describe the bug When I call publish_pdf, my logo is not showed in the PDF report, instead the default pylinac logo is used.

To Reproduce

from pylinac import FieldAnalysis

my_file = "RI.dcm"
my_img = FieldAnalysis(path = my_file)
my_img.analyze()

my_img.publish_pdf(filename = "flatsym.pdf", logo = "Icon.png")

Expected behavior A PDF report with my logo from the file "Icon.png"

Proposed solution I think the problem is here: https://github.com/jrkerns/pylinac/blob/5894520e90d45d74a1a1d184eeed0121a2238afd/pylinac/field_analysis.py#L973-L978

The parameter logo is not used inside pdf.PylinacCanvas function. Add a new line at line 978, in field_analysis.py:

logo = logo

I'll try to make a pull request for this.