Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naturalize and DenaturalizeDataset failed image result #111

Open
ikhwanafath opened this issue Mar 13, 2020 · 3 comments
Open

Naturalize and DenaturalizeDataset failed image result #111

ikhwanafath opened this issue Mar 13, 2020 · 3 comments

Comments

@ikhwanafath
Copy link

I'd suggest something more like this:

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)); 

Hi Piper, after I used your code, i got the wrong image like this.

2

As you can see, the image become red flag. How to fix it ? thanks

Originally posted by @ikhwanafath in #64 (comment)

@ikhwanafath
Copy link
Author

#64 (comment)

Thats the image dicom from

@ikhwanafath
Copy link
Author

Hallo,, any answer ?

@pieper
Copy link
Collaborator

pieper commented Jun 12, 2020

Hi @ikhwanafath - I haven't had a chance to look at this - secondary captures are not something I've used dcmjs for, but I agree it would be good to fix this. Have you looked at the dicom dumps (e.g. use dcmdump from dcmtk) to see what changed? Why don't you post the before and after dumps, the dicom files, and the exact code you used so we can all look at it and figure out what's going on. This will help move the dcmjs project forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants