diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 2f1498e5..96d34aa8 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -14,6 +14,11 @@ library but are still useful. So far, many RadMachine customers have asked for o While I disagree with adding one-off analyses to the core library, I also don't want to let the code be in secret for no good reason. +VMAT +^^^^ + +* The VMAT image identification algorithm was changed slightly to better detect FFF DRMLC/DRGS images. + CT ^^ diff --git a/pylinac/vmat.py b/pylinac/vmat.py index 90190e28..ddc5ca63 100644 --- a/pylinac/vmat.py +++ b/pylinac/vmat.py @@ -29,7 +29,7 @@ from .core.image import DicomImage, ImageLike from .core.io import TemporaryZipDirectory, get_url, retrieve_demo_file from .core.pdf import PylinacCanvas -from .core.profile import InflectionDerivativeProfile +from .core.profile import FWXMProfile from .core.utilities import ResultBase from .settings import get_dicom_cmap @@ -482,7 +482,7 @@ def _draw_segments(self, axis: plt.Axes, show_text: bool): @classmethod def _median_profiles( cls, image1: DicomImage, image2: DicomImage - ) -> list[InflectionDerivativeProfile, InflectionDerivativeProfile]: + ) -> list[FWXMProfile, FWXMProfile]: """Return two median profiles from the open and DMLC image. Only used for visual purposes. Evaluation is not based on these profiles.""" profiles = [] @@ -490,7 +490,7 @@ def _median_profiles( img = copy.deepcopy(orig_img) img.ground() img.check_inversion() - profile = InflectionDerivativeProfile( + profile = FWXMProfile( np.mean(img.array, axis=0), ground=True, normalization=Normalization.BEAM_CENTER, diff --git a/tests_basic/test_vmat.py b/tests_basic/test_vmat.py index 401342e9..38d9bee2 100644 --- a/tests_basic/test_vmat.py +++ b/tests_basic/test_vmat.py @@ -360,3 +360,35 @@ class TestDRMLCOverlapGaps(VMATMixin, TestCase): def test_fail_with_tight_tolerance(self): pass + + +class TestHalcyonDRGS(VMATMixin, TestCase): + """A Halcyon image is FFF and goes to the edge of the EPID. Causes bad inversion w/o FWXM profile type.""" + + klass = DRGS + filepaths = ("HalcyonDRGS.zip",) + is_zip = True + segment_positions = {0: Point(364, 640), 2: Point(547, 640)} + segment_values = { + 0: {"r_dev": 41.4, "r_corr": 1689.2}, + 2: {"r_dev": 28, "r_corr": 1529.5}, + } + avg_abs_r_deviation = 32.64 + max_r_deviation = 41.4 + passes = False + + +class TestHalcyonDRMLC(VMATMixin, TestCase): + """A Halcyon image is FFF and goes to the edge of the EPID. Causes bad inversion w/o FWXM profile type.""" + + klass = DRMLC + filepaths = ("HalcyonDRMLC.zip",) + is_zip = True + segment_positions = {0: Point(433, 640), 2: Point(708, 640)} + segment_values = { + 0: {"r_dev": 1.17, "r_corr": 3602}, + 2: {"r_dev": -0.206, "r_corr": 3552.8}, + } + avg_abs_r_deviation = 0.585 + max_r_deviation = 1.17 + passes = True