# Copyright (c) DataLab Platform Developers, BSD 3-Clause license, see LICENSE file."""Exposure 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.datasetasgdsfromskimageimportexposurefromcdl.computation.imageimportVALID_DTYPES_STRLIST,dst_11,restore_data_outside_roifromcdl.configimport_fromcdl.objimportImageObj
[docs]classAdjustGammaParam(gds.DataSet):"""Gamma adjustment parameters"""gamma=gds.FloatItem(_("Gamma"),default=1.0,min=0.0,help=_("Gamma correction factor (higher values give more contrast)."),)gain=gds.FloatItem(_("Gain"),default=1.0,min=0.0,help=_("Gain factor (higher values give more contrast)."),)
[docs]classAdjustSigmoidParam(gds.DataSet):"""Sigmoid adjustment parameters"""cutoff=gds.FloatItem(_("Cutoff"),default=0.5,min=0.0,max=1.0,help=_("Cutoff value (higher values give more contrast)."),)gain=gds.FloatItem(_("Gain"),default=10.0,min=0.0,help=_("Gain factor (higher values give more contrast)."),)inv=gds.BoolItem(_("Inverse"),default=False,help=_("If True, apply inverse sigmoid transformation."),)
[docs]classRescaleIntensityParam(gds.DataSet):"""Intensity rescaling parameters"""_dtype_list=["image","dtype"]+VALID_DTYPES_STRLISTin_range=gds.ChoiceItem(_("Input range"),list(zip(_dtype_list,_dtype_list)),default="image",help=_("Min and max intensity values of input image ('image' refers to input ""image min/max levels, 'dtype' refers to input image data type range)."),)out_range=gds.ChoiceItem(_("Output range"),list(zip(_dtype_list,_dtype_list)),default="dtype",help=_("Min and max intensity values of output image ('image' refers to input ""image min/max levels, 'dtype' refers to input image data type range).."),)
[docs]classEqualizeHistParam(gds.DataSet):"""Histogram equalization parameters"""nbins=gds.IntItem(_("Number of bins"),min=1,default=256,help=_("Number of bins for image histogram."),)