class_docstr: PAR/REC header
class_docstr_tok: ["PAR\/REC","header"]
docstr: Returns scaling slope and intercept.
  
  Parameters
  ----------
  method : {'fp', 'dv'}
    Scaling settings to be reported -- see notes below.
  
  Returns
  -------
  slope : array
      scaling slope
  intercept : array
      scaling intercept
  
  Notes
  -----
  The PAR header contains two different scaling settings: 'dv' (value on
  console) and 'fp' (floating point value). Here is how they are defined:
  
  DV = PV * RS + RI
  FP = DV / (RS * SS)
  
  where:
  
  PV: value in REC
  RS: rescale slope
  RI: rescale intercept
  SS: scale slope
docstr_tok: ["Returns","scaling","slope","and","intercept",".","Parameters","--","--","--","--","--","method",":","{","'fp","'",",","'dv","'","}","Scaling","settings","to","be","reported","--","see","notes","below",".","Returns","--","--","--","-","slope",":","array","scaling","slope","intercept",":","array","scaling","intercept","Notes","--","--","-","The","PAR","header","contains","two","different","scaling","settings",":","'dv","'","(","value","on","console",")","and","'fp","'","(","floating","point","value",")",".","Here","is","how","they","are","defined",":","DV","=","PV","*","RS","+","RI","FP","=","DV","\/","(","RS","*","SS",")","where",":","PV",":","value","in","REC","RS",":","rescale","slope","RI",":","rescale","intercept","SS",":","scale","slope"]
code: def get_data_scaling(self, method="dv"):
      """Returns scaling slope and intercept.
  
      Parameters
      ----------
      method : {'fp', 'dv'}
        Scaling settings to be reported -- see notes below.
  
      Returns
      -------
      slope : array
          scaling slope
      intercept : array
          scaling intercept
  
      Notes
      -----
      The PAR header contains two different scaling settings: 'dv' (value on
      console) and 'fp' (floating point value). Here is how they are defined:
  
      DV = PV * RS + RI
      FP = DV / (RS * SS)
  
      where:
  
      PV: value in REC
      RS: rescale slope
      RI: rescale intercept
      SS: scale slope
      """
      # These will be 3D or 4D
      scale_slope = self.image_defs["scale slope"]
      rescale_slope = self.image_defs["rescale slope"]
      rescale_intercept = self.image_defs["rescale intercept"]
      if method == "dv":
          slope, intercept = rescale_slope, rescale_intercept
      elif method == "fp":
          slope = 1.0 / scale_slope
          intercept = rescale_intercept / (rescale_slope * scale_slope)
      else:
          raise ValueError(f"Unknown scaling method '{method}'.")
      reorder = self.get_sorted_slice_indices()
      slope = slope[reorder]
      intercept = intercept[reorder]
      shape = (1, 1) + self.get_data_shape()[2:]
      slope = slope.reshape(shape, order="F")
      intercept = intercept.reshape(shape, order="F")
      return slope, intercept
  
imports: import re
  import warnings
  from collections import OrderedDict
  from copy import deepcopy
  from io import StringIO
  from locale import getpreferredencoding
  import numpy
  from .affines import apply_affine, dot_reduce, from_matvec
  from .eulerangles import euler2mat
  from .fileslice import fileslice, strided_scalar
  from .nifti1 import unit_codes
  from .openers import ImageOpener
  from .spatialimages import SpatialHeader, SpatialImage
  from .volumeutils import Recoder, array_from_file
label_desc: Use image node_id 19 for calling the PARRECHeader obj's underlying member method code with example usage: obj.get_data_scaling(method) and returns: slope,  intercept