Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

src/n/i/nipy-0.3.0/nipy/labs/spatial_models/bsa_io.py   nipy(Download)
from .bayesian_structural_analysis import (compute_BSA_simple,
                                           compute_BSA_quick, compute_BSA_loo)
from .discrete_domain import domain_from_image
 
 
 
    # encode it as a domain
    dom = domain_from_image(Nifti1Image(mask, affine), nn=18)
    nvox = dom.size
 

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, \
    affine[3:, 0:3] = 0
    nim = Nifti1Image(toto, affine)
    ddom = domain_from_image(nim)
    ref = np.sum(toto) * np.absolute(np.linalg.det(affine))
    assert_almost_equal(np.sum(ddom.local_volume), ref)