exception pydicom.errors.InvalidDicomError(*args: Any)[source]

Exception that is raised when the the file does not appear to be DICOM.

Usually raised when the “DICM” prefix is not present at position 128 in the file.

To force reading the file (because maybe it is a DICOM file without a header), use dcmread(..., force=True).


Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.