My question is following:
string fileName = "E:\\test \\TG-18.dcm";
DcmFileFormat fileFormat;
OFCondition status = fileFormat.loadFile(fileName.c_str());
DicomImage* pDicomImage;
DcmDataset *pDataset = fileFormat.getDataset();
E_TransferSyntax xfer = pDataset->getOriginalXfer();
pDicomImage = new DicomImage(pDataset, xfer);
//pDicomImage->setMinMaxWindow();
//pDicomImage->setWindow(0);
pDicomImage->writeBMP("E:\\test \\1.bmp");
I use the upper code to save a 'dcm' file as a 'bmp' file. when I use the function setWindow() or setMinMaxWindow(),
I will got a bmp file with some informations lost. e.g.The pixels which value is 16 are lost.
I found that the LUT got in dimoopxt.h when calculating LUT entries is a little different.
Does somebody know why?
Best Wishes!
DicomImage writeBMP() lost information
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2506
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: DicomImage writeBMP() lost information
I'm not sure what your question is. Maybe, the stored or automatically calculated VOI settings are not appropriate for this particular grayscale image (with more than 8 bits per pixel)?I use the upper code to save a 'dcm' file as a 'bmp' file. when I use the function setWindow() or setMinMaxWindow(),
I will got a bmp file with some informations lost. e.g.The pixels which value is 16 are lost.
I found that the LUT got in dimoopxt.h when calculating LUT entries is a little different.
Re: DicomImage writeBMP() lost information
when I call the function setWinodw() in DicomImage, it will call function window() to calculating LUT entries. The value 16 corresponds to 0.996336... in the lookup table.
And then when I call function createWindowsDIB(), the data I got where the value is 0.9963336... will be 0.
Is that right?
And then when I call function createWindowsDIB(), the data I got where the value is 0.9963336... will be 0.
Is that right?
-
- DCMTK Developer
- Posts: 2506
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: DicomImage writeBMP() lost information
I'm still not sure what your question is. If the input image is monochrome and has more than 8 bits per pixel, and the output image (in BMP format) supports only 256 shades of gray it should be obvious that some information is lost (grayscale values are downscaled, e.g. from 12 to 8 bits/pixel).
Re: DicomImage writeBMP() lost information
sorry, I don't know how to describe it.
I setWindow(4096, 2048), then I got a LUT which has 4096 rows. And the corresponding value of 16 is 0.996336.
But in the output image the value 0.996336 is processed into 0 instead of 1.
Is that right?
I setWindow(4096, 2048), then I got a LUT which has 4096 rows. And the corresponding value of 16 is 0.996336.
But in the output image the value 0.996336 is processed into 0 instead of 1.
Is that right?
-
- DCMTK Developer
- Posts: 2506
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: DicomImage writeBMP() lost information
There is no rounding involved. Floating point numbers are truncated (to integers) if this was the question. For visualization purposes this makes no difference.
Who is online
Users browsing this forum: Bing [Bot] and 1 guest