I have a picket fence dataset from one of my colleagues, and i am trying to apply the picket fence module. We use the 120M MLC from varian, hence have 60 leafpairs in total.
When i run my script it does not register all the leafpairs. i have tried to document the problem to the best of my ability.
My code reports measuring mlc_num=56,2 leafparis per picket. From the subplot in the PDF i see that i am missing 4 leafpairs (i count 56 in total), though some measurements could be zero or at least close to zero since i can’t see them on the plot.
Do i miss anything? Any ideas as to why it misses some leafpairs?
This could be an issue with the pixel range. Sadly, sometimes the pixel range of the images is ridiculously narrow. Try normalizing your image so that the value range is 0-1:
mypf = PicketFence(…)
mypf.image.ground() ← brings lowest value to 0
mypf.image.normalize() ← brings max value to 1
mypf.analyze(…)
…
The problem seems to be persistant even when trying different combinations of filters, cropping the image and what not. Could it be something due to our calibration of the EPID?
i have tried to plot a image like shown for the check of the streak artifacts in the EPID image, though i have troubles fedging the right information. Can you help with that?
Thanks for everything.
fredag den 22. januar 2021 kl. 03.02.50 UTC+1 skrev jker...@gmail.com:
I have discussed the matter with one of my colleagues. It seems to be mostly situated at the first and last leaf. Since we collimate the field with the jaws there is a penumbra effect at the last leafs hence they are harder to detect than those not in the penumbra region. Because of this we are satisfied with only detecting 58 leafpairs, wich was achievable by your advice.
We were not satisfied with the MyVarian PF beause it collimates down to a 10 cm by 10 cm field with the jaws. Thus, we miss the large MLC leafs in the PF test with our Varian 120M MLC. This has been fixed in our department, though i had the urge to inform people about this.
I have a seperate question, is there a way to extend the ROIs in the VMAT module for both DRGS and DRMLC in order to include all MLCs and changing the analysis orientation to be transverse to the gantry?
onsdag den 3. februar 2021 kl. 10.13.35 UTC+1 skrev Christian Storgaard:
Re: leaf pairs. The picket fence module is being worked on in this upcoming release to handle arbitrary MLCs. As a side effect, handling those leaves at the very end was something I had to deal with. The upcoming release will have a parameter to threshold these edge leaves so you can include or exclude them from the calculation. Stay tuned.
Re: VMAT. Currently, the values are buried. You can override them with the following. However, this is a good feature request and I’ll add it to the list so the user can pass in a size to the analyze method.
That sounds excellent! In conjunction to extending the ROIs, it is only really helpfull if there is an easy way to change the DRGS and DRMLC analysis orientation to be rotated 90 degr. in relation to current orientation (easy/intermediate for me atleast, my pyhton skills are only rudimentary). This is since the EPID image, if included all MLCs, is best to have segments transvers to the gantry in order to have the best image. Currently the analysis only supports images segments parallel to the gantry.
I have a followup on this request, and my other question in the forum. i can’t seem to get import of Image from pylinac.core.image to work. A user suggested using pillow, however i can’t seem to get it to work. I want to rotate the DRGS open and DMLC image by 90 degr. in order to get the analysis to work. My current .py is
from pylinac import DRGS, DRMLC
from urllib.request import urlretrieve
import matplotlib.pyplot as plt
import numpy as np
Your snippet above is performing operations on the string, not the image. This also wouldn’t change the analysis ROIs, just your images. This isn’t something pylinac supports currently, but you could manually override the segment center position calculation method: pylinac/vmat.py at master · jrkerns/pylinac · GitHub This would look something like this:
from pylinac.core.geometry import Point
from pylinac.vmat import DRGS
class MyDRGS(DRGS):
def _calculate_segment_centers(self):
either manually or algorithmically determine the segment center positions
Unrelated, but if you want to use generic images it’s easiest to use the pylinac.core.image.load function which takes a file path and loads the image. Pillow is for “normal” images like TIFF, JPG. Pylinac uses PyDicom under the hood for most kinds of images.
This worked great! I tried to change the orientation of the median profiles by changing axis=0 in
def _median_profiles(images) → Tuple[SingleProfile, SingleProfile]:
“”“Return two median profiles from the open and dmlc image. For visual comparison.”“”
profile1 = SingleProfile(np.mean(images[0], axis=0))
profile1.stretch()
profile2 = SingleProfile(np.mean(images[1], axis=0))
profile2.stretch()
to axis=1, however it did not do as i expected.
I can live with that, the data from the analysis seems to be consistent.
Thanks for the support, it is much appriciated.
tirsdag den 9. februar 2021 kl. 14.49.18 UTC+1 skrev jker...@gmail.com: