jrkerns / pylinac

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

ACR Phantoms publish_pdf logo error #500

Open djp82645 opened 1 week ago

djp82645 commented 1 week ago

image If there is no local network, an error is reported if the local logo address is used can change it? self._logo = logo if logo else get_logo()

jrkerns commented 1 week ago

It's looking for the file locally first, so the easiest solution would be to download the image from here: https://github.com/jrkerns/pylinac/blob/master/pylinac/core/pdf.py#L28 and place it here: https://github.com/jrkerns/pylinac/blob/master/pylinac/core/pdf.py#L23. If you can change the source code you could also add a print statement in that function to see exactly where it's looking (it's in your site-packages of your environment).

print(f"Looking for logo file at {Path(__file__).parent.parent / 'files'}")
logo_file = Path(__file__).parent.parent / "files" / "Pylinac-GREEN.png"

If you can't edit your environment you can also download the logo or use your own and pass it directly:

instance.publish_pdf(..., logo=Path("my_awesome_logo.png"))