Starshot, multiple profiles per spoke

Hi James/Pylinac users,

I’ve got a starshot image (scanned gafchromic film) that is giving me unusual results. There are multiple profiles per spoke of the star being added which I don’t think is typical (see attached analysis image). I guess this is due to the relatively wide spokes of the starshot image (compared to the demo image)? I’ve tried playing around with the various inputs to the Starshot.analyze routine without much success.

I’ll dig into this more myself at some point, but I’m wondering if anyone has encountered this before? Is there some sort of pre-processing I should be doing to an image like this?

Thanks for any help anyone can provide!

Randy Taylor


Hi Randy,

I probably won’t be of much help, but your post inspired me to test PyLinac with some of our data (also scanned gafchromic film). I analyzed ISO Starshots for gantry, couch, and collimator (for a Truebeam linac). All 3 plots have a single profile per spoke, and the ISO results correlate well with Doselab in case anyone’s interested. I played with some parameters (e.g. radius, min_peak_height in the analyze() method), but couldn’t replicate multiple profiles per spoke with our data. Note: the minimum value is 0.2 for the radius, not 0.05 as per the API.

This may be beyond your control, but I’d suggest a smaller field width. The spokes in your image are much wider than our spokes (we use a 5mm field width).



Thanks Merle! That is useful information to have. I didn’t acquire the image myself but will pass on your recommendation about field size.

Your image has higher contrast too, so maybe a background subtraction or filter of some kind can help in my case.



Without knowing much about the image I would try bumping the min_peak_height until the correct number of profiles is determined. The circular profile derived from the area inside the green ring is grounded and a small filter applied upon analysis, so I would be surprised if background subtraction helped. You can also see the profile that determines the peaks by doing the following after .analyze() is called:


If that doesn’t work send me the image and I’ll take a deep dive.

Thanks James. I figured out what the issue was. Since the spokes are so wide in this image, the default min_peak_distance ( isn’t large enough. Here’s with min_peak_distance=0.02:


and then with 0.05:


Do you have any interest in making this a parameter to the Starshot.analyze method? I can work up a PR if you want, otherwise I can recommend my client reduces the field width (probably a good idea regardless?).


I realized I replied to Randy but not here. Posting my reply for the community:

Both are good ideas =)

PR would probably be easy; just need to trickle min peak dist down through the analyze method. Technically, this should be included in the next version of pylinac. Unfortunately, the release date is TBD. If your client is okay with a git pip install then you’d be covered.

One thing that might work well is to apply an image-wide filter first. A small filter is applied to the profile, but the remaining noise seems to be too much for it. Something like this:

mystar = …
mystar.image.filter(size=0.01, kind=‘gaussian’)