EXS_JPEGProcess14SV1TransferSyntax support

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
yinhaoscu
Posts: 8
Joined: Tue, 2009-01-20, 06:56

EXS_JPEGProcess14SV1TransferSyntax support

#1 Post by yinhaoscu »

I have a MRI dicom file with JPEG transfer syntax as mentioned above. The codes are shown below:

DJDecoderRegistration::registerCodecs();
dcmFormat.loadFile(filename);
DcmDataset *pDataSet = dcmFormat.getDataset();
pDataSet->chooseRepresentatio(EXS_JPEGProcess14SV1TransferSyntax, NULL);
DicomImage *pImage = new DicomImage(pDataSet,pDataSet>getOriginalXfer(),CIF_AcrNemaCompatibility,0,1);
if(pImage->isMonochrome())
nbits = pImage->createWindowsDIB(pData, 0, 0, 8, 1, 1);

The image could be displayed, however the contrast is very poor. I also use DicomImage writeBMP method to save it as a bmp file. The result is the same. The displayed image is not clear at all.

Any suggestions?

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

#2 Post by Jörg Riesmeier »

Did you specify an appropriate VOI window?

yinhaoscu
Posts: 8
Joined: Tue, 2009-01-20, 06:56

#3 Post by yinhaoscu »

Yes. I display the image by a CStatic component in VS2005.

CClientDC dc(&m_DcmRender);
CRect rc;
m_DcmRender.GetClientRect(&rc);
StretchDIBits (dc, 0, 0, rc.Width(), rc.Height(), 0, 0, pBitmapInfo->bmiHeader.biWidth, pBitmapInfo->bmiHeader.biHeight, pData, pBitmapInfo, DIB_RGB_COLORS, SRCCOPY) ;

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

#4 Post by Jörg Riesmeier »

No, VOI means "value of interest" in this context. For example, an automatically computed VOI window can be specified with the following code line before calling createWindowsDIB():

Code: Select all

pImage->setMinMaxWindow();

yinhaoscu
Posts: 8
Joined: Tue, 2009-01-20, 06:56

#5 Post by yinhaoscu »

Thanks a lot. It works.

Would you please say something more about why setMinMaxWindow() need to be invoked, what's its function. If I want to obtain the raw data by
Uint8 *pixelData = (Uint8 *)(pImage->getOutputData(8 ));
Shall I also call this setMinMaxWindow() method. Thanks.

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

#6 Post by Jörg Riesmeier »

Would you please say something more about why setMinMaxWindow() need to be invoked, what's its function.
What about reading the documentation? :-)

In short: If the pixel data does not use the complete range of grayscale values, you should apply an appropriate VOI window, because otherwise the rendering will result in an output image that also does not use the complete range of possible grayscale values.
If I want to obtain the raw data by
Uint8 *pixelData = (Uint8 *)(pImage->getOutputData(8 ));
This method does not return "raw data" (whatever you mean by that). The purpose of this method (and the complete DicomImage class) is visualization/rendering!

Maybe, FAQ #24 is of some interest for you ...

Post Reply

Who is online

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