how to create uncompressed multi-frame image use dcmtk?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
TonyChow
Posts: 5
Joined: Mon, 2011-08-01, 02:15

how to create uncompressed multi-frame image use dcmtk?

#1 Post by TonyChow »

hi,I am not very familiar with dcmtk, can you tell me how to create uncompressed multi-frame image use dcmtk? help..... :o

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: how to create uncompressed multi-frame image use dcmtk?

#2 Post by Michael Onken »

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

TonyChow
Posts: 5
Joined: Mon, 2011-08-01, 02:15

Re: how to create uncompressed multi-frame image use dcmtk?

#3 Post by TonyChow »

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"!

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: how to create uncompressed multi-frame image use dcmtk?

#4 Post by Michael Onken »

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

mike.hogan
Posts: 4
Joined: Fri, 2014-05-09, 08:18

Re: how to create uncompressed multi-frame image use dcmtk?

#5 Post by mike.hogan »

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

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest