code: def _validate_slices_form_uniform_grid(slice_datasets):
      '''
      Perform various data checks to ensure that the list of slices form a
      evenly-spaced grid of data.
      Some of these checks are probably not required if the data follows the
      DICOM specification, however it seems pertinent to check anyway.
      '''
      invariant_properties = [
          'Modality',
          'SOPClassUID',
          'SeriesInstanceUID',
          'Rows',
          'Columns',
          'PixelSpacing',
          'PixelRepresentation',
          'BitsAllocated',
          'BitsStored',
          'HighBit',
      ]
  
      for property_name in invariant_properties:
          _slice_attribute_equal(slice_datasets, property_name)
  
      _validate_image_orientation(slice_datasets[0].ImageOrientationPatient)
      _slice_ndarray_attribute_almost_equal(slice_datasets, 'ImageOrientationPatient', 1e-5)
  
      slice_positions = _slice_positions(slice_datasets)
      _check_for_missing_slices(slice_positionsf _validate_slices_form_uniform_grid(slice_datasets):
      '''
      Perform various data checks to ensure that the list of slices form a
      evenly-spaced grid of data.
      Some of these checks are probably not required if the data follows the
      DICOM specification, however it seems pertinent to check anyway.
      '''
      invariant_properties = [
          'Modality',
          'SOPClassUID',
          'SeriesInstanceUID',
          'Rows',
          'Columns',
          'PixelSpacing',
          'PixelRepresentation',
          'BitsAllocated',
          'BitsStored',
          'HighBit',
      ]
  
      for property_name in invariant_properties:
          _slice_attribute_equal(slice_datasets, property_name)
  
      _validate_image_orientation(slice_datasets[0].ImageOrientationPatient)
      _slice_ndarray_attribute_almost_equal(slice_datasets, 'ImageOrientationPatient', 1e-5)
  
      slice_positions = _slice_positions(slice_datasets)
      _check_for_missing_slices(slice_positions)
docs: Perform various data checks to ensure that the list of slices form a
      evenly-spaced grid of data.
      Some of these checks are probably not required if the data follows the
      DICOM specification, however it seems pertinent to check anyway.