class_docstr: Particular instance of StructuredDomain, that receives
  3 additional variables:
  affine: array of shape (dim+1, dim+1),
          affine transform that maps points to a coordinate system
  shape: dim-tuple,
         shape of the domain
  ijk: array of shape(size, dim), int
       grid coordinates of the points
  
  This is to allow easy conversion to images when dim==3,
  and for compatibility with previous classes
class_docstr_tok: ["Particular","instance","of","StructuredDomain",",","that","receives","3","additional","variables",":","affine",":","array","of","shape","(","dim+1",",","dim+1",")",",","affine","transform","that","maps","points","to","a","coordinate","system","shape",":","dim-tuple",",","shape","of","the","domain","ijk",":","array","of","shape","(","size",",","dim",")",",","int","grid","coordinates","of","the","points","This","is","to","allow","easy","conversion","to","images","when","dim==3",",","and","for","compatibility","with","previous","classes"]
docstr: Extract the information from an image to make it a domain a feature
  
  Parameters
  ----------
  path: string or Nifti1Image instance,
        the image from which one wished to extract data
  fid: string, optional
       identifier of the resulting feature.
       if '', the feature is not stored
  
  Returns
  -------
  the corresponding set of values
code: def make_feature_from_image(self, path, fid=""):
      """Extract the information from an image to make it a domain a feature
  
      Parameters
      ----------
      path: string or Nifti1Image instance,
            the image from which one wished to extract data
      fid: string, optional
           identifier of the resulting feature.
           if '', the feature is not stored
  
      Returns
      -------
      the corresponding set of values
  
      """
      if isinstance(path, str):
          nim = load(path)
      else:
          nim = path
  
      if (get_affine(nim) != self.affine).any():
          raise ValueError(
              "nim and self do not have the same referential"
          )
  
      data = nim.get_fdata()
      feature = data[self.ijk[:, 0], self.ijk[:, 1], self.ijk[:, 2]]
      if fid != "":
          self.features[fid] = feature
  
      return feature
  
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 4 for calling the NDGridDomain obj's underlying member method code with example usage: obj.make_feature_from_image(path, fid) and returns: feature