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?
WindowLevel on DcmDataset
Moderator: Moderator Team
-
- Posts: 347
- Joined: Mon, 2009-02-23, 19:57
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?
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?
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
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.
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.
-
- Posts: 347
- Joined: Mon, 2009-02-23, 19:57
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.
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.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest