code: def test_contour_labeled_with_invalid_scalars():
      # Load a 3D label map (segmentation of a frog's tissue)
      label_map = examples.download_frog_tissue()
  
      # Nonexistent scalar key
      with pytest.raises(KeyError):
          label_map.contour_labeled(scalars="nonexistent_key")
  
      # Using cell data
      label_map.cell_data["cell_data"] = np.zeros(label_map.n_cells)
      with pytest.raises(
          ValueError, match="Can only process point data"
      ):
          label_map.contour_labeled(scalars="cell_data")
  
      # When no scalas are given and active scalars are not point data
      label_map.set_active_scalars("cell_data", preference="cell")
      with pytest.raises(
          ValueError, match="active scalars must be point array"
      ):
          label_map.contour_labeled()
  
file_path: pyvista/tests/core/test_imagedata_filters.py
imports: import numpy
  import pytest
  import pyvista
  from pyvista import examples
label_desc: Use image node_id 9 for calling a global function with example usage: test_contour_labeled_with_invalid_scalars() without return types