Windows bitmap (HBITMAP) to DICOM Image.

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Posts: 51
Joined: Thu, 2014-04-10, 08:50

Windows bitmap (HBITMAP) to DICOM Image.

#1 Post by anilta » Thu, 2019-09-05, 15:41

I am trying to convert a Pathology based Cell image to DICOM image and send to PACS.
I have an existing implementation, written in Delphi, which converts the Cell's pixel data into an TBitmap, which is nothing but an encapsulation of Window's HBITMAP.

So, how can i use HBITMAP object (memory pointer) to convert into a DICOM file ?

I cannot use DCMTK's img2dcm class based design, as this class requires a file name.
I can actually store HBITMAP object on disk as a file and use this file to convert to DICOM, like this,

Code: Select all

Image2Dcm i2d;
I2DImgSource *inputPlug = new I2DBmpSource();
I2DOutputPlug *outPlug = new I2DOutputPlugSC();
E_TransferSyntax writeXfer;
DcmDataset *dataset = NULL;
OFCondition result = i2d.convert(inputPlug, outPlug, dataset, writeXfer);
But i do not want to do this because of performance issues (disk writes and deletes).

Is there any other helper classes (which i am not aware of) which can accept a BMP memory object and converts into a DICOM image ?

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

Re: Windows bitmap (HBITMAP) to DICOM Image.

#2 Post by Michael Onken » Wed, 2019-09-11, 11:33


no, right now there is no such class or method.

You could try to extend the existing img2dcm classes, e.g. add a related method to I2DBmpSource used by img2dcm to read from memory instead of a BMP file.

Best regards,

Post Reply

Who is online

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