class_docstr: Class to act as proxy for the array that can be read from a file
  
  The array proxy allows us to freeze the passed fileobj and header such that
  it returns the expected data array.
  
  This implementation assumes a contiguous array in the file object, with one
  of the numpy dtypes, starting at a given file position ``offset`` with
  single ``slope`` and ``intercept`` scaling to produce output values.
  
  The class ``__init__`` requires a spec which defines how the data will be
  read and rescaled. The spec may be a tuple of length 2 - 5, containing the
  shape, storage dtype, offset, slope and intercept, or a ``header`` object
  with methods:
  
  * get_data_shape
  * get_data_dtype
  * get_data_offset
  * get_slope_inter
  
  A header should also have a 'copy' method.  This requirement will go away
  when the deprecated 'header' property goes away.
  
  This implementation allows us to deal with Analyze and its variants,
  including Nifti1, and with the MGH format.
  
  Other image types might need more specific classes to implement the API.
  See :mod:`nibabel.minc1`, :mod:`nibabel.ecat` and :mod:`nibabel.parrec` for
  examples.
class_docstr_tok: ["Class","to","act","as","proxy","for","the","array","that","can","be","read","from","a","file","The","array","proxy","allows","us","to","freeze","the","passed","fileobj","and","header","such","that","it","returns","the","expected","data","array",".","This","implementation","assumes","a","contiguous","array","in","the","file","object",",","with","one","of","the","numpy","dtypes",",","starting","at","a","given","file","position","``","offset","``","with","single","``","slope","``","and","``","intercept","``","scaling","to","produce","output","values",".","The","class","``","__init__","``","requires","a","spec","which","defines","how","the","data","will","be","read","and","rescaled",".","The","spec","may","be","a","tuple","of","length","2","-","5",",","containing","the","shape",",","storage","dtype",",","offset",",","slope","and","intercept",",","or","a","``","header","``","object","with","methods",":","*","get_data_shape","*","get_data_dtype","*","get_data_offset","*","get_slope_inter","A","header","should","also","have","a","'copy","'","method",".","This","requirement","will","go","away","when","the","deprecated","'header","'","property","goes","away",".","This","implementation","allows","us","to","deal","with","Analyze","and","its","variants",",","including","Nifti1",",","and","with","the","MGH","format",".","Other","image","types","might","need","more","specific","classes","to","implement","the","API",".","See",":","mod",":","`","nibabel.minc1","`",",",":","mod",":","`","nibabel.ecat","`","and",":","mod",":","`","nibabel.parrec","`","for","examples","."]
docstr: Sets the state of this ``ArrayProxy`` during unpickling.
docstr_tok: ["Sets","the","state","of","this","``","ArrayProxy","``","during","unpickling","."]
code: def __setstate__(self, state):
      """Sets the state of this ``ArrayProxy`` during unpickling."""
      self.__dict__.update(state)
      self._lock = RLock()
  
imports: from __future__ import annotations
  import typing
  import warnings
  from contextlib import contextmanager
  from threading import RLock
  import numpy
  from .None import openers
  from .fileslice import canonical_slicers, fileslice
  from .volumeutils import apply_read_scaling, array_from_file
label_desc: Use image node_id 6 for calling the ArrayProxy obj's underlying member method code with example usage: obj.__setstate__(state) without return types