Пример #1
0
def test_mkdakernel_smoke(testdata1):
    """
    Smoke test for nimare.meta.cbma.kernel.MKDAKernel
    """
    kern = kernel.MKDAKernel()
    ale_kernels = kern.transform(testdata1)
    assert len(ale_kernels) == 2
Пример #2
0
def test_mkdakernel_smoke(testdata1):
    """
    Smoke test for nimare.meta.cbma.kernel.MKDAKernel
    """
    ids = [1, 2]
    kern = kernel.MKDAKernel(testdata1.coordinates, testdata1.mask)
    ale_kernels = kern.transform(ids=ids)
    assert len(ale_kernels) == len(ids)
Пример #3
0
def test_mkdakernel2(testdata2):
    """
    COMs of MKDA kernel maps should match the foci fed in (assuming focus isn't
    masked out and spheres don't overlap).
    Test on 2mm template.
    """
    id_ = 1
    kern = kernel.MKDAKernel(r=4, value=1)
    maps = kern.transform(testdata2.coordinates, testdata2.masker)

    ijk = testdata2.coordinates.loc[testdata2.coordinates['id'] == id_,
                                    ['i', 'j', 'k']]
    ijk = np.squeeze(ijk.values.astype(int))
    kern_data = maps[0].get_data()
    com = np.array(center_of_mass(kern_data)).astype(int).T
    com = np.squeeze(com)
    assert np.array_equal(ijk, com)