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: Morphological dilation of the field data, changed in place
  
  Parameters
  ----------
  nbiter: int, optional, the number of iterations required
  
  Notes
  -----
  When data dtype is not float64, a slow version of the code is used
docstr_tok: ["Morphological","dilation","of","the","field","data",",","changed","in","place","Parameters","--","--","--","--","--","nbiter",":","int",",","optional",",","the","number","of","iterations","required","Notes","--","--","-","When","data","dtype","is","not","float64",",","a","slow","version","of","the","code","is","used"]
code: def dilation(self, nbiter=1, fast=True):
      """Morphological dilation of the field data, changed in place
  
      Parameters
      ----------
      nbiter: int, optional, the number of iterations required
  
      Notes
      -----
      When data dtype is not float64, a slow version of the code is used
      """
      nbiter = int(nbiter)
      if self.field.dtype != np.float64:
          warn("data type is not float64; a slower version is used")
          fast = False
      if fast:
          from ._graph import dilation
  
          if self.E > 0:
              if self.field.size == self.V:
                  self.field = self.field.reshape((self.V, 1))
              idx, neighb, _ = self.compact_neighb()
              for i in range(nbiter):
                  dilation(self.field, idx, neighb)
      else:
          from scipy.sparse import dia_matrix
  
          adj = self.to_coo_matrix() + dia_matrix(
              (np.ones(self.V), 0), (self.V, self.V)
          )
          rows = adj.tolil().rows
          for i in range(nbiter):
              self.field = np.array(
                  [self.field[row].max(0) for row in rows]
              )
  
imports: from warnings import warn
  import numpy
  from .graph import Graph, WeightedGraph
label_desc: Use image node_id 6 for calling the Field obj's underlying member method code with example usage: obj.dilation(nbiter, fast) without return types