Skip to content

Instantiating Pylinac classes from Pydicom datasets issue #550 #555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

alanphys
Copy link
Contributor

@alanphys alanphys commented Mar 4, 2025

As proof of concept I have this working. You can do:

from pydicom import dcmread
from pylinac.core.image import DicomImageStack, DicomImage, load
from pylinac import CatPhan604
import matplotlib
matplotlib.use('TkAgg')
from pathlib import Path
import os.path as osp

test_dir = r'/home/.../TestFiles/CatPhan604/'
ds_list =[dcmread(path) for path in Path(test_dir).iterdir()]
dis = DicomImageStack(ds_list, min_number=3)
ct = CatPhan604(dis)
ct.analyze()
ct.publish_pdf(osp.join(test_dir,'result.pdf'))

or

test_dir = r'/home/.../TestFiles/CatPhan604/'
ds_list =[dcmread(path) for path in Path(test_dir).iterdir()]
ct = CatPhan604.from_dataset(ds_list)
ct.analyze()
ct.publish_pdf(osp.join(test_dir,'result.pdf'))

There is still a lot of work to be done, but at this stage I need to know that I haven't broken something upstream. The tests, such as I've been able to run, are passing, but I can only 42 of the 702 tests are running. @jrkerns, again, when you have a gap please run the test suite on this PR. I've also incorporated the commits from PR 547 and 553 in this PR.

Regards
Alan

@jrkerns
Copy link
Owner

jrkerns commented Mar 4, 2025

Tests are passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants