docstr: Test the feature: indices.
docstr_tok: ["Test","the","feature",":","indices","."]
code: def test_indices(self):
      """Test the feature: indices."""
  
      # 2D
      i = numpy.asarray([[0, 0], [0, 0]])
      e = [[0, 0], [0, 1], [1, 0], [1, 1]]
      r = indices(i)
      numpy.testing.assert_allclose(r, e, err_msg="indices: 2D failed")
  
      # 2D multi-spectral
      r = indices([i, i])
      numpy.testing.assert_allclose(
          r, e, err_msg="indices: 2D multi-spectral failed"
      )
  
      # 2D with voxelspacing
      r = indices(i, voxelspacing=(1, 2.5))
      e = [[0, 0], [0, 2.5], [1, 0], [1, 2.5]]
      numpy.testing.assert_allclose(
          r, e, err_msg="indices: 2D \w voxelspacing failed"
      )
  
      # 2D with mask
      m = [[True, False], [True, False]]
      e = [[0, 0], [1, 0]]
      r = indices(i, mask=m)
      numpy.testing.assert_allclose(
          r, e, err_msg="indices: 2D masked failed"
      )
  
      # 3D
      i = numpy.asarray([[0, 0], [0, 0]])
      i = numpy.asarray([i, i])
      e = [
          [0, 0, 0],
          [0, 0, 1],
          [0, 1, 0],
          [0, 1, 1],
          [1, 0, 0],
          [1, 0, 1],
          [1, 1, 0],
          [1, 1, 1],
      ]
      r = indices(i)
      numpy.testing.assert_allclose(r, e, err_msg="indices: 3D failed")
  
      # 4D
      i = numpy.asarray([i, i])
      e = [
          [0, 0, 0, 0],
          [0, 0, 0, 1],
          [0, 0, 1, 0],
          [0, 0, 1, 1],
          [0, 1, 0, 0],
          [0, 1, 0, 1],
          [0, 1, 1, 0],
          [0, 1, 1, 1],
          [1, 0, 0, 0],
          [1, 0, 0, 1],
          [1, 0, 1, 0],
          [1, 0, 1, 1],
          [1, 1, 0, 0],
          [1, 1, 0, 1],
          [1, 1, 1, 0],
          [1, 1, 1, 1],
      ]
      r = indices(i)
      numpy.testing.assert_allclose(r, e, err_msg="indices: 4D failed")
  
file_path: medpy/tests/features_/intensity.py
imports: import unittest
  import math
  import numpy
  from medpy.features.intensity import intensities, centerdistance, centerdistance_xdminus1, indices, local_mean_gauss, local_histogram
  from medpy.features.utilities import join, append
  from medpy.core.exceptions import ArgumentError
label_desc: Use image node_id 3 for calling the TestIntensityFeatures obj's underlying member method code with example usage: obj.test_indices() without return types