def create_bool_mask(mask, label, ignore_label):
  """Creates a boolean mask for plant region or individual class.

  Args:
    mask: Array representing a mask with integer labels
    ignore_label: Integer, pixel value of label to exclude.
    label: String, which label to return. 'plant_region' returns mask for whole plant.
  Returns:
    Array of type numpy.bool_
  """
  if label == 'plant_region':
    bool_mask = (mask > 0) if ignore_label is None else (mask > 0) & (mask != ignore_label)
  else:
    bool_mask = (mask == ignore_label)

  return bool_mask