Question Picket Fence

Hi James,

I did some checking on your pylinac program a little while ago. Unfortunately I do not have professional programming skills. Now I have started to test and adapt some modules for our purposes. However, I would like to display the deviation for each leaf pair in each picket in a table to cross-check the results with our commercial software (ArtiScan).
Is there a simple order for that? Could I possibly add a command to the results of the analysis in the code that would show me such a table?

You’re doing a great job! Keep it up!

You can definitely do that. It’s not necessarily built-in but you can make a table pretty easily with pandas. Here is a gist to get you started:

Hello James,

First, sorry about my english, it`s not so good.

I am working on some modifications in pylinac code to make it compatible with Elekta machines, starting with Picket Fence (hope you don’t mind). I don’t have much experience with python, so my code must look strange and messy for experienced programmers, but I’m trying to do my best.

I included an option at analyze function to select the MLC model (Millennium MLC, Millennium HDMLC, Agility, MLCi2 or Beam Modulator). Thinking about the same issues as our friend E.S. above and since not all leafs could be imagead at same time in Elekta’s panel, I included a variable in Picket class called leafs_idx_in_picket, that point the number of a leaf pair taking into account the panel displacement. In order to get information about each leaf pair in each picket, I also included a function get_test_pickets(self) in PicketFence class that return all picket information. With these changes, now I can get the error of all pairs of leafs on each picket with a code like the attachment.

If you want to take a look at my changes, I am uploading all my changes at, there are some images made with Elekta MLCi2, and soon I will try to upload some images with Elekta Agility and Elekta Beam Modulator. For now I am working in some tests to make sure I don’t made anything wrong and I will try make some comments in english in all my changes (there are some comments, but in portuguese).

Best regards,
William (974 Bytes)

leaf_errors.txt (1.42 KB)

picket_fence_elekta.dcm (2 MB)

Thanks for the work. I look forward to see how you progress with this.

Dear James,

Recently I tried to analyze the siemens 160MLC picket fence test with pylinac, but it just analyzed 40 leaf pairs instead of 80 pairs. Is possible to use the picket fence module for other MLCs type? such as Siemens 160MLCs?

Currently, only Varian Millenium and HD Millenium MLCs are currently supported, as specified in the documentation. However, the next release will allow users to create their own MLC configurations and will thus take any type.