class_docstr: Class for generating indices just-in-time
class_docstr_tok: ["Class","for","generating","indices","just-in-time"]
code: def __array__(self, dtype=None):
      if dtype is None:
          dtype = self.dtype
  
      axes = [np.arange(s, dtype=dtype) for s in self.gridshape]
      return np.reshape(
          np.meshgrid(*axes, copy=False, indexing="ij"), (len(axes), -1)
      ).T
  
imports: from __future__ import annotations
  import math
  import typing
  from dataclasses import dataclass, replace
  import numpy
  from nibabel.casting import able_int_type
  from nibabel.fileslice import strided_scalar
  from nibabel.spatialimages import SpatialImage
label_desc: Use image node_id 3 for calling the GridIndices obj's underlying member method code with example usage: obj.__array__(dtype) and returns: np