code: def test_binary_erosion_error(arguments, error, match):
      """Test that binary erosion raises an error when the input is not binary."""
      with pytest.raises(error, match=match):
          binary_erosion(*arguments)
  
file_path: torchmetrics/tests/unittests/segmentation/test_utils.py
imports: import pytest
  import torch
  from monai.metrics.utils import get_code_to_measure_table
  from monai.metrics.utils import get_mask_edges
  from monai.metrics.utils import get_surface_distance
  from scipy.ndimage import binary_erosion
  from scipy.ndimage import distance_transform_cdt
  from scipy.ndimage import distance_transform_edt
  from scipy.ndimage import generate_binary_structure
  from torchmetrics.functional.segmentation.utils import binary_erosion, distance_transform, generate_binary_structure, get_neighbour_tables, mask_edges, surface_distance
label_desc: Use image node_id 3 for calling a global function with example usage: test_binary_erosion_error(arguments, error, match) without return types