Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function pack(pixelData) {
const numPixels = pixelData.length;
log.log("numPixels: " + numPixels);
const length = getBytesForBinaryFrame(numPixels);
//log.log('getBytesForBinaryFrame: ' + length);
const bitPixelData = new Uint8Array(length);
let bytePos = 0;
for (let i = 0; i < numPixels; i++) {
// Compute byte position
bytePos = Math.floor(i / 8);
const pixValue = pixelData[i] !== 0;
//log.log('i: ' + i);
//log.log('pixValue: ' + pixValue);
valid = checkValue.length <= check;
displaylen = checkValue.length;
isString = true;
} else if (this.maxLength) {
valid = checklen <= this.maxLength;
}
var errmsg =
"Value exceeds max length, vr: " +
this.type +
", value: " +
checkValue +
", length: " +
displaylen;
if (!valid) {
if (isString) log.log(errmsg);
else throw new Error(errmsg);
}
total += checklen;
}
if (this.allowMultiple()) {
total += valarr.length ? valarr.length - 1 : 0;
}
//check for odd
var written = total;
if (total & 1) {
stream.writeHex(this.padByte);
written++;
}
return written;
}
responses.forEach(patient => {
log.log(patient);
});
});
tagNamesToEmpty.forEach(function(tag) {
var tagInfo = DicomMetaDictionary.nameMap[tag];
if (tagInfo && tagInfo.version != "PrivateTag") {
var tagNumber = tagInfo.tag,
tagString = Tag.fromPString(tagNumber).toCleanString();
if (dict[tagString]) {
log.log("empty tag " + tag);
var newValue;
if (tagString == "00100010") {
newValue = ["ANON^PATIENT"];
} else if (tagString == "00100020") {
newValue = ["ANONID"];
} else {
newValue = [];
}
dict[tagString].Value = newValue;
}
}
});
}