Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set background_median and background_std to None when no background ROI's present #355

Merged
merged 2 commits into from
Mar 31, 2021

Conversation

randlet
Copy link
Contributor

@randlet randlet commented Mar 31, 2021

This is a potential fix for #354. Sets background_std & background_median to None when background rois aren't present.

@jrkerns jrkerns self-requested a review March 31, 2021 19:47
pylinac/ct.py Outdated
background_median = np.mean([roi.pixel_value for roi in self.background_rois.values()])
background_std = np.std([roi.pixel_value for roi in self.background_rois.values()])
if self.background_rois:
background_median = np.mean([roi.pixel_value for roi in self.background_rois.values()])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to mean per your own comment and all good

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks.

@jrkerns jrkerns merged commit dbbd790 into jrkerns:master Mar 31, 2021
@coveralls
Copy link

coveralls commented Mar 31, 2021

Coverage Status

Coverage increased (+0.05%) to 82.869% when pulling 41b72a7 on qatrackplus:fix_background_med_std_calcs into 0232234 on jrkerns:master.

jrkerns added a commit that referenced this pull request Mar 25, 2024
WL refactor pre-step

Approved-by: Randy Taylor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants