Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Sun, 2018-06-17, 23:15

All times are UTC + 1 hour

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue, 2004-11-16, 19:58 

Joined: Fri, 2004-10-29, 21:38
Posts: 2217
Location: Oldenburg, Germany
:?: Is there a tool that converts common graphic formats like PGM/PPM, PNG, TIFF, JPEG or BMP to DICOM?

:!: No, unfortunately, there is no such tool in DCMTK. Currently, you have to write your own little program for that purpose.

The following code snippet from the toolkit's documentation could be a starting point:

char uid[100];
DcmFileFormat fileformat;
DcmDataset *dataset = fileformat.getDataset();
dataset->putAndInsertString(DCM_SOPClassUID, UID_SecondaryCaptureImageStorage);
dataset->putAndInsertString(DCM_SOPInstanceUID, dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT));
dataset->putAndInsertString(DCM_PatientsName, "Doe^John");
/* ... */
dataset->putAndInsertUint8Array(DCM_PixelData, pixelData, pixelLength);
OFCondition status = fileformat.saveFile("test.dcm", EXS_LittleEndianExplicit);
if (status.bad())
  cerr << "Error: cannot write DICOM file (" << status.text() << ")" << endl;

The current snapshot of the DCMTK (> version 3.5.4) contains a new command line tool "img2dcm" that allows for converting JPEG images to certain DICOM image SOP classes.

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: No registered users 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