docs: def _convert_slice_incement_inconsistencies(dicom_input):
      """
      If there is slice increment inconsistency detected, for the moment CT images, then split the volumes into subvolumes based on the slice increment and process each volume separately using a space constructed based on the highest resolution increment
      """
  
      #   Estimate the "first" slice increment based on the 2 first slices
      increment = numpy.array(dicom_input[0].ImagePositionPatient) - numpy.array(dicom_input[1].ImagePositionPatient)
  
      # Create as many volumes as many changes in slice increment. NB Increments might be repeated in different volumes
      max_slice_increment = 0
      slice_incement_groups = []
      current_group = [dicom_input[0], dicom_input[1]]
      previous_image_position = numpy.array(dicom_input[1].ImagePositionPatient)
      for dicom in dicom_input[2:]:
          current_image_position = numpy.array(dicom.ImagePositionPatient)
          current_increment = previous_image_position - current_image_position
          max_slice_increment = max(max_slice_increment, numpy.linalg.norm(current_increment))
          if numpy.allclose(increment, current_increment, rtol=0.05, atol=0.1):
              current_group.append(dicom)
          if not numpy.allclose(increment, current_increment, rtol=0.05, atol=0.1):
              slice_incement_groups.append(current_group)
              current_group = [current_group[-1], dicom]
              increment = current_increment
          previous_image_position = current_image_position
      slice_incement_groups.append(current_group)
  
      # Create nibabel objects for each volume based on the corresponding headers
      slice_incement_niftis = []
      for dicom_slices in slice_incement_groups:
          data = common.get_volume_pixeldata(dicom_slices)
          affine, _ = common.create_affine(dicom_slices)
          slice_incement_niftis.append(nibabel.Nifti1Image(data, affine))
  
      nifti_volume = resample.resample_nifti_images(slice_incement_niftis)
  
      return nifti_volume, max_slice_increment