code: def cube_with_strides_center(center=[0, 0, 0], strides=[4, 2, 1]):
      """Cube in an array of voxels with a given center and strides.
  
      This triangulates a cube with vertices [center[i] + 1].
  
      The dimension of the cube is determined by len(center)
      which should agree with len(center).
  
      The allowable dimensions are [1,2,3].
  
      Parameters
      ----------
      center : (d,) sequence of int, optional
         Default is [0, 0, 0]
      strides : (d,) sequence of int, optional
         Default is [4, 2, 1].  These are the strides given by
         ``np.ones((2,2,2), np.bool_).strides``
  
      Returns
      -------
      complex : dict
         A dictionary with integer keys representing a simplicial
         complex. The vertices of the simplicial complex are the indices
         of the corners of the cube in a 'flattened' array with specified
         strides.
      """
      d = len(center)
      if not 0 < d <= 3:
          raise ValueError("dimensionality must be 0 < d <= 3")
      if len(strides) != d:
          raise ValueError(
              "center and strides must have the same length"
          )
      if d == 3:
          maximal = [
              (0, 3, 2, 7),
              (0, 6, 2, 7),
              (0, 7, 5, 4),
              (0, 7, 5, 1),
              (0, 7, 4, 6),
              (0, 3, 1, 7),
          ]
          vertices = []
          for k in range(2):
              for j in range(2):
                  for i in range(2):
                      vertices.append(
                          (center[0] + i) * strides[0]
                          + (center[1] + j) * strides[1]
                          + (center[2] + k) * strides[2]
                      )
      elif d == 2:
          maximal = [(0, 1, 3), (0, 2, 3)]
          vertices = []
          for j in range(2):
              for i in range(2):
                  vertices.append(
                      (center[0] + i) * strides[0]
                      + (center[1] + j) * strides[1]
                  )
      elif d == 1:
          maximal = [(0, 1)]
          vertices = [center[0], center[0] + strides[0]]
  
      mm = []
      for m in maximal:
          nm = [vertices[j] for j in m]
          mm.append(nm)
      maximal = [tuple([vertices[j] for j in m]) for m in maximal]
      return complex(maximal)
  
file_path: nipy/nipy/algorithms/statistics/utils.py
imports: from itertools import combinations
  import numpy
  from scipy.stats import norm
label_desc: Use image node_id 5 for calling a global function with example usage: cube_with_strides_center(center, strides) and returns: complex