@@ -335,6 +335,9 @@ def spatially_constrained_layer1(
335335 def postproc (
336336 self : SCCNN ,
337337 block : np .ndarray ,
338+ min_distance : int | None = None ,
339+ threshold_abs : float | None = None ,
340+ threshold_rel : float | None = None ,
338341 block_info : dict | None = None ,
339342 depth_h : int = 0 ,
340343 depth_w : int = 0 ,
@@ -347,21 +350,38 @@ def postproc(
347350 Returns same spatial shape as the input block
348351
349352 Args:
350- block: NumPy array (H, W, C).
351- block_info: Dask block info dict. Only used when called inside
353+ block (np.ndarray):
354+ shape (H, W, C).
355+ min_distance (int | None):
356+ The minimal allowed distance separating peaks.
357+ threshold_abs (float | None):
358+ Minimum intensity of peaks.
359+ threshold_rel (float | None):
360+ Minimum intensity of peaks.
361+ block_info (dict | None):
362+ Dask block info dict. Only used when called from
352363 dask.array.map_overlap.
353- depth_h: Halo size in pixels for height (rows).
354- Only used when it's called inside dask.array.map_overlap.
355- depth_w: Halo size in pixels for width (cols).
356- Only used when it's called inside dask.array.map_overlap.
364+ depth_h (int):
365+ Halo size in pixels for height (rows). Only used
366+ when it's called from dask.array.map_overlap.
367+ depth_w (int):
368+ Halo size in pixels for width (cols). Only used
369+ when it's called from dask.array.map_overlap.
357370
358371 Returns:
359372 out: NumPy array (H, W, C) with 1.0 at peaks, 0 elsewhere.
360373 """
374+ min_distance_to_use = (
375+ self .min_distance if min_distance is None else min_distance
376+ )
377+ threshold_abs_to_use = (
378+ self .threshold_abs if threshold_abs is None else threshold_abs
379+ )
361380 return peak_detection_map_overlap (
362381 block ,
363- min_distance = self .min_distance ,
364- threshold_abs = self .threshold_abs ,
382+ min_distance = min_distance_to_use ,
383+ threshold_abs = threshold_abs_to_use ,
384+ threshold_rel = threshold_rel ,
365385 block_info = block_info ,
366386 depth_h = depth_h ,
367387 depth_w = depth_w ,
0 commit comments