class_docstr: Template class to implement header protocol
class_docstr_tok: ["Template","class","to","implement","header","protocol"]
docstr: Read binary image data from `fileobj`
docstr_tok: ["Read","binary","image","data","from","`","fileobj","`"]
code: def data_from_fileobj(self, fileobj: io.IOBase) -> np.ndarray:
      """Read binary image data from `fileobj`"""
      dtype = self.get_data_dtype()
      shape = self.get_data_shape()
      data_size = int(np.prod(shape) * dtype.itemsize)
      data_bytes = fileobj.read(data_size)
      return np.ndarray(
          shape, dtype, data_bytes, order=self.data_layout
      )
  
imports: from __future__ import annotations
  import io
  import typing
  from collections.abc import Sequence
  from typing import Literal
  import numpy
  from .arrayproxy import ArrayLike
  from .casting import sctypes_aliases
  from .dataobj_images import DataobjImage
  from .filebasedimages import FileBasedHeader, FileBasedImage
  from .fileholders import FileMap
  from .fileslice import canonical_slicers
  from .orientations import apply_orientation, inv_ornt_aff
  from .viewers import OrthoSlicer3D
  from .volumeutils import shape_zoom_affine
label_desc: Use image node_id 13 for calling the SpatialHeader obj's underlying member method code with example usage: obj.data_from_fileobj(fileobj) and returns: np