penumbra function


My name’s Lionel and I’m Biomedical Technician in a Radiation Therapy Dpt of University Hospital of Nimes in South of France.
I’m new user of pylinac and I’m very interresting by the flatsym module. I wanna know if it’s possible to add a penumbra function in this module ???

Best Regards


Hello Lionel,
The flatsym module has not gotten much love lately due to not that many people using it. It’s due for a rewrite. Anyway, such functionality exists, but it’s not as easy as a simple method. I can give you a starting point though. See this gist and adapt it as you need.

Hello James

Thank You for your response.
So I wanna know still a lot of things about this module.
When I load a dicom image and than I analyse it, which method of calcul is using by default ? Varian or others manufacturers ?
Because my accelerators are only Varian.
And when you have made this module, how do you have compare your results ? with a 2d fantom, or with a big water fantom like IBA ??
What I want really understand is, when you compare a simple dicom image for example 20x20cm with a epid without buildup with a profile with a big water fantom where you place your diode to 5cm of depth, you cannot have the same results ??

Best regards

What you’re asking about comparisons is beyond the scope of pylinac. It’s your responsibility to make your EPID or film measurements equivalent to water tank measurements or whatever you plan on using as a reference.
As stated clearly in the documentation pylinac has multiple analysis options. As the physicist you choose what is a valid setup or comparison.

I gonna try to explain what I do exactly. Each months on my machines, I check my photons profiles with a matrix of IBA. The profiles are verified on a 20x20 cm field. On the matrix, I place a build up plate who is 5cm equivalent.
Each month, the symmetry are very stable on each machine. And my purpose is to follow the photons symmetry of my truebeams each week. To do that, I have two free solutions, the first is an other software IQWorks where I have found a template to check the symmetry, This template is for non clinical use, but I try it and the variation that I find on the matrix of iba is the sema with the IQworks template but the percentage of symmetry is not the same that the IBA matrix. Also the way to find the symmetry on this template is a little bit mysterious.
The second solution is finally to use pylinac with the module flatsym. Here also I find the same variation of the matrix of IBA. But for me, the purpose is to check a 20x20cm Field in HiX and LoX , and to see “just” the variation of the symmetry, with the epid I don’t place a build up plate, so is really useful to compare with a water tank.

I hope that you will understand what I try to explain.


Hello James

I wish you an happy new year.
I come back to you because I’ve got still a lot of question about the symmetry module.
I wanna know which Imaging mode that you use to know the symmetry, Integrated ?? or another mode ??
How much Monitor Units you put for an Image ??
In the case of the dose is increasing, you calibrate the mode. But if you calibrate the mode and that you do an image then the symmetry will gonna change.
How do you do in this case??


I’ve never used a truly calibrated EPID to do flatness & symmetry, as in dose-calibrated. I perform dark/flood fields on a regular basis however. Whether or not this helps I’m not sure. I do use the integrated mode when taking images and will deliver 100MU. You could easily get away with 5 or 10, but I use 100MU for everything, so that’s just my thing. Flatness/sym shouldn’t change with dose but I believe the first few MU it is still stabilizing, thus more is better.

Did I answer your questions?

Using the EPID for flatness and symmetry should always be verified using another tool first (e.g. the Profiler). That way you can link the F&S from your current method to the EPID.

Hi James
So I update this post because I have still a question about this module. On some software it's possible to "smooth" some profiles. Like this the results of the profiles are better. I don t Know if it's possible to do that with pylinac.

Sorry for the late reply Lionel. If your profile is 1D you can use the SingleProfile method filter. Looks like the API documentation stalled on readthedocs. I’ll try to get that back up but an example would look like this:

from pylinac import profile my1ddata = np.array(...) myprof = profile.SingleProfile(my1ddata) myprof.filter(5, 'gaussian') <----

It’s definitely worth looking through the profile module because there are many methods for smoothing, normalizing, etc.

Let me know if you have any more issues!