class_docstr: Class to wrap MINC2 format file
  
  Although it has some of the same methods as a ``Header``, we use
  this only when reading a MINC2 file, to pull out useful header
  information, and for the method of reading the data out
class_docstr_tok: ["Class","to","wrap","MINC2","format","file","Although","it","has","some","of","the","same","methods","as","a","``","Header","``",",","we","use","this","only","when","reading","a","MINC2","file",",","to","pull","out","useful","header","information",",","and","for","the","method","of","reading","the","data","out"]
docstr: Return valid range for image data
  
  The valid range can come from the image 'valid_range' or
  failing that, from the data type range
docstr_tok: ["Return","valid","range","for","image","data","The","valid","range","can","come","from","the","image","'valid_range","'","or","failing","that",",","from","the","data","type","range"]
code: def _get_valid_range(self):
      """Return valid range for image data
  
      The valid range can come from the image 'valid_range' or
      failing that, from the data type range
      """
      ddt = self.get_data_dtype()
      info = np.iinfo(ddt.type)
      try:
          valid_range = self._image.attrs["valid_range"]
      except (AttributeError, KeyError):
          valid_range = [info.min, info.max]
      else:
          if valid_range[0] < info.min or valid_range[1] > info.max:
              raise ValueError(
                  "Valid range outside input data type range"
              )
      return np.asarray(valid_range, dtype=np.float64)
  
imports: import warnings
  import numpy
  from .minc1 import Minc1File, Minc1Image, MincError, MincHeader
label_desc: Use image node_id 5 for calling the Minc2File obj's underlying member method code with example usage: obj._get_valid_range() and returns: np