Did I find the right examples for you? yes no

# discrete_domain.domain_from_binary_array

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

```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)
```

```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():
"""
toto = np.random.rand(*shape)
ddom = domain_from_binary_array(toto)
```

```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)))
positions = np.array([[3, 3], [3, 7], [7, 7]])
```

```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':
```