'Process *image* using the normalization options configured in the
control panel.
This can be repurposed to process any data through the same filter.'

def normalize(self, image):

    if self.ui.normOffRadio.isChecked():
        return image
    div = self.ui.normDivideRadio.isChecked()
    norm = image.view(np.ndarray).copy()
    if div:
        norm = norm.astype(np.float32)
    if (self.ui.normTimeRangeCheck.isChecked() and (image.ndim == 3)):
        (sind, start) = self.timeIndex(self.normRgn.lines[0])
        (eind, end) = self.timeIndex(self.normRgn.lines[1])
        n = image[sind:(eind + 1)].mean(axis=0)
        n.shape = ((1,) + n.shape)
        if div:
            norm /= n
        else:
            norm -= n
    if (self.ui.normFrameCheck.isChecked() and (image.ndim == 3)):
        n = image.mean(axis=1).mean(axis=1)
        n.shape = (n.shape + (1, 1))
        if div:
            norm /= n
        else:
            norm -= n
    if (self.ui.normROICheck.isChecked() and (image.ndim == 3)):
        n = self.normRoi.getArrayRegion(norm, self.imageItem, (1, 2)).mean(axis=1).mean(axis=1)
        n = n[:, np.newaxis, np.newaxis]
        if div:
            norm /= n
        else:
            norm -= n
    return norm
