I have a folder with files, but not all of them are DICOM files and I need to recognize which one is a DICOM.
My first decision was to create foreach loop where I am checking Extension:
foreach (var item in fileList.Where(x => x.Extension == ".dcm"))
{
}
But not all of them have ".dcm" and some of them do not, but they are DICOM.
I am using fo-dicom nuget package, but didn't find the answer there.
My question is: How to check all files for DICOM?
I know that Dicom file has 128 bytes free and then the last 4 bytes for "DICM", but how I can check this?