@@ -391,7 +391,8 @@ def erode_seed_and_foreground():
391391 )
392392 return segm
393393
394- def create_synapses (data : NDArray ,
394+ def create_synapses (
395+ data : NDArray ,
395396 channels : str ,
396397 point_creation_func : str = "peak_local_max" ,
397398 min_th_to_be_peak : List [float ] = [0.2 ],
@@ -403,19 +404,49 @@ def create_synapses(data: NDArray,
403404 relative_th_value : bool = False ,
404405) -> Tuple [NDArray , Dict ]:
405406 """
406- Convert binary foreground probability maps and instance contours to instance masks via watershed segmentation
407- algorithm.
408-
409- Implementation based on `PyTorch Connectomics' process.py
410- <https://github.com/zudi-lin/pytorch_connectomics/blob/master/connectomics/utils/process.py>`_.
407+ Creates synapses pre/post points from the given ``data``.
411408
409+ Find more info regarding ``min_distance``, ``min_sigma`` and ``exclude_border`` arguments in
410+ `peak_local_max <https://scikit-image.org/docs/0.25.x/api/skimage.feature.html#skimage.feature.peak_local_max>`__
411+ and `blob_log <https://scikit-image.org/docs/0.25.x/api/skimage.feature.html#skimage.feature.blob_log>`__
412+ functions.
413+
412414 Parameters
413415 ----------
414416 data : 4D Numpy array
415417 Binary foreground labels and contours data to apply watershed into. E.g. ``(397, 1450, 2000, 2)``.
416418
417419 channels : str
418420 Channel type used. Possible options: ``A``, ``C``, ``BC``, ``BCM``, ``BCD``, ``BCDv2``, ``Dv2`` and ``BDv2``.
421+
422+ point_creation_func : str, optional
423+ Function to be used in the pre/post point creation. Options: ["peak_local_max", "blob_log"]
424+
425+ min_th_to_be_peak : List of float, optional
426+ Minimum values for each channel in ``data`` to be used as the minimum when creating the points.
427+
428+ min_distance : int, optional
429+ The minimal allowed distance separating peaks. To find the maximum number of peaks, use ``min_distance=1``.
430+
431+ min_sigma : int, optional
432+ The minimum standard deviation for Gaussian kernel. Keep this low to detect smaller blobs. The standard deviations
433+ of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for
434+ all axes.
435+
436+ max_sigma : int, optional
437+ The maximum standard deviation for Gaussian kernel. Keep this high to detect larger blobs. The standard deviations
438+ of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for
439+ all axes.
440+
441+ num_sigma : int, optional
442+ The number of intermediate values of standard deviations to consider between ``min_sigma`` and ``max_sigma``.
443+
444+ exclude_border: bool, optional
445+ To exclude border-pixels of the border of the image.
446+
447+ relative_th_value : bool, optional
448+ To use ``min_th_to_be_peak`` as a relative threshold to the maximum value, i.e. ``threshold_rel`` is set instead of
449+ ``threshold_abs`` in the ``peak_local_max`` or ``blob_log`` call.
419450 """
420451 assert channels in [
421452 "B" ,
0 commit comments