class_docstr: temporary class to handle meshes
class_docstr_tok: ["temporary","class","to","handle","meshes"]
docstr: Return array of areas for each node
  
  Returns
  -------
  area: array of shape self.V,
        area of each node
code: def area(self):
      """Return array of areas for each node
  
      Returns
      -------
      area: array of shape self.V,
            area of each node
  
      """
      E = len(self.triangles)
      narea = np.zeros(self.V)
  
      def _area(a, b):
          """Area spanned by the vectors(a,b) in 3D"""
          c = np.array(
              [
                  a[1] * b[2] - a[2] * b[1],
                  -a[0] * b[2] + a[2] * b[0],
                  a[0] * b[1] - a[1] * b[0],
              ]
          )
          return np.sqrt((c**2).sum())
  
      for e in range(E):
          i, j, k = self.triangles[e]
          a = self.coord[i] - self.coord[k]
          b = self.coord[j] - self.coord[k]
          ar = _area(a, b)
          narea[i] += ar
          narea[j] += ar
          narea[k] += ar
  
      narea /= 6
      # because division by 2 has been 'forgotten' in area computation
      # the area of a triangle is divided into the 3 vertices
      return narea
  
imports: import numpy
  import scipy.sparse
  from nibabel import Nifti1Image, load, save
  from nipy.algorithms.graph import WeightedGraph, wgraph_from_3d_grid, wgraph_from_coo_matrix
  from nipy.io.nibcompat import get_affine, get_header
label_desc: Use image node_id 2 for calling the MeshDomain obj's underlying member method code with example usage: obj.area() and returns: narea, np