I'm trying to troubleshoot the exception noted in in the Question Title, and need some assistance.
My code, with respect to this issue, is straighforward:
Dicom.Imaging.DicomImage img = new Dicom.Imaging.DicomImage(f.FullName);
img.RenderImage().Save(destDir.FullName + @"\" + f.Name + @".jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
I have several Dicom image files that work just fine, and several others that do not.
Have attempted, randomly, as I'm still a Oak DICOM newbie, several other attempts at opening the files that throw the exception. In each case the below code throws the same exception:
- Dicom.Media.DicomDirectory d = Dicom.Media.DicomDirectory.Open(f.FullName);
- Dicom.DicomFile ffff = Dicom.DicomFile.Open(f.FullName)
The inner exception / stack trace is as follows:InnerException: Dicom.DicomDataException
Message=Unhandled VR in DICOM parser observer: SQ
Source=Dicom
StackTrace:
at Dicom.IO.Reader.DicomFileReader.EndRead(IAsyncResult result) in Z:\Development\fo-dicom\DICOM\IO\Reader\DicomFileReader.cs:line 59
at Dicom.IO.Reader.DicomFileReader.Read(IByteSource source, IDicomReaderObserver fileMetaInfo, IDicomReaderObserver dataset) in Z:\Development\fo-dicom\DICOM\IO\Reader\DicomFileReader.cs:line 42
at Dicom.DicomFile.Open(String fileName) in Z:\Development\fo-dicom\DICOM\DicomFile.cs:line 143
I have compared, in RadiAnt Dicom image viewer, the VR tags in files that work, as compared to those that do not. There is a single level SQ in ones that successfully open. In the ones that do not, the following nested sequence is present:

Other minor differences existed in the VR tags, however, they were not related to an SQ code.
Is it possible that the nested SQ is causing this issue? Has anyone else observed this problem? Is there a way to read the files I have and tell the files to drop SQ areas, as I simply need to open the image portion and export the image as a jpg?