pydicom.misc.is_dicom¶
- pydicom.misc.is_dicom(file_path: str | 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’), returningTrue
if so, andFalse
otherwise. This is a conservative approach.- Parameters:
file_path (str) – The path to the file.
See also
filereader.read_preamble
,filereader.read_partial