code: def test_multichannel(channel_axis):
      a = np.zeros((5, 5, 3))
      a[1, 1] = np.arange(1, 4)
      a = np.moveaxis(a, -1, channel_axis)
      gaussian_rgb_a = gaussian(
          a,
          sigma=1,
          mode="reflect",
          preserve_range=True,
          channel_axis=channel_axis,
      )
      # Check that the mean value is conserved in each channel
      # (color channels are not mixed together)
      spatial_axes = tuple(
          [ax for ax in range(a.ndim) if ax != channel_axis % a.ndim]
      )
      assert np.allclose(
          a.mean(axis=spatial_axes),
          gaussian_rgb_a.mean(axis=spatial_axes),
      )
  
      if channel_axis % a.ndim == 2:
          # Check that the mean value is conserved in each channel
          # (color channels are not mixed together)
          assert np.allclose(
              a.mean(axis=spatial_axes),
              gaussian_rgb_a.mean(axis=spatial_axes),
          )
      # Iterable sigma
      gaussian_rgb_a = gaussian(
          a,
          sigma=[1, 2],
          mode="reflect",
          channel_axis=channel_axis,
          preserve_range=True,
      )
      assert np.allclose(
          a.mean(axis=spatial_axes),
          gaussian_rgb_a.mean(axis=spatial_axes),
      )
  
file_path: scikit-image/skimage/filters/tests/test_gaussian.py
imports: import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from skimage._shared.utils import _supported_float_type
  from skimage.filters import difference_of_gaussians, gaussian
label_desc: Use image node_id 6 for calling a global function with example usage: test_multichannel(channel_axis) without return types