cytometer/data.py
def split_images(x, nblocks):
    """
    Splits the rows and columns of a data array with shape (n, rows, cols, channels) into blocks.

    If necessary, the array is trimmed off so that all blocks have the same size.

    :param x: numpy.ndarray (images, rows, cols, channels).
    :param nblocks: scalar with the number of blocks to split the rows and columns into.
    :return: numpy.ndarray with x split into blocks.
    """

    # compute how many whole blocks fit in the data, and what length of the image they cover
    _, nrows, ncols, _ = x.shape
    nrows = int(np.floor(nrows / nblocks) * nblocks)
    ncols = int(np.floor(ncols / nblocks) * nblocks)

    # remove the extra bit of the images so that we can split them into equal blocks
    x = x[:, 0:nrows, 0:ncols, :]

    # split images into smaller blocks
    _, x, _ = pystoim.block_split(x, nblocks=(1, nblocks, nblocks, 1), by_reference=True)
    x = np.concatenate(x, axis=0)

    return x

    Splits the rows and columns of a data array with shape (n, rows, cols, channels) into blocks.

    If necessary, the array is trimmed off so that all blocks have the same size.

    :param x: numpy.ndarray (images, rows, cols, channels).
    :param nblocks: scalar with the number of blocks to split the rows and columns into.
    :return: numpy.ndarray with x split into blocks.
    
Splits the rows and columns of a data array with shape (n, rows, cols, channels) into blocks.
If necessary, the array is trimmed off so that all blocks have the same size.
Splits the rows and columns of a data array with shape ( n rows cols channels ) into blocks . If necessary the array is trimmed off so that all blocks have the same size .
def split_images(x, nblocks):
    _, nrows, ncols, _ = x.shape
    nrows = int(np.floor(nrows / nblocks) * nblocks)
    ncols = int(np.floor(ncols / nblocks) * nblocks)
    x = x[:, 0:nrows, 0:ncols, :]
    _, x, _ = pystoim.block_split(x, nblocks=(1, nblocks, nblocks, 1), by_reference=True)
    x = np.concatenate(x, axis=0)
    return x
def split_images ( x , nblocks ) : _ , nrows , ncols , _ = x . shape nrows = int ( np . floor ( nrows / nblocks ) * nblocks ) ncols = int ( np . floor ( ncols / nblocks ) * nblocks ) x = x [ : , 0 : nrows , 0 : ncols , : ] _ , x , _ = pystoim . block_split ( x , nblocks = ( 1 , nblocks , nblocks , 1 ) , by_reference = True ) x = np . concatenate ( x , axis = 0 ) return x
Splits the rows and columns of a data array with shape (n, rows, cols, channels) into blocks.
Splits the rows and columns of a data array with shape ( n rows cols channels ) into blocks .
"""
    Splits the rows and columns of a data array with shape (n, rows, cols, channels) into blocks.

    If necessary, the array is trimmed off so that all blocks have the same size.

    :param x: numpy.ndarray (images, rows, cols, channels).
    :param nblocks: scalar with the number of blocks to split the rows and columns into.
    :return: numpy.ndarray with x split into blocks.
    """ # compute how many whole blocks fit in the data, and what length of the image they cover # remove the extra bit of the images so that we can split them into equal blocks # split images into smaller blocks
numpy.ndarray with x split into blocks.
numpy . ndarray with x split into blocks .
x
numpy.ndarray (images, rows, cols, channels).
numpy . ndarray ( images rows cols channels ) .
nblocks
scalar with the number of blocks to split the rows and columns into.
scalar with the number of blocks to split the rows and columns into .