microscopestitching/stitching.py
def calc_translations_parallel(images):
    """Calculate image translations in parallel.

    Parameters
    ----------
    images : ImageCollection
        Images as instance of ImageCollection.

    Returns
    -------
    2d array, (ty, tx)
        ty and tx is translation to previous image in respectively
        x or y direction.
    """
    w = Parallel(n_jobs=_CPUS)
    res = w(delayed(images.translation)(img) for img in images)

    # save results to Image object, as Parallel is spawning another process
    for i,translation in enumerate(res):
        images[i].translation = translation

    return np.array(res)
def calc_translations_parallel(images):
    """Calculate image translations in parallel.

    Parameters
    ----------
    images : ImageCollection
        Images as instance of ImageCollection.

    Returns
    -------
    2d array, (ty, tx)
        ty and tx is translation to previous image in respectively
        x or y direction.
    """
    w = Parallel(n_jobs=_CPUS)
    res = w(delayed(images.translation)(img) for img in images)

    # save results to Image object, as Parallel is spawning another process
    for i,translation in enumerate(res):
        images[i].translation = translation

    return np.array(res)
def calc_translations_parallel ( images ) : w = Parallel ( n_jobs = _CPUS ) res = w ( delayed ( images . translation ) ( img ) for img in images ) # save results to Image object, as Parallel is spawning another process for i , translation in enumerate ( res ) : images [ i ] . translation = translation return np . array ( res )
Calculate image translations in parallel.

    Parameters
    ----------
    images : ImageCollection
        Images as instance of ImageCollection.

    Returns
    -------
    2d array, (ty, tx)
        ty and tx is translation to previous image in respectively
        x or y direction.
Calculate image translations in parallel .