Closed muhammedmokbel closed 2 years ago
I already solved the problem but not totally the problem was that my Pixel data in uint8Array format but when convert it to int16Array the pixel data appear but in wrong way like this
when I try to reconstruct dicom file and adjust bit allocated and bit stored the image become more clear but the contrast is too high
Looks like you are close - maybe you just need to adjust the window center/width to match your data range.
https://github.com/dcmjs-org/dcmjs/blob/add-commander/examples/nodejs/generate.js#L83-L84
@pieper thank you so much for respond
i would like to export image in dicom file and i already used some code base in dcmjs examples to help me to create dicom file in right way
as mentioned here : https://github.com/dcmjs-org/dcmjs/blob/add-commander/examples/nodejs/generate.js
i found code base to generate dicom file and convert this file to blob after i set my pixeldata in dataset
dataset.PixelData = dataBuffer.buffer;
const newblob = Dcmjs.data.datasetToBlob(dataset)
const zip = new JSZIP()
zip.file('image.dcm', newblob)
`zip.generateAsync({ type: 'blob' }) .then(res => { saveAs(res, "newfile.zip", true) console.log(res)that's all work fine with me but when I test the zip file on microdicom the image doesn't appear