class_docstr: Basic scaling Spm Analyze header
class_docstr_tok: ["Basic","scaling","Spm","Analyze","header"]
docstr: Set slope and / or intercept into header
  
  Set slope and intercept for image data, such that, if the image
  data is ``arr``, then the scaled image data will be ``(arr *
  slope) + inter``
  
  The SPM Analyze header can't save an intercept value, and we raise an
  error unless `inter` is None, NaN or 0
  
  Parameters
  ----------
  slope : None or float
     If None, implies `slope` of NaN.  NaN is a signal to the image
     writing routines to rescale on save.  0, Inf, -Inf are invalid and
     cause a HeaderDataError
  inter : None or float, optional
     intercept. Must be None, NaN or 0, because SPM99 cannot store
     intercepts.
docstr_tok: ["Set","slope","and","\/","or","intercept","into","header","Set","slope","and","intercept","for","image","data",",","such","that",",","if","the","image","data","is","``","arr","``",",","then","the","scaled","image","data","will","be","``","(","arr","*","slope",")","+","inter","``","The","SPM","Analyze","header","ca","n't","save","an","intercept","value",",","and","we","raise","an","error","unless","`","inter","`","is","None",",","NaN","or","0","Parameters","--","--","--","--","--","slope",":","None","or","float","If","None",",","implies","`","slope","`","of","NaN",".","NaN","is","a","signal","to","the","image","writing","routines","to","rescale","on","save",".","0",",","Inf",",","-Inf","are","invalid","and","cause","a","HeaderDataError","inter",":","None","or","float",",","optional","intercept",".","Must","be","None",",","NaN","or","0",",","because","SPM99","can","not","store","intercepts","."]
code: def set_slope_inter(self, slope, inter=None):
      """Set slope and / or intercept into header
  
      Set slope and intercept for image data, such that, if the image
      data is ``arr``, then the scaled image data will be ``(arr *
      slope) + inter``
  
      The SPM Analyze header can't save an intercept value, and we raise an
      error unless `inter` is None, NaN or 0
  
      Parameters
      ----------
      slope : None or float
         If None, implies `slope` of NaN.  NaN is a signal to the image
         writing routines to rescale on save.  0, Inf, -Inf are invalid and
         cause a HeaderDataError
      inter : None or float, optional
         intercept. Must be None, NaN or 0, because SPM99 cannot store
         intercepts.
      """
      if slope is None:
          slope = np.nan
      if slope in (0, -np.inf, np.inf):
          raise HeaderDataError("Slope cannot be 0 or infinite")
      self._structarr["scl_slope"] = slope
      if inter in (None, 0) or np.isnan(inter):
          return
      raise HeaderTypeError(
          "Cannot set non-zero intercept for SPM headers"
      )
  
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 3 for calling the SpmAnalyzeHeader obj's underlying member method code with example usage: obj.set_slope_inter(slope, inter) without return types