diff --git a/src/cristallina/analysis.py b/src/cristallina/analysis.py index 36151ef..73422c4 100644 --- a/src/cristallina/analysis.py +++ b/src/cristallina/analysis.py @@ -68,6 +68,7 @@ def perform_image_calculations( preview=False, operations=["sum"], lower_cutoff_threshold=None, + upper_cutoff_threshold=None, ): """ Performs one or more calculations ("sum", "mean" or "std") for a given region of interest (roi) @@ -115,6 +116,8 @@ def perform_image_calculations( # use cutoff to set values to 0 below if lower_cutoff_threshold is not None: im_ROI = np.where(im_ROI < lower_cutoff_threshold, 0, im_ROI) + if upper_cutoff_threshold is not None: + im_ROI = np.where(im_ROI > upper_cutoff_threshold, 0, im_ROI) # iterate over all operations for op in operations: