Log Analyzer

Does pylinac have a way to calculate leaf speed from the log files?

Hi Brian,

I think it does not. You will have to get if from each leaf travel distance between snapshots and then divide that by 20 ms (if TrueBeam log or 50 ms if dynalog).
Same for the dose rate. You have to calculate it from the amount of MUs delivered every 20 ms.


Thanks for the reply Rebo.

I was thinking of trying to incorporate a couple of the log analyzer functions. Get_leaves returns a list of leaves that moved and get_snap_value returns position of leaves for each snapshot.
I’ll let you know how things go when I get a chance to work on it more.

Pylinac does not include a function like that by default. However, since the leaf positions are recorded you could calculate it relatively easily. The complexity of your problem also depends on what you want. Do you want the max leaf speed of all leaves? per bank? Max speed of each leaf? Does the direction matter?

Hey James -

I saved the array of snapshots to a text file so I could see how the numbers look. I initially thought once the MLC’s reach a control point the value of the position would just be repeated for the snapshots until they start moving again. Glad I looked at the text file because it looks like once the MLC’s reach a control point they waver between values. Reading the trajectory log file specification, the snapshot arrays are float, makes sense.

As to your questions direction doesn’t matter and looking at getting an average speed of every leaf. Trying to incorporate the average leaf speed for every leaf in say a picket fence test. Get the speed at each control point and then average for every leaf. I would imagine that since the positions aren’t repeated once a control point is reached I would need to take a different approach. Maybe the difference that meets the control point criteria, like abs(A-B) < or > some number. Not entirely sure yet on the approach. any suggestions or help always appreciated.