how to create uncompressed multi-frame image use dcmtk?
Moderator: Moderator Team
how to create uncompressed multi-frame image use dcmtk?
hi,I am not very familiar with dcmtk, can you tell me how to create uncompressed multi-frame image use dcmtk? help.....
-
- DCMTK Developer
- Posts: 2051
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Re: how to create uncompressed multi-frame image use dcmtk?
Hi Tony,
there is no high level API to do that with DCMTK. You must start a new file and insert all required DICOM attributes yourself. How to do that in general can be found on the dcmdata documentation example page.
Use ...putAndInsert..() methods to insert all values that you need inside the dataset for your multi-frame image. Find out in part 3 of the standard which attributes you actually need to set with a valid value, must be inserted but can stay empty, or which are completely optional. The pixel data will be inside the attribute "Pixel Data".
You can use example code from the img2dcm application in DCMTK in order to see how this works for single frame images.
Finally, use a tool like dciodvfy or dcmcheck to test your resulting files.
Best,
Michael
there is no high level API to do that with DCMTK. You must start a new file and insert all required DICOM attributes yourself. How to do that in general can be found on the dcmdata documentation example page.
Use ...putAndInsert..() methods to insert all values that you need inside the dataset for your multi-frame image. Find out in part 3 of the standard which attributes you actually need to set with a valid value, must be inserted but can stay empty, or which are completely optional. The pixel data will be inside the attribute "Pixel Data".
You can use example code from the img2dcm application in DCMTK in order to see how this works for single frame images.
Finally, use a tool like dciodvfy or dcmcheck to test your resulting files.
Best,
Michael
Re: how to create uncompressed multi-frame image use dcmtk?
Thank you,Michael. Now i can create uncompressed multi-frame image if i know how many frames i want create. But if i don't know how many frames i want create,what should I do? I don't want to create a great memory to save pixel data ,then use putAndInsertUint16Array put the pixel data inside the attribute "Pixel Data"!
-
- DCMTK Developer
- Posts: 2051
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Re: how to create uncompressed multi-frame image use dcmtk?
Hi Tony,
since there is no API to add parts of a value (in your case adding frame for frame into the Pixel Data element), you must collect your binary data frame for frame, e.g. by putting each frame array into a list; then in the very end use putAndInsert... (). I don't know any other way at the moment, sorry.
HTH,
Michael
since there is no API to add parts of a value (in your case adding frame for frame into the Pixel Data element), you must collect your binary data frame for frame, e.g. by putting each frame array into a list; then in the very end use putAndInsert... (). I don't know any other way at the moment, sorry.
HTH,
Michael
-
- Posts: 4
- Joined: Fri, 2014-05-09, 08:18
Re: how to create uncompressed multi-frame image use dcmtk?
Hi Tony,
Did you end up building a tool to create a DICOM from a video? We have a need for that functionality as well and plan on working on it this week. Please let me know if you are able to assist or provide any insight.
-Mike
Did you end up building a tool to create a DICOM from a video? We have a need for that functionality as well and plan on working on it this week. Please let me know if you are able to assist or provide any insight.
-Mike
Who is online
Users browsing this forum: Google [Bot] and 1 guest