-
Notifications
You must be signed in to change notification settings - Fork 113
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
[mutiple Qs]: convert .jpg to .dcm, no dicom header, could't not find declaration module ''dcmjs",... #333
Comments
It looks like you are on the right track. As mentioned in the thread you linked, the generate.js example creates just a dummy file with nonsense data (an image with the value 100 at every pixel using the |
I am able to generate DICOM file from Jpeg image using below code: `
`
|
Excellent - thanks for sharing it. If you have a chance, it would be great if you could convert this into a test so that others can easily discover and learn from it, and so we can confirm that this keeps working in future versions. |
Sure Steve @pieper, I'll do it. Looks like there is an issue when setting As a workaround I used
to set PixelData |
That's great 👍
If you think that's an error in the way PixelData is handled generally maybe it's fixable. I don't think generating datasets from scratch like this has gotten a lot of testing compared to read or read/modify/write. |
Having problem in converting .jpg to .dcm. I've read about Convert jpeg file ( .jpeg ) to dicom file ( .dcm ) #85 and try it out. However there are few things I can't solve.
Q1: For the first one, I can't figure it out how this generate.js convert .jpg file to .dcm file? Isn't it just create a object and make it as the configuration dataset? And the store in buffer? There is no source or output file directory infomation in metioned article or code, that's why I got confused.
Q2: So, I tried this(most simply compy from the generate.js, I need to successfully create dicom file first and then to match my business logics later), the concept is concat the Dataset()Buffer and Image(.jpg)Buffer together to create a file, not sure is it a right way.
I can create a .dcm file successfully. But using ezDICOM open the .dcm I got
LoadData: Error reading image.
, using DICOM_Parser_Rubo I gotNo DICOM Header detected
.So I tried to find something for this issue, I found this #315
dcmjs/src/DicomDict.js
Lines 20 to 24 in 914b3dc
So dcmjs will add the header. But I don't understand why I got NO DICOM HEADER detected. And did the "Preamble" exist in the header already too?
Q3: I got this notice. However, when I altered it to
const dcmjs = require("dcmjs/build/dcmjs");
the notice was gone. I don't know which would be correct.Q4: Why use Int16Array? and Why .fill(100)
Thank you for reply.
The text was updated successfully, but these errors were encountered: