You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using the below code, it works in most cases. However, for abnormal x-rays, it produces an error. (First argument to DataView constructor must be an ArrayBuffer).
While using the below code, it works in most cases. However, for abnormal x-rays, it produces an error. (First argument to DataView constructor must be an ArrayBuffer).
const dcmjs = require("dcmjs");
const fs = require("fs");
const filePath = "/Users/pieper/data/public-dicom/MRHead-multiframe+seg/MRHead-multiframe.dcm"
let arrayBuffer = fs.readFileSync(filePath).buffer;
let DicomDict = dcmjs.data.DicomMessage.readFile(arrayBuffer);
const dataset = dcmjs.data.DicomMetaDictionary.naturalizeDataset(DicomDict.dict);
dataset.PatientName = "Name^Somebody's"
DicomDict.dict = dcmjs.data.DicomMetaDictionary.denaturalizeDataset(dataset);
let new_file_WriterBuffer = DicomDict.write();
fs.writeFileSync("/tmp/file.dcm", new Buffer(new_file_WriterBuffer));
Attaching the DICOM file for reference:
https://drive.google.com/file/d/1kS_MQVVA6BJkMwhjh-dbz3fZINIAKi7r/view?usp=drive_link
The text was updated successfully, but these errors were encountered: