Skip to content

Commit

Permalink
handle unparsable VR in DicomReader
Browse files Browse the repository at this point in the history
  • Loading branch information
rcd committed Jan 21, 2013
1 parent 2716fee commit 0a0a6d1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion DICOM/IO/Reader/DicomReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,12 @@ private void ParseDataset(IByteSource source, object state) {

byte[] bytes = source.GetBytes(2);
string vr = Encoding.UTF8.GetString(bytes, 0, bytes.Length);
_vr = DicomVR.Parse(vr);
try {
_vr = DicomVR.Parse(vr);
} catch {
// unable to parse VR
_vr = DicomVR.UN;
}
} else {
DicomDictionaryEntry entry = Dictionary[_tag];
if (entry != null) {
Expand Down

0 comments on commit 0a0a6d1

Please sign in to comment.