Module Expr Str Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareNotIn NameLoad TupleLoad NameLoad NameLoad Str Str body Raise Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr IfExp CompareIs AttributeLoad NameLoad attr NameLoad Num AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr IfExp CompareIs AttributeLoad NameLoad attr NameLoad Num AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr decorator_list Call NameLoad Num FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str NameLoad keyword Num Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str With Call NameLoad AttributeLoad NameLoad attr NameStore body Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Return Call NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body With Call NameLoad AttributeLoad NameLoad attr NameStore body Assign NameStore Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Return Call NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Return NameLoad decorator_list
N/A N/A  Array proxy base class

The proxy API is - at minimum:

* The object has a read-only attribute ``shape``
* read only ``is_proxy`` attribute / property set to True
* the object returns the data array from ``np.asarray(prox)``
* returns array slice from ``prox[<slice_spec>]`` where ``<slice_spec>`` is any
  ndarray slice specification that does not use numpy 'advanced indexing'.
* modifying no object outside ``obj`` will affect the result of
  ``np.asarray(obj)``.  Specifically:

  * Changes in position (``obj.tell()``) of passed file-like objects will
    not affect the output of from ``np.asarray(proxy)``.
  * if you pass a header into the __init__, then modifying the original
    header will not affect the result of the array return.

See :mod:`nibabel.tests.test_proxy_api` for proxy API conformance checks.
 N/A warnings volumeutils array_from_file apply_read_scaling fileslice fileslice keywordonly kw_only_meth openers ImageOpener ArrayProxy N/A object N/A N/A  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 ``header`` object with methods:

    * get_data_shape
    * get_data_dtype
    * get_data_offset
    * get_slope_inter

    The header should also have a 'copy' method.  This requirement will go away
    when the deprecated 'header' propoerty 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.
     N/A order F __init__ N/A N/A self file_like header mmap N/A True N/A N/A  Initialize array proxy instance

        Parameters
        ----------
        file_like : object
            File-like object or filename. If file-like object, should implement
            at least ``read`` and ``seek``.
        header : object
            Header object implementing ``get_data_shape``, ``get_data_dtype``,
            ``get_data_offset``, ``get_slope_inter``
        mmap : {True, False, 'c', 'r'}, optional, keyword only
            `mmap` controls the use of numpy memory mapping for reading data.
            If False, do not try numpy ``memmap`` for data array.  If one of
            {'c', 'r'}, try numpy memmap with ``mode=mmap``.  A `mmap` value of
            True gives the same behavior as ``mmap='c'``.  If `file_like`
            cannot be memory-mapped, ignore `mmap` value and read array from
            file.
        scaling : {'fp', 'dv'}, optional, keyword only
            Type of scaling to use - see header ``get_data_scaling`` method.
         N/A N/A mmap N/A True False c r N/A N/A N/A ValueError mmap should be one of {True, False, 'c', 'r'} N/A N/A self file_like file_like N/A N/A self _shape N/A N/A header get_data_shape N/A N/A self _dtype N/A N/A header get_data_dtype N/A N/A self _offset N/A N/A header get_data_offset N/A N/A N/A self _slope N/A self _inter N/A N/A header get_slope_inter N/A N/A self _slope N/A N/A N/A self _slope None 1.0 N/A self _slope N/A N/A self _inter N/A N/A N/A self _inter None 0.0 N/A self _inter N/A N/A self _mmap mmap N/A N/A self _header N/A N/A header copy N/A N/A kw_only_meth 2 header N/A N/A self N/A N/A N/A N/A N/A warnings warn We will remove the header property from proxies soon FutureWarning stacklevel 2 N/A N/A self _header N/A property shape N/A N/A self N/A N/A N/A N/A self _shape N/A property is_proxy N/A N/A self N/A N/A N/A True N/A property slope N/A N/A self N/A N/A N/A N/A self _slope N/A property inter N/A N/A self N/A N/A N/A N/A self _inter N/A property offset N/A N/A self N/A N/A N/A N/A self _offset N/A property get_unscaled N/A N/A self N/A N/A N/A  Read of data from file

        This is an optional part of the proxy API
         N/A N/A ImageOpener N/A self file_like fileobj N/A N/A raw_data N/A array_from_file N/A self _shape N/A self _dtype fileobj offset N/A self _offset order N/A self order mmap N/A self _mmap N/A raw_data N/A __array__ N/A N/A self N/A N/A N/A raw_data N/A N/A self get_unscaled N/A N/A apply_read_scaling raw_data N/A self _slope N/A self _inter N/A __getitem__ N/A N/A self slicer N/A N/A N/A N/A ImageOpener N/A self file_like fileobj N/A N/A raw_data N/A fileslice fileobj slicer N/A self _shape N/A self _dtype N/A self _offset order N/A self order N/A N/A apply_read_scaling raw_data N/A self _slope N/A self _inter N/A N/A is_proxy N/A N/A obj N/A N/A N/A  Return True if `obj` is an array proxy
     N/A N/A N/A N/A obj is_proxy N/A N/A N/A AttributeError N/A N/A False N/A