Winston Lutz Wobble Couch Axis with Gantry fixed at 180

So I like in the demo the WL module outputs wobble about the 3 axis.
But when I run my sample set it only shows Gantry Wobble.
Wondering if this is from my sample set as it only rotates about the couch axis with gantry at 180.

Specifically: my sample is 8 images:
4 about Gantry axis with table (P=0, B=0, G varies)
and 4 about Table axis with Gantry at 180 (G=180, B=0, P varies)

So I tried changing variable_axis method with the variable G0 in winston_lutz.py, but didn’t work. Any ideas?

Modified Line to include 180
G0 = is_close(self.gantry_angle, [0, 180, 360])

from
winston_lutz.py:

def variable_axis(self):
“”"The axis that is varying.

There are five types of images:

  • Reference : All axes are at 0.
  • Gantry: All axes but gantry at 0.
  • Collimator : All axes but collimator at 0.
  • Couch : All axes but couch at 0.
  • Combo : More than one axis is not at 0.
    “”"
    G0 = is_close(self.gantry_angle, [0, 360])
    B0 = is_close(self.collimator_angle, [0, 360])
    P0 = is_close(self.couch_angle, [0, 360])
    if G0 and B0 and not P0:
    return COUCH
    elif G0 and P0 and not B0:
    return COLLIMATOR
    elif P0 and B0 and not G0:
    return GANTRY
    elif P0 and B0 and G0:
    return REFERENCE
    else:
    return COMBO

The first big question is what linac you’re using. If you’re using Varian, something is wrong, this is a bug. If it’s Elekta: Elekta omits critical DICOM tags; in this case the table tag, which may be why it only thinks there are gantry images.

Either way, forcing the axis values via file names would at least get you somewhere: Winston-Lutz — pylinac 3.0.0 documentation. Let us know either way.

Varian Edge :slight_smile:

I could be smart and just move the couch around with Gantry at 0.
But we do the following:
Gantry 90, 0, 270, 180 (or I guess technically 180E?)
Then with Gantry at 180, I start rotating the couch to selected kicks.

pylinac correctly reads the angles correctly from the dicom info.

Will try the file naming way (or just change my WL flow)

Found my mistake from my first post: was modifying the wrong directory file.
My actual source code was located here: C:\ProgramData\Anaconda3\Lib\site-packages\pylinac

and made sure my precompiled py code (in subfolder pycache) was updating .

So I modified the code line in yellow below: 0, 360 replaced by 180.
BTW, the comments are very good - making the change easy for a low experience programmer such as myself.

In Summary, my WL setup is slightly different than the typical one and for others, I guess we could generalize this and pass in a selected reference axis, if we wanted to.
The default one is more typically set Gantry to 0 (G0) and Collimator to 0 (B0), vary couch (not P0) to produce the couch wobble graphs.
But in my case “G0” needed to be set to 180 degrees.
I’m guessing the best time to pass this in is at the “Winston Lutz” module initilization with default values.
I’m a complete newbie in programming. I could try my hand at proposing this modification in the other area.
Note: this does change my reference position from G0,B0,P0 to G180,B0,P0, but I’m fine with this.

def variable_axis(self):
“”"The axis that is varying.

There are five types of images:

  • Reference : All axes are at 0.
  • Gantry: All axes but gantry at 0.
  • Collimator : All axes but collimator at 0.
  • Couch : All axes but couch at 0.
  • Combo : More than one axis is not at 0.
    “”"
    G0 = is_close(self.gantry_angle, 180)
    B0 = is_close(self.collimator_angle, [0, 360])
    P0 = is_close(self.couch_angle, [0, 360])
    if G0 and B0 and not P0:
    return COUCH
    elif G0 and P0 and not B0:
    return COLLIMATOR
    elif P0 and B0 and not G0:
    return GANTRY
    elif P0 and B0 and G0:
    return REFERENCE
    else:
    return COMBO

Hi James,
Sounds like you got what you needed. It may be possible to pass in a reference gantry angle for the collimator and couch, but this could get tricky when it comes to calculating iso position. If it’s just for iso size determination that would likely be possible. However, it’s unclear to me right now how many people do a couch rotation at G=180. If a good chunk does then I’ll add it to the queue.