From a49977e35d1a0f83b5b1e5b82a66c94a2164eb34 Mon Sep 17 00:00:00 2001 From: Egor Sobolev <egor.sobolev@xfel.eu> Date: Thu, 22 Aug 2024 13:03:33 +0200 Subject: [PATCH] Use sigma in mm in gaussian threshold to avoid dependence on pixel size --- src/geomtools/powder/powder.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/geomtools/powder/powder.py b/src/geomtools/powder/powder.py index af7cb67..824ae79 100644 --- a/src/geomtools/powder/powder.py +++ b/src/geomtools/powder/powder.py @@ -9,7 +9,7 @@ from .refine import fit_rings, refine_clen class PowderDiffraction: def __init__(self, geom, peaks, clen, wave_length, - min_area=30, sigma=7, snr=1, border_mask=None, + min_area=30, sigma=1.8, snr=1, border_mask=None, make_shadow_mask=True): self.geom = geom self.peaks = peaks @@ -34,8 +34,9 @@ class PowderDiffraction: threshold = threshold[slice_thr] self.shadow = make_shadow_mask(img, ~mask, threshold) + sig = self.sigma * 1e-3 / self.geom.pixel_size fg = threshold_gaussian( - self.geom, img, mask, self.shadow, self.sigma, self.snr) + self.geom, img, mask, self.shadow, sig, self.snr) fg = fg & self.border_mask -- GitLab