pydicom.misc.is_dicom

pydicom.misc.is_dicom(file_path: Union[str, pathlib.Path]) bool[source]

Return True if the file at file_path is a DICOM file.

This function is a pared down version of read_preamble() meant for a fast return. The file is read for a conformant preamble (‘DICM’), returning True if so, and False otherwise. This is a conservative approach.

Parameters

file_path (str) – The path to the file.

See also

filereader.read_preamble, filereader.read_partial