Did I find the right examples for you? yes no

All Samples(15)  |  Call(11)  |  Derive(0)  |  Import(4)

src/n/i/nipy-0.3.0/nipy/labs/spatial_models/tests/test_hroi.py   nipy(Download)
from ..hroi import HROI_as_discrete_domain_blobs, make_hroi_from_subdomain
from ..mroi import subdomain_from_array
from ..discrete_domain import domain_from_binary_array
 
shape = (5, 6, 7)
def make_domain():
    """Create a multiple ROI instance
    """
    labels = np.ones(shape)
    dom = domain_from_binary_array(labels, affine=None)

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_domain():
    """Test the construction of domain based on array
    """
    toto = np.ones(shape)
    ddom = domain_from_binary_array(toto)
def test_connected_components():
    """Test the estimation of connected components
    """
    toto = np.ones(shape)
    ddom = domain_from_binary_array(toto)
def test_feature():
    """ test feature inclusion
    """
    toto = np.random.rand(*shape)
    ddom = domain_from_binary_array(toto)
def test_mask_feature():
    """ test_feature_masking
    """
    toto = np.random.rand(*shape)
    ddom = domain_from_binary_array(toto)

src/n/i/nipy-0.3.0/nipy/labs/spatial_models/tests/test_mroi.py   nipy(Download)
import numpy as np
from ..mroi import subdomain_from_array, subdomain_from_balls
from ..discrete_domain import domain_from_binary_array
 
from numpy.testing import assert_equal
def test_sd_from_ball():
    dom = domain_from_binary_array(np.ones((10, 10)))
    radii = np.array([2, 2, 2])
    positions = np.array([[3, 3], [3, 7], [7, 7]])
    subdomain = subdomain_from_balls(dom, positions, radii)

src/n/i/nipy-0.3.0/nipy/labs/spatial_models/tests/test_bsa.py   nipy(Download)
from ...utils.simul_multisubject_fmri_dataset import surrogate_2d_dataset
from ..bayesian_structural_analysis import compute_BSA_simple
from ..discrete_domain import domain_from_binary_array
 
 
    g0 = 1.0 / (1.0 * nvox)
    bdensity = 1
    dom = domain_from_binary_array(np.ones(ref_dim))
 
    if method == 'simple':