Thresholding and sum part 2

This commit is contained in:
2025-01-18 20:26:35 +01:00
parent f8eaf1ad2c
commit 6758f3cc6d
2 changed files with 13 additions and 1 deletions

View File

@@ -10,7 +10,6 @@ import lmfit
from sfdata import SFDataFiles, sfdatafile, SFScanInfo
import joblib
from joblib import Memory
from . import utils
@@ -68,6 +67,7 @@ def perform_image_calculations(
roi: Optional[ROI] = None,
preview=False,
operations=["sum"],
lower_cutoff_threshold=None,
):
"""
Performs one or more calculations ("sum", "mean" or "std") for a given region of interest (roi)
@@ -112,6 +112,10 @@ def perform_image_calculations(
else:
im_ROI = im[:, roi.rows, roi.cols]
# 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)
# iterate over all operations
for op in operations:
label, func = possible_operations[op]
@@ -134,6 +138,7 @@ def sum_images(
batch_size=10,
roi: Optional[ROI] = None,
preview=False,
lower_cutoff_threshold=None,
):
"""
Sums a given region of interest (roi) for an image channel from a
@@ -157,6 +162,7 @@ def sum_images(
roi=roi,
preview=preview,
operations=["sum"],
lower_cutoff_threshold=lower_cutoff_threshold,
)

View File

@@ -11,6 +11,10 @@ JF = 'JF16T03V01'
# Jungfrau 8M detector
JF_8M = "JF17T16V01"
# JF I0 monitor and stripcell detector
JF_I0 = 'JF20T01V01'
JF_strip = 'JF05T01V01'
# PSSS
PSSS_X = 'SARFE10-PSSS059:SPECTRUM_X'
PSSS_Y = 'SARFE10-PSSS059:SPECTRUM_Y'
@@ -24,3 +28,5 @@ PBPS053_intensity = "SARFE10-PBPS053:INTENSITY"
# X-ray eye
XEYE = "SARES30-CAMS156-XE:FPICTURE"