Did I find the right examples for you? yes no

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)

src/n/i/nipy-0.3.0/nipy/labs/spatial_models/tests/test_discrete_domain.py   nipy(Download)
import numpy as np
from numpy.testing import assert_almost_equal, assert_equal
from ..discrete_domain import smatrix_from_nd_idx, smatrix_from_3d_array, \
    smatrix_from_nd_array, domain_from_binary_array, domain_from_image, \
    domain_from_mesh, grid_domain_from_binary_array, grid_domain_from_image, \
def test_array_grid_domain():
    """Test the construction of grid domain based on array
    """
    toto = np.ones(shape)
    ddom = grid_domain_from_binary_array(toto)
def test_grid_domain_mask():
    """test grid domain masking
    """
    toto = np.random.rand(*shape)
    ddom = grid_domain_from_binary_array(toto)

src/n/i/nipy-0.3.0/nipy/labs/spatial_models/tests/test_parcel.py   nipy(Download)
from ...utils.simul_multisubject_fmri_dataset import surrogate_2d_dataset
from ..parcellation import MultiSubjectParcellation
from ..discrete_domain import grid_domain_from_binary_array
 
 
    nb_parcel = 10
    data = np.random.randn(np.prod(shape))
    domain = grid_domain_from_binary_array(np.ones(shape))
    g = field_from_coo_matrix_and_data(domain.topology, data)
    u, J0 = g.ward(nb_parcel)
    for s in range(nb_subj):
        data = np.random.randn(np.prod(shape))
        domain = grid_domain_from_binary_array(np.ones(shape))
        g = field_from_coo_matrix_and_data(domain.topology, data)
        u, J0 = g.ward(nb_parcel)
    nb_parcel = 10
    data = np.random.randn(np.prod(shape), 1)
    domain = grid_domain_from_binary_array(np.ones(shape))
    g = field_from_coo_matrix_and_data(domain.topology, data)
    u, J0 = g.ward(nb_parcel)
    for s in range(nb_subj):
        data = np.random.randn(np.prod(shape))
        domain = grid_domain_from_binary_array(np.ones(shape))
        g = field_from_coo_matrix_and_data(domain.topology, data)
        u, J0 = g.ward(nb_parcel)