class_docstr: This is the basic field structure,
       which contains the weighted graph structure
       plus an array of data (the 'field')
  field is an array of size(n, p)
        where n is the number of vertices of the graph
        and p is the field dimension
class_docstr_tok: ["This","is","the","basic","field","structure",",","which","contains","the","weighted","graph","structure","plus","an","array","of","data","(","the","'field","'",")","field","is","an","array","of","size","(","n",",","p",")","where","n","is","the","number","of","vertices","of","the","graph","and","p","is","the","field","dimension"]
docstr: Voronoi parcellation of the field starting from the input seed
  
  Parameters
  ----------
  seed: int array of shape(p), the input seeds
  
  Returns
  -------
  label: The resulting labelling of the data
  
  Notes
  -----
  FIXME: deal with graphs with several ccs
docstr_tok: ["Voronoi","parcellation","of","the","field","starting","from","the","input","seed","Parameters","--","--","--","--","--","seed",":","int","array","of","shape","(","p",")",",","the","input","seeds","Returns","--","--","--","-","label",":","The","resulting","labelling","of","the","data","Notes","--","--","-","FIXME",":","deal","with","graphs","with","several","ccs"]
code: def constrained_voronoi(self, seed):
      """Voronoi parcellation of the field starting from the input seed
  
      Parameters
      ----------
      seed: int array of shape(p), the input seeds
  
      Returns
      -------
      label: The resulting labelling of the data
  
      Notes
      -----
      FIXME: deal with graphs with several ccs
      """
      if np.size(self.field) == 0:
          raise ValueError("No field has been defined so far")
      seed = seed.astype(np.int_)
      weights = np.sqrt(
          np.sum(
              (
                  self.field[self.edges.T[0]]
                  - self.field[self.edges.T[1]]
              )
              ** 2,
              1,
          )
      )
      g = WeightedGraph(self.V, self.edges, weights)
      label = g.voronoi_labelling(seed)
      return label
  
imports: from warnings import warn
  import numpy
  from .graph import Graph, WeightedGraph
label_desc: Use image node_id 14 for calling the Field obj's underlying member method code with example usage: obj.constrained_voronoi(seed) and returns: label