Skip to content

Commit

Permalink
Update test and test data.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmartel committed Nov 27, 2020
1 parent fa24140 commit 88c2a5c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
Binary file modified tests/data/dwv-test-anonymise.dcm
Binary file not shown.
1 change: 1 addition & 0 deletions tests/data/dwv-test-anonymise.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"PixelRepresentation": 0,
"Rows": 32,
"Columns": 32,
"PixelSpacing": [1,1],
"BitsAllocated": 16,
"BitsStored": 12,
"HighBit": 11,
Expand Down
22 changes: 17 additions & 5 deletions tests/dicom/dicomWriter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,22 @@ QUnit.test('Test patient anonymisation', function (assert) {
// raw tags
var rawTags = dicomParser.getRawDicomElements();
// check values
assert.equal(rawTags.x00100010.value[0], patientsName, 'patientsName');
assert.equal(rawTags.x00100020.value[0], patientID, 'patientID');
assert.equal(
rawTags.x00100030.value[0],
rawTags.x00100010.value[0].trim(),
patientsName,
'patientsName');
assert.equal(
rawTags.x00100020.value[0].trim(),
patientID,
'patientID');
assert.equal(
rawTags.x00100030.value[0].trim(),
patientsBirthDate,
'patientsBirthDate');
assert.equal(rawTags.x00100040.value[0], patientsSex, 'patientsSex');
assert.equal(
rawTags.x00100040.value[0].trim(),
patientsSex,
'patientsSex');

var dicomWriter = new dwv.dicom.DicomWriter();
dicomWriter.rules = rules;
Expand All @@ -138,7 +147,10 @@ QUnit.test('Test patient anonymisation', function (assert) {
rawTags.x00100010.value[0],
patientsNameAnonymised,
'patientName');
assert.equal(rawTags.x00100020.value[0], patientsIdAnonymised, 'patientID');
assert.equal(
rawTags.x00100020.value[0],
patientsIdAnonymised,
'patientID');
assert.notOk(rawTags.x00100030, 'patientsBirthDate');
assert.notOk(rawTags.x00100040, 'patientsSex');

Expand Down

0 comments on commit 88c2a5c

Please sign in to comment.