예제 #1
0
def cleanSensingImage(im, dy=0, sigma=None, order=3, fixreversal=True, removeoutliers=False, verbose=0):
    """ Clean up image from sensing dot

    Args:
        im (numpy array)
        dy (int or str): direction for differentiation
        order (int)
        fixreversal (bool)
        removeoutliers (bool)

    Returns:
        ww (image): processed image
    """
    verbose = int(verbose)
    removeoutliers = bool(removeoutliers)
    im = np.array(im)
    if sigma is None:
        imx = diffImage(im, dy=dy, size='same')
    else:
        imx = diffImageSmooth(im, dy=dy, sigma=sigma)
    if order >= 0:
        vv = fitBackground(imx, smooth=True, verbose=verbose, fig=None,
                           order=int(order), removeoutliers=removeoutliers)
        ww = (imx - vv).copy()
    else:
        ww = imx.copy()
    if fixreversal:
        ww = fixReversal(ww, verbose=verbose)
    return ww
예제 #2
0
    def test_image_operations(self, verbose=0):
        if verbose:
            print('testing resampleImage')
        ds = DataSet2D()
        _, _ = resampleImage(ds.z)

        z = self.test_array()
        _, _ = resampleImage(z)
        if verbose:
            print('testing diffImage')
        _ = diffImage(ds.z, dy='x')