One-Offs

Over time, many people have asked for analyses or changes that are not part of the core library. The philosophy of pylinac has always been to provide modules that match widely-used phantoms and protocols. That hasn’t changed. However, there are many one-off analyses that might be useful to a small subset of users. This has occurred several times with RadMachine users. The code is useful enough that it should be shared, but not useful enough to be included in the core library. Thus, the contrib module.

Warning

This module might not be tested. It is not guaranteed to work. It may break in future versions. I (James) cannot guarantee support for it. It does not have comprehensive documentation. It is provided as-is.

Quasar eQA

Use Case

The customer has a special light/rad phantom with disk jigs that are set at the edge of the light field corners. The BBs are offset by 11 mm from the corners. There is also a set of BBs in the center of the field used for scaling.

The field sizes used by the clinic are 6x6 and 18x18cm. The customer wants to use the center BBs for scaling and the corner BBs for the light field.

Example image:

_images/quasar.png

Usage

from pylinac.contrib.quasar import QuasarLightRadScaling

path = r"C:\path\to\image.dcm"
q = QuasarLightRadScaling(path)
q.analyze()
q.plot_analyzed_image()
print(q.results())
class pylinac.contrib.quasar.QuasarLightRadScaling(filepath: str | BinaryIO | Path, normalize: bool = True, image_kwargs: dict | None = None)[source]

Bases: StandardImagingFC2

A light/rad and also scaling analysis for the Quasar phantom. The user also uses custom edge blocks with offset BBs to detect the light corners. It’s a mix of scaling validation and light/rad.

Parameters

filepathstr

Path to the image file.

normalize: bool

Whether to “ground” and normalize the image. This can affect contrast measurements, but for backwards compatibility this is True. You may want to set this to False if trying to compare with other software.

image_kwargsdict

Keywords passed to the image load function; this would include things like DPI or SID if applicable

analyze(invert: bool = False, fwxm: int = 50, bb_edge_threshold_mm: float = 10) None[source]

Analyze the image for the light/rad and scaling

Jaw Orthogonality

Use Case

French sites desired a way to test the jaw orthogonality of their linacs. This uses a standard open field.

Usage

from pylinac.contrib.orthogonality import JawOrthogonality

p = r"C:\path\to\image.dcm"
j = JawOrthogonality(p)
j.analyze()
print(j.results())
j.plot_analyzed_image()

Which will produce an image like so:

_images/orthogonality.png
class pylinac.contrib.orthogonality.JawOrthogonality(path: str | Path)[source]

Bases: object

Determine the orthogonality of the jaws of a radiation field. Assumes a square field at a cardinal angle.

Parameters

pathstr

The path to the image.

analyze()[source]

Analyze the image for jaw orthogonality.

results() dict[str, float][source]

Return a dict of the results. Keys are ‘top_left’, ‘top_right’, ‘bottom_left’, ‘bottom_right’.

plot_analyzed_image(show: bool = True)[source]

Plot the image with the lines drawn. The lines are the detected jaw edges.