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

DICOM Writer #264

Closed
nvd-ai opened this issue Aug 25, 2016 · 6 comments
Closed

DICOM Writer #264

nvd-ai opened this issue Aug 25, 2016 · 6 comments
Labels
question Further information is requested
Milestone

Comments

@nvd-ai
Copy link

nvd-ai commented Aug 25, 2016

Does DWV currently support manipulating and exporting DICOM files? If not, is there is plan to implement this in the future?

@ivmartel ivmartel added the question Further information is requested label Aug 26, 2016
@ivmartel ivmartel added this to the 0.17.0 milestone Aug 26, 2016
@ivmartel
Copy link
Owner

DWV has got a 'beta' class to write DICOM: dicomWriter. First written to anonymise data, it can also be used to create new data. You can see some example usage in the tests folder: dicom/anonymiser.html and dicom/generator.html. I used them to create test data, I hope they are still functional!

@nvd-ai
Copy link
Author

nvd-ai commented Aug 31, 2016

Works just fine. I can properly create a JSON object, write elements and pixel data, export and open it in a DICOM viewer. The DICOM dictionary file is very helpful. Thanks for references.

just wondering: to attach an image the default bits per pixel is 16. The images I am working with are 8bit per pixel. I changed the "BitsAllocated" in DICOM object to 8, which caused an error in the writer. My current workaround is to set "BitsStored" to 8 and "HighBit" to 7 and it works just fine. But I am guessing the generated pixel array is twice the necessary size. Do you have any suggestions for supporting 8bit images?

@ivmartel
Copy link
Owner

The generated pixel data uses 16bits. You could modify the generator to create 8bit data, check from this line generator.html#L183 to the creation of the dicomElements.x7FE00010.
It could be an option of the generator, not sure how to implement it since the JSON is only the DICOM tags.

@nvd-ai
Copy link
Author

nvd-ai commented Sep 23, 2016

It can be an input argument in the writer call. For now I got around it by keeping pixel data as 2 bytes. If I get to fix the library, I will request a pull. Closing the issue for now.

Thanks for the timely support.

@nvd-ai nvd-ai closed this as completed Sep 23, 2016
@rafasoyyo
Copy link
Contributor

I think something got broken.
Tested on version 18 with 12 diferentes images from different acquisition machines.
Error: Offset is outside the bounds of the DataView.

@ivmartel
Copy link
Owner

Thanks @rafasoyyo, could you create a new issue with this problem?

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

No branches or pull requests

3 participants