diff --git a/src/ValueRepresentation.js b/src/ValueRepresentation.js index 5b365f0c..7115aa85 100644 --- a/src/ValueRepresentation.js +++ b/src/ValueRepresentation.js @@ -68,7 +68,7 @@ function toWindows(inputArray, size) { let DicomMessage, Tag; var binaryVRs = ["FL", "FD", "SL", "SS", "UL", "US", "AT"], - explicitVRs = ["OB", "OW", "OF", "SQ", "UC", "UR", "UT", "UN"], + explicitVRs = ["OB", "OW", "OF", "SQ", "UC", "UR", "UT", "UN", "OD"], singleVRs = ["SQ", "OF", "OW", "OB", "UN"]; class ValueRepresentation { diff --git a/test/data.test.js b/test/data.test.js index c598d181..d1e62aad 100644 --- a/test/data.test.js +++ b/test/data.test.js @@ -1154,3 +1154,25 @@ it.each([ expect(value).toBe(expected); } ); + +describe('test OtherDouble ValueRepresentation', () => { + it('Treat OD as explicit VR with correct length', async () => { + const url = + "https://github.com/dcmjs-org/data/releases/download/od-encoding-data/OD-single-word-example.dcm"; + const dcmPath = await getTestDataset( + url, + "OD-single-word-example" + ); + const file = fs.readFileSync(dcmPath); + const data = dcmjs.data.DicomMessage.readFile(new Uint8Array(file).buffer); + + // expect OD VR data element (VolumetricCurveUpDirections) to be read with expected value + expect(data.dict['00701A07']).toBeTruthy(); + const odBuffer = data.dict['00701A07'].Value[0] + expect(new Uint8Array(odBuffer)).toEqual(new Uint8Array([0, 0, 0, 0, 0, 0, 0, 64])) + + // expect arbitrary tag (BlendingInputNumber, US VR) after OD VR to be read without issue + expect(data.dict['00701B02']).toBeTruthy(); + expect(data.dict['00701B02'].Value[0]).toBe(1); + }) +}); \ No newline at end of file