DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Fri, 2017-11-24, 21:33

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon, 2014-09-29, 10:19 
Offline

Joined: Mon, 2014-09-29, 09:24
Posts: 2
may I know how can I create Mutiframe DICOM Image from Single frame.
It would be very nice If get some CODE.

I have tried to create 2 frameImage Image from Single frame DICOM Image.

OFCondition status = odff.loadFile("source.dcm");
DcmDataset* dataset = odff.getDataset();
int FrameCount = 2;
dataset->putAndInsertString(DCM_NumberOfFrames, "2");

Uint8 image_buffer[5000]; // 50x50 pixels x2 frames x1 byte per pixel
int m = 0;
int i=0;
for (i=0; i<50*50; i++)
{
image_buffer[i+m] = 0; // set all pixels to black
}
// frame 1
m = 2500;
for (i=0; i<50*50; i++)
{
image_buffer[i+m] = 255; // set all pixels to white
}
DcmPixelSequence *sequence = new DcmPixelSequence(DcmTag(DCM_PixelData, EVR_OB));
for (int n=0; n<FrameCount; n++)
{
DcmPixelItem *newItem = new DcmPixelItem(DcmTag(DCM_Item, EVR_OB));
if (newItem != NULL)
{
sequence->insert(newItem);
OFCondition result = newItem->putUint8Array((Uint8 *)(&image_buffer[n*FrameCount]), FrameCount);
}
}

OFCondition status = odff.saveFile(imgfilename.str().c_str(), EXS_LittleEndianExplicit);

Any solution is highly appreciable!
Thanks :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

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


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group