cytometer/utils.py
def transform_coords(coords, transform_skimage):
    """
    Apply a scikit.image transformation to a set of point coordinates.

    The transformations applied to point coordinates in this function are consistent to transformations applied to
    an image with transform_im().

    :param coords: (P, 2) np.array, each row has the (x, y) coordinates of a point.
                    Alternatively, list of (x, y) coordinates.
    :param transform_skimage: skimage transform, e.g. created with keras2skimage_transform().
    :return:
    * coords_out: (P, 2) np.array or list of (x, y) coordinates of the transformed points.
    """

    is_list = type(coords) == list
    if is_list:
        coords = np.vstack(coords)

    # apply transformation to coordinates
    coords_out = matrix_transform(coords, transform_skimage.params)

    # cast to input type
    if is_list:
        coords_out = [tuple(x) for x in coords_out]

    return coords_out

    Apply a scikit.image transformation to a set of point coordinates.

    The transformations applied to point coordinates in this function are consistent to transformations applied to
    an image with transform_im().

    :param coords: (P, 2) np.array, each row has the (x, y) coordinates of a point.
                    Alternatively, list of (x, y) coordinates.
    :param transform_skimage: skimage transform, e.g. created with keras2skimage_transform().
    :return:
    * coords_out: (P, 2) np.array or list of (x, y) coordinates of the transformed points.
    
Apply a scikit.image transformation to a set of point coordinates.
The transformations applied to point coordinates in this function are consistent to transformations applied to
an image with transform_im().
Apply a scikit . image transformation to a set of point coordinates . The transformations applied to point coordinates in this function are consistent to transformations applied to an image with transform_im () .
def transform_coords(coords, transform_skimage):
    is_list = type(coords) == list
    if is_list:
        coords = np.vstack(coords)
    coords_out = matrix_transform(coords, transform_skimage.params)
    if is_list:
        coords_out = [tuple(x) for x in coords_out]
    return coords_out
def transform_coords ( coords , transform_skimage ) : is_list = type ( coords ) == list if is_list : coords = np . vstack ( coords ) coords_out = matrix_transform ( coords , transform_skimage . params ) if is_list : coords_out = [ tuple ( x ) for x in coords_out ] return coords_out
Apply a scikit.image transformation to a set of point coordinates.
Apply a scikit . image transformation to a set of point coordinates .
"""
    Apply a scikit.image transformation to a set of point coordinates.

    The transformations applied to point coordinates in this function are consistent to transformations applied to
    an image with transform_im().

    :param coords: (P, 2) np.array, each row has the (x, y) coordinates of a point.
                    Alternatively, list of (x, y) coordinates.
    :param transform_skimage: skimage transform, e.g. created with keras2skimage_transform().
    :return:
    * coords_out: (P, 2) np.array or list of (x, y) coordinates of the transformed points.
    """ # apply transformation to coordinates # cast to input type
(P, 2) np.array or list of (x, y) coordinates of the transformed points.
( P 2 ) np . array or list of ( x y ) coordinates of the transformed points .
coords
(P, 2) np.array, each row has the (x, y) coordinates of a point.
Alternatively, list of (x, y) coordinates.
( P 2 ) np . array each row has the ( x y ) coordinates of a point . Alternatively list of ( x y ) coordinates .
transform_skimage
skimage transform, e.g. created with keras2skimage_transform().
skimage transform e . g . created with keras2skimage_transform () .