71b50613bb182a263e799be300e187b840fc1572,dipy/denoise/localpca.py,,localpca,#Any#Any#Any#Any#Any#Any#Any#,4

Before Change


        // If mask is not specified, use the whole volume
        mask = np.ones_like(arr, dtype=bool)[..., 0]

    if pca_method == "svd":
        // Try to get the SVD through direct API to lapack:
        try:
            from scipy.linalg.lapack import dgesvd as svd
            svd_args = [1, 0]
            // If you have an older version of scipy, we fall back
            // on the standard scipy SVD API:
        except ImportError:
            from scipy.linalg import svd
            svd_args = [False]
    else:
        from scipy.linalg import eigh

    if out_dtype is None:
        out_dtype = arr.dtype

    // We retain float64 precision, iff the input is in this precision:

After Change


        raise ValueError("PCA denoising can only be performed on 4D arrays.",
                         arr.shape)

    if pca_method.lower() == "svd":
        is_svd = True
    elif pca_method.lower() == "eig":
        is_svd = False
    else:
        raise ValueError("pca_method should be either "eig" or "svd"")

    patch_size = 2 * patch_radius + 1

    if patch_size ** 3 < arr.shape[-1]:
        e_s = "You asked for PCA denoising with a "
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: nipy/dipy
Commit Name: 71b50613bb182a263e799be300e187b840fc1572
Time: 2017-07-21
Author: sheybani.saber@gmail.com
File Name: dipy/denoise/localpca.py
Class Name:
Method Name: localpca


Project Name: comic/grand-challenge.org
Commit Name: e8bafba0d6a342e0a6de13f4ca05b71a111f22e1
Time: 2018-10-18
Author: jamesmeakin@gmail.com
File Name: app/grandchallenge/core/views.py
Class Name:
Method Name: comicmain


Project Name: nipy/dipy
Commit Name: 3f0bd0264210e859fe4de2715e321cbaed327c85
Time: 2017-07-28
Author: sheybani.saber@gmail.com
File Name: dipy/denoise/localpca.py
Class Name:
Method Name: localpca