Skip to content

Commit

Permalink
save origin vr
Browse files Browse the repository at this point in the history
  • Loading branch information
alekschernof committed Dec 18, 2024
1 parent 33b738c commit 623f2be
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/DicomMetaDictionary.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ class DicomMetaDictionary {
// when the vr is data-dependent, keep track of the original type
naturalDataset._vrMap[naturalName] = data.vr;
}
if (data.vr !== entry.vr) {
// save origin vr if it different that in dictionary
naturalDataset._vrMap[naturalName] = data.vr;
}
}

if (data.Value === undefined) {
Expand Down Expand Up @@ -217,9 +221,13 @@ class DicomMetaDictionary {
return;
}
// process this one entry
var dataItem = ValueRepresentation.addTagAccessors({
vr: entry.vr
});
const vr =
dataset._vrMap && dataset._vrMap[naturalName]
? dataset._vrMap[naturalName]
: entry.vr;

var dataItem = ValueRepresentation.addTagAccessors({ vr });

dataItem.Value = dataset[naturalName];

if (dataValue !== null) {
Expand Down

0 comments on commit 623f2be

Please sign in to comment.