code: def test_distance_transform_inplace_indices(
      self, ndim, sampling, dtype, return_distances
  ):
      img = self._binary_image((32,) * ndim, xp=cupy, pct_true=80)
      if ndim == 3 and dtype in [cupy.int16, cupy.uint16]:
          pytest.skip(
              reason="3D requires at least 32-bit integer output"
          )
      if sampling == "iso":
          sampling = (1.5,) * ndim
      elif sampling == "aniso":
          sampling = tuple(range(1, ndim + 1))
      common_kwargs = dict(
          sampling=sampling,
          return_distances=return_distances,
          return_indices=True,
      )
      # verify that in-place and out-of-place results agree
      indices = cupy.empty((ndim,) + img.shape, dtype=dtype)
      dt_func = cupyx.scipy.ndimage.distance_transform_edt
      dt_func(img, indices=indices, **common_kwargs)
      expected = dt_func(img, **common_kwargs)
      if return_distances:
          cupy.testing.assert_array_equal(indices, expected[1])
      else:
          cupy.testing.assert_array_equal(indices, expected)
  
imports: import copy
  import numpy
  import pytest
  import cupy
  from cupy import testing
  import cupyx.scipy.ndimage
label_desc: Use image node_id 12 for calling the TestDistanceTransform obj's underlying member method code with example usage: obj.test_distance_transform_inplace_indices(ndim, sampling, dtype, return_distances) without return types