question regarding passing rate calculation

19 views
Skip to first unread message

Alexander S

unread,
Jul 8, 2020, 9:45:36 AM7/8/20
to PyMedPhys
Dear all,

If I could clarify the passing rate calculation with your help, I would appreciate much.

From what I can see in the code, passing rate is defined as  (all_values <1) / (all_values). But it means that background values , i.e. values that are not included in the irradiation field, are also included in the calculation ?
So if I have a very large background, and my irradiation field is small compared with the whole picture, I would inherently have high passing rate nevertheless? Because background values always have 0 gamma ?

Sorry if my question is unclear, in that case I would try to illustrate my question with the pictures.

Thanks,

Alex

Simon Biggs

unread,
Jul 8, 2020, 6:28:08 PM7/8/20
to Alexander S, PyMedPhys
Hi Alex,

For future readers, the reference you're referring to is https://docs.pymedphys.com/howto/gamma/effect-of-noise.html

Regarding the passing rate calculation, the key is actually the following parameter:

'lower_percent_dose_cutoff': 20,

which was defined at the beginning of the notebook. This makes it so that only the values where the reference dose is larger than that percentage have their gamma calculated. All other points end up having their result set to np.nan

lower_dose_cutoff = lower_percent_dose_cutoff / 100 * global_normalisation
reference_dose_above_threshold = dose_reference >= lower_dose_cutoff
reference_points_to_calc = reference_dose_above_threshold

From:

Then, in order to calculate the passing rate, all np.nan values are filtered out using ~np.isnan(gamma):

valid_gamma_no_noise = gamma_no_noise[~np.isnan(gamma_no_noise)]
no_noise_passing = 100 * np.round(np.sum(valid_gamma_no_noise <= 1) / len(valid_gamma_no_noise), 4)

This therefore only calculates the passing rate over the range of doses where the reference dose is larger than the "lower_percent_dose_cutoff"

Cheers,
Simon


--
You received this message because you are subscribed to the Google Groups "PyMedPhys" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pymedphys+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pymedphys/6eb63ee7-b014-4e11-a8c3-125dd97ee6f9o%40googlegroups.com.

Aleksandras

unread,
Jul 9, 2020, 1:49:18 AM7/9/20
to Simon Biggs, PyMedPhys
Hi Simon,

Crystal clear, thanks!

A.

Simon Biggs

unread,
Jul 9, 2020, 1:51:51 AM7/9/20
to Aleksandras, Simon Biggs, PyMedPhys
Reply all
Reply to author
Forward
0 new messages