class_docstr: Class for SPM99 variant of basic Analyze image
class_docstr_tok: ["Class","for","SPM99","variant","of","basic","Analyze","image"]
docstr: Write image to `file_map` or contained ``self.file_map``
  
  Extends Analyze ``to_file_map`` method by writing ``mat`` file
  
  Parameters
  ----------
  file_map : None or mapping, optional
     files mapping.  If None (default) use object's ``file_map``
     attribute instead
docstr_tok: ["Write","image","to","`","file_map","`","or","contained","``","self.file_map","``","Extends","Analyze","``","to_file_map","``","method","by","writing","``","mat","``","file","Parameters","--","--","--","--","--","file_map",":","None","or","mapping",",","optional","files","mapping",".","If","None","(","default",")","use","object","'s","``","file_map","``","attribute","instead"]
code: def to_file_map(self, file_map=None, dtype=None):
      """Write image to `file_map` or contained ``self.file_map``
  
      Extends Analyze ``to_file_map`` method by writing ``mat`` file
  
      Parameters
      ----------
      file_map : None or mapping, optional
         files mapping.  If None (default) use object's ``file_map``
         attribute instead
      """
      if file_map is None:
          file_map = self.file_map
      super().to_file_map(file_map, dtype=dtype)
      mat = self._affine
      if mat is None:
          return
      import scipy.io as sio
  
      hdr = self._header
      if hdr.default_x_flip:
          M = np.dot(np.diag([-1, 1, 1, 1]), mat)
      else:
          M = mat
      # Adjust for matlab 1,1,1 voxel origin
      from_111 = np.eye(4)
      from_111[:3, 3] = -1
      M = np.dot(M, from_111)
      mat = np.dot(mat, from_111)
      # use matlab 4 format to allow gzipped write without error
      with file_map["mat"].get_prepare_fileobj(mode="wb") as mfobj:
          sio.savemat(mfobj, {"M": M, "mat": mat}, format="4")
  
imports: import warnings
  from io import BytesIO
  import numpy
  from .None import analyze
  from .batteryrunners import Report
  from .optpkg import optional_package
  from .spatialimages import HeaderDataError, HeaderTypeError
label_desc: Use image node_id 2 for calling the Spm99AnalyzeImage obj's underlying member method code with example usage: obj.to_file_map(file_map, dtype) without return types