dcnum.read.detect_flicker ========================= .. py:module:: dcnum.read.detect_flicker Functions --------- .. autoapisummary:: dcnum.read.detect_flicker.detect_flickering Module Contents --------------- .. py:function:: detect_flickering(image_data: numpy.ndarray | dcnum.read.hdf5_data.HDF5Data, roi_height: int = 10, brightness_threshold: float = 2.5, count_threshold: int = 5, max_frames: int = 1000) Determine whether an image series experiences flickering Flickering is an unwelcome phenomenon due to a faulty data acquisition device. For instance, if there is random voltage noise in the electronics managing the LED power, then the brightness of the LED will vary randomly when the noise signal overlaps with the flash triggering signal. If flickering is detected, you should use the "sparsemed" background computation with ``offset_correction`` set to True. :param image_data: sliceable object (e.g. numpy array or HDF5Data) containing image data. :param roi_height: height of the ROI in pixels for which to search for flickering; the entire width of the image is used :type roi_height: int :param brightness_threshold: brightness difference between individual ROIs median and median of all ROI medians leading to a positive flickering event :type brightness_threshold: float :param count_threshold: minimum number of flickering events that would lead to a positive flickering decision :type count_threshold: int :param max_frames: maximum number of frames to include in the flickering analysis :type max_frames: int