Skip to content

Commit

Permalink
Merged in bugfix/RAM-3360_vmat_halcyon (pull request #350)
Browse files Browse the repository at this point in the history
RAM-3360 Use FWXM instead of derivative to better detect FFF beams for VMAT

Approved-by: Randy Taylor
  • Loading branch information
jrkerns committed Mar 7, 2024
2 parents 661a5da + 6e3c3a6 commit e836a36
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^

Expand Down
6 changes: 3 additions & 3 deletions pylinac/vmat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -482,15 +482,15 @@ 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 = []
for orig_img in (image1, image2):
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,
Expand Down
32 changes: 32 additions & 0 deletions tests_basic/test_vmat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e836a36

Please sign in to comment.