class_docstr: Some tests for local_minima are included as well.
class_docstr_tok: ["Some","tests","for","local_minima","are","included","as","well","."]
docstr: Test one- and three-dimensional case.
docstr_tok: ["Test","one-","and","three-dimensional","case","."]
code: def test_nd(self):
      """Test one- and three-dimensional case."""
      # One-dimension
      x_1d = np.array([1, 1, 0, 1, 2, 3, 0, 2, 1, 2, 0])
      expected_1d = np.array(
          [1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0], dtype=bool
      )
      result_1d = extrema.local_maxima(x_1d)
      assert result_1d.dtype == bool
      assert_equal(result_1d, expected_1d)
  
      # 3-dimensions (adapted from old unit test)
      x_3d = np.zeros((8, 8, 8), dtype=np.uint8)
      expected_3d = np.zeros((8, 8, 8), dtype=bool)
      # first maximum: only one pixel
      x_3d[1, 1:3, 1:3] = 100
      x_3d[2, 2, 2] = 200
      x_3d[3, 1:3, 1:3] = 100
      expected_3d[2, 2, 2] = 1
      # second maximum: three pixels in z-direction
      x_3d[5:8, 1, 1] = 200
      expected_3d[5:8, 1, 1] = 1
      # third: two maxima in 0 and 3.
      x_3d[0, 5:8, 5:8] = 200
      x_3d[1, 6, 6] = 100
      x_3d[2, 5:7, 5:7] = 200
      x_3d[0:3, 5:8, 5:8] += 50
      expected_3d[0, 5:8, 5:8] = 1
      expected_3d[2, 5:7, 5:7] = 1
      # four : one maximum in the corner of the square
      x_3d[6:8, 6:8, 6:8] = 200
      x_3d[7, 7, 7] = 255
      expected_3d[7, 7, 7] = 1
      result_3d = extrema.local_maxima(x_3d)
      assert result_3d.dtype == bool
      assert_equal(result_3d, expected_3d)
  
imports: import math
  import unittest
  import numpy
  from numpy.testing import assert_equal
  from pytest import raises, warns
  from skimage._shared.testing import expected_warnings
  from skimage.morphology import extrema
label_desc: Use image node_id 8 for calling the TestLocalMaxima obj's underlying member method code with example usage: obj.test_nd() without return types