Parse error
Closed this issue · 9 comments
Please provide more information. A short error report will help convince me it's worth downloading files a stranger has uploaded.
DICOM Dump with Data Dictionary
I use this page to parse those files get this error.
Status:Ready - no pixel data found; file size 6.802 MB; parse time 3ms; SHA1 = 3f4d602033b499b1099ecd72ae3727848aa99147 Digital X-Ray Image Storage - For Presentation; Implicit VR Little Endian: Default Transfer Syntax for DICOM
I don't konw, Is the file standard or my setting's problem.
I try the dcm4che(A Java dicom util) to paser these files, parse successed.
This is my code.
`DicomInputStream dicomInputStream = new DicomInputStream(stream2);
Attributes attributes = dicomInputStream.readDataset(-1, -1);
attributes.setString(Tag.SpecificCharacterSet, VR.CS, "GB18030");// <======
String studyId = attributes.getString(Tag.StudyID); // study id
String studyuid = attributes.getString(Tag.StudyInstanceUID); // study uid
String seriesId = attributes.getString(Tag.SeriesInstanceUID); //series id
String instanceId = attributes.getString(Tag.SOPInstanceUID); // instance id
String seriesNumber = attributes.getString(Tag.SeriesNumber);
String instanceNumber = attributes.getString(Tag.InstanceNumber);
String patientID = attributes.getString(Tag.PatientID);
String patientName = attributes.getString(Tag.PatientName);
String bodyPart = attributes.getString(Tag.BodyPartExamined);
String modality = attributes.getString(Tag.Modality);
Date studyTime = attributes.getDate(Tag.StudyDate);
String accessionNumber = attributes.getString(Tag.AccessionNumber);
String transferSyntax = dicomInputStream.getTransferSyntax();
String patientAge = attributes.getString(Tag.PatientAge);`
I watch the source code and try to fix this problem, But failt, I have no idea yet
I took a look at this. It looks like the problem is that the file has multiple Transfer Syntax UIDs: at offset 260 there's one for JPEG Lossless, Non-Hierarchical (Process 14) and at offset 356 there's one for Implicit VR Little Endian. Given that the file is actually explicit VR little endian and that the implicit VR transfer syntax is located after the file meta information (which is invalid from a DICOM perspective), I'm assuming the second transfer syntax is a mistake. Indeed, if you delete the 26 bytes starting at offset 356, you'll find the file can be parsed properly.
So these files are not standard DICOM file, If the DCM4CHE can parse successed, we can use it's logic to deal with this problem.