docs: def _classic_get_grouped_dicoms(dicom_input):
      """
      Search all dicoms in the dicom directory, sort and validate them
  
      fast_read = True will only read the headers not the data
      """
      # Loop overall files and build dict
      # Order all dicom files by InstanceNumber
      if [d for d in dicom_input if 'InstanceNumber' in d]:
          dicoms = sorted(dicom_input, key=lambda x: x.InstanceNumber)
      else:
          dicoms = common.sort_dicoms(dicom_input)
  
      # now group per stack
      grouped_dicoms = []
  
      # loop over all sorted dicoms
      stack_position_tag = Tag(0x0020, 0x0012)  # in this case it is the acquisition number
      for index in range(0, len(dicoms)):
          dicom_ = dicoms[index]
          if stack_position_tag not in dicom_:
              stack_index = 0
          else:
              stack_index = dicom_[stack_position_tag].value - 1
          while len(grouped_dicoms) <= stack_index:
              grouped_dicoms.append([])
          grouped_dicoms[stack_index].append(dicom_)
  
      return grouped_dicoms