class_docstr: Class for generating indices just-in-time
class_docstr_tok: ["Class","for","generating","indices","just-in-time"]
code: def __init__(self, shape, dtype=None):
      self.gridshape = shape
      self.dtype = dtype or able_int_type(shape)
      self.shape = (math.prod(self.gridshape), len(self.gridshape))
  
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 1 to create a new GridIndices object  with example: obj = GridIndices(shape, dtype)