Segmentation.validate_slice#

Segmentation.validate_slice(slice_, fix_order=False)[source]#

Validate slice contains expected segments, and no extra.

Parameters:
  • slice – Segmentation slice for validation.

  • fix_order (bool) – If True will return a copy of the slice_ with fixed naming order instead of raising an error, default is False.

  • slice_ (SegmentationSlice)

Raises:

ValueError – If segments are missing, extra segments are found or naming order is different.

Return type:

SegmentationSlice