# Copyright (c) DataLab Platform Developers, BSD 3-Clause license, see LICENSE file."""Edges computation module------------------------"""# pylint: disable=invalid-name # Allows short reference names like x, y, ...# Note:# ----# All dataset classes must also be imported in the cdl.computation.param module.from__future__importannotationsimportguidata.datasetasgdsimportskimagefromskimageimportfeature,filtersfromcdl.computation.imageimportWrap11Func,dst_11,restore_data_outside_roifromcdl.configimport_fromcdl.objimportImageObj
[docs]classCannyParam(gds.DataSet):"""Canny filter parameters"""sigma=gds.FloatItem("Sigma",default=1.0,unit="pixels",min=0,nonzero=True,help=_("Standard deviation of the Gaussian filter."),)low_threshold=gds.FloatItem(_("Low threshold"),default=0.1,min=0,help=_("Lower bound for hysteresis thresholding (linking edges)."),)high_threshold=gds.FloatItem(_("High threshold"),default=0.9,min=0,help=_("Upper bound for hysteresis thresholding (linking edges)."),)use_quantiles=gds.BoolItem(_("Use quantiles"),default=True,help=_("If True then treat low_threshold and high_threshold as quantiles ""of the edge magnitude image, rather than absolute edge magnitude ""values. If True then the thresholds must be in the range [0, 1]."),)modes=("reflect","constant","nearest","mirror","wrap")mode=gds.ChoiceItem(_("Mode"),list(zip(modes,modes)),default="constant")cval=gds.FloatItem("cval",default=0.0,help=_("Value to fill past edges of input if mode is constant."),)