utils2p/main.py
def load_img(path, memmap=False):
    """
    This functions loads an image from file and returns as a numpy array.

    Parameters
    ----------
    path : string
        Path to image file.
    memmap : bool
        If `True`, the image is not loaded into memory but remains on
        disk and a `numpy.memmap` object is returned. It can be indexed
        like a normal `numpy.array`. This option is useful when a stack
        does not fit into memory. It can also be used when opening many
        stacks simultaneously.

    Returns
    -------
    numpy.array or numpy.memmap
        Image in form of numpy array or numpy memmap.

    Examples
    --------
    >>> import utils2p
    >>> img = utils2p.load_img("data/chessboard_GRAY_U16.tif")
    >>> type(img)
    <class 'numpy.ndarray'>
    >>> img.shape
    (200, 200)
    >>> img = utils2p.load_img("data/chessboard_GRAY_U16.tif", memmap=True)
    >>> type(img)
    <class 'numpy.memmap'>
    """
    path = os.path.expanduser(os.path.expandvars(path))
    return tifffile.imread(path, memmap=memmap)

    This functions loads an image from file and returns as a numpy array.

    Parameters
    ----------
    path : string
        Path to image file.
    memmap : bool
        If `True`, the image is not loaded into memory but remains on
        disk and a `numpy.memmap` object is returned. It can be indexed
        like a normal `numpy.array`. This option is useful when a stack
        does not fit into memory. It can also be used when opening many
        stacks simultaneously.

    Returns
    -------
    numpy.array or numpy.memmap
        Image in form of numpy array or numpy memmap.

    Examples
    --------
    >>> import utils2p
    >>> img = utils2p.load_img("data/chessboard_GRAY_U16.tif")
    >>> type(img)
    <class 'numpy.ndarray'>
    >>> img.shape
    (200, 200)
    >>> img = utils2p.load_img("data/chessboard_GRAY_U16.tif", memmap=True)
    >>> type(img)
    <class 'numpy.memmap'>
    
This functions loads an image from file and returns as a numpy array.
Parameters

path : string
Path to image file.
memmap : bool
If `True`, the image is not loaded into memory but remains on
disk and a `numpy.memmap` object is returned. It can be indexed
like a normal `numpy.array`. This option is useful when a stack
does not fit into memory. It can also be used when opening many
stacks simultaneously.

Returns

numpy.array or numpy.memmap
Image in form of numpy array or numpy memmap.

Examples


This functions loads an image from file and returns as a numpy array . Parameters path : string Path to image file . memmap : bool If ` True ` the image is not loaded into memory but remains on disk and a ` numpy . memmap ` object is returned . It can be indexed like a normal ` numpy . array ` . This option is useful when a stack does not fit into memory . It can also be used when opening many stacks simultaneously . Returns numpy . array or numpy . memmap Image in form of numpy array or numpy memmap . Examples
def load_img(path, memmap=False):
    path = os.path.expanduser(os.path.expandvars(path))
    return tifffile.imread(path, memmap=memmap)
def load_img ( path , memmap = False ) : path = os . path . expanduser ( os . path . expandvars ( path ) ) return tifffile . imread ( path , memmap = memmap )
This functions loads an image from file and returns as a numpy array.
This functions loads an image from file and returns as a numpy array .
"""
    This functions loads an image from file and returns as a numpy array.

    Parameters
    ----------
    path : string
        Path to image file.
    memmap : bool
        If `True`, the image is not loaded into memory but remains on
        disk and a `numpy.memmap` object is returned. It can be indexed
        like a normal `numpy.array`. This option is useful when a stack
        does not fit into memory. It can also be used when opening many
        stacks simultaneously.

    Returns
    -------
    numpy.array or numpy.memmap
        Image in form of numpy array or numpy memmap.

    Examples
    --------
    >>> import utils2p
    >>> img = utils2p.load_img("data/chessboard_GRAY_U16.tif")
    >>> type(img)
    <class 'numpy.ndarray'>
    >>> img.shape
    (200, 200)
    >>> img = utils2p.load_img("data/chessboard_GRAY_U16.tif", memmap=True)
    >>> type(img)
    <class 'numpy.memmap'>
    """
path
memmap