Did I find the right examples for you? yes no

All Samples(5)  |  Call(3)  |  Derive(0)  |  Import(2)

src/n/i/nipy-0.3.0/nipy/labs/spatial_models/hierarchical_parcellation.py   nipy(Download)
from numpy.random import rand
 
from nipy.algorithms.clustering.utils import kmeans, voronoi
from .parcellation import MultiSubjectParcellation
from nipy.algorithms.graph.field import Field
        indiv_coord, feature, chunksize)
 
    _, labs, _ = kmeans(reduced_feature, nb_parcel, Labels=None, maxiter=10)
    proto_anat = [np.mean(reduced_anat[labs == k], 0)
                  for k in range(nb_parcel)]

src/n/i/nipy-0.3.0/nipy/labs/spatial_models/parcel_io.py   nipy(Download)
from nibabel import load, save, Nifti1Image
 
from nipy.algorithms.clustering.utils import kmeans
from .discrete_domain import grid_domain_from_image
from .mroi import SubDomains
 
    domain = grid_domain_from_image(mask)
    cent, labels, J = kmeans(domain.coord, nb_parcel)
    sub_dom = SubDomains(domain, labels)
    # get id (or labels) image
 
    if method == 'kmeans':
        _, u, _ = kmeans(feature, nbparcel)
 
    if method == 'ward':