clean_dicom#

qx_utilities.dicom.clean_dicom.clean_dicom(folder='.', tol_mm=0.2, min_files=10, verbose='yes', move_non_image=True, move_incomplete=True, _log=None)#

clean_dicom [folder=.] [min_files=10] [verbose=yes] [move_non_image=True] [move_incomplete=True]

Inspects already-sorted dicom/<seq> folders and sets aside DICOM files that hold no imaging data (to dicom/non-image) or that belong to an incomplete volume (to dicom/orphans), preventing conversion errors.

Parameters

--folder (str, default '.'):

The base session folder containing the dicom subfolder with sorted, numbered sequence subfolders.

--min_files (int, default 10):

Minimum number of imaging files a sequence must have for orphan-slice detection to run (shorter sequences are left intact).

--verbose (str, default 'yes'):

Whether to report per-sequence statistics.

--move_non_image (bool, default True):

Whether to move non-image DICOM files to dicom/non-image.

--move_incomplete (bool, default True):

Whether to move incomplete-volume/orphan files to dicom/orphans.

Notes

This is a thin, robust re-implementation over the shared single-pass classifier. Detection is scanner-aware (decision D1): mosaic acquisitions and sequences whose slice geometry cannot be inferred are reported but never pruned. The tol_mm argument from the previous implementation is accepted for backward compatibility but no longer used (slice membership is derived from per-slice geometry keys, not mm clustering). Orphan files now go to dicom/orphans (previously dicom/_REMOVED).