code: def _remove_duplicate_slices(dicoms):
      
      # Loop overall files and build dict
  
      dicoms_dict = {}
      filtered_dicoms = []
      for dicom_ in dicoms:
          if tuple(dicom_.ImagePositionPatient) not in dicoms_dict:
              dicoms_dict[tuple(dicom_.ImagePositionPatient)] = dicom_
              filtered_dicoms.append(dicom_)
          else:
              if numpy.array_equal(dicom_.pixel_array,
                                   dicoms_dict[tuple(dicom_.ImagePositionPatient)].pixel_array):
                  logger.warning('Removing duplicate slice from series')
              else:
                  filtered_dicoms.append(dicom_)
      return filtered_dicoms
docs: Search dicoms for localizers and delete them