WindowLevel on DcmDataset

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
martinrame
Posts: 347
Joined: Mon, 2009-02-23, 19:57

WindowLevel on DcmDataset

#1 Post by martinrame »

Hi, I'm implementing printing from a Dicom Viewer. Part of my work was adding text to the pixel data I get from DcmDataset DCM_PixelData field, and it worked like a charm.

Now I would like to apply Window Level on the image, then write the text, and after that, send the image to the printer.

I usually apply Window/Level to an instance of DicomImage, for example using myDicomImg->setMinMaxWindow(). But in my current case, I'm working with the internal pixel data of DcmDataset, and don't know how can I apply W/L to it.

Does anyone knows how can I do this?

martinrame
Posts: 347
Joined: Mon, 2009-02-23, 19:57

#2 Post by martinrame »

What will happen if I use this (pseudo code):

DcmFileFormat myFF(.. load the image ..);

DicomImage myImg(myFF, myXfer, ...) // Create a DicomImage from FF
myImg.setMinMaxWindow(); // apply W/L
myImg.writeImageToDataset(myDataset);

// now add text to pixeldata
AddTextToPixelData(myDataset);

SendToPrinter(myDataset);

The question is, will the image suffer some loss of quality or its dimensions will be changed?

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#3 Post by Jörg Riesmeier »

According to the API documentation, writeImageToDataset() uses the internal representation of the pixel data, i.e. not the rendered output of the DicomImage class. Therefore, the VOI LUT transformation is not applied. However, since you need preformatted 8 or 12 bit pixel data for the DICOM print management, you might want to try writeFrameToDataset() ...

Maybe a stupid question: Why does your SendToPrinter() method expect a DICOM dataset? The DICOM print management only uses the pixel data as you probably know.

martinrame
Posts: 347
Joined: Mon, 2009-02-23, 19:57

#4 Post by martinrame »

Well, no, it doesn't need a Dataset, it was just a pseudo code I made to show how it should be the layout for my program. Now it's a little different.

I'm currently trying to implement the SentToPrinter method, that should receive a list of DicomImage and do the same job as dcmprscu, without calling it as an external command.

Post Reply

Who is online

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