DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Sun, 2017-07-23, 05:54

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon, 2011-03-07, 11:04 
Offline

Joined: Tue, 2009-01-20, 06:56
Posts: 8
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?


Top
 Profile  
 
 Post subject:
PostPosted: Mon, 2011-03-07, 12:47 
Offline
ICSMED DICOM Services
ICSMED DICOM Services

Joined: Fri, 2004-10-29, 21:38
Posts: 2217
Location: Oldenburg, Germany
Did you specify an appropriate VOI window?


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 2011-03-08, 08:23 
Offline

Joined: Tue, 2009-01-20, 06:56
Posts: 8
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) ;


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 2011-03-08, 08:36 
Offline
ICSMED DICOM Services
ICSMED DICOM Services

Joined: Fri, 2004-10-29, 21:38
Posts: 2217
Location: Oldenburg, Germany
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:
pImage->setMinMaxWindow();


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 2011-03-08, 10:48 
Offline

Joined: Tue, 2009-01-20, 06:56
Posts: 8
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 2011-03-08, 12:28 
Offline
ICSMED DICOM Services
ICSMED DICOM Services

Joined: Fri, 2004-10-29, 21:38
Posts: 2217
Location: Oldenburg, Germany
Quote:
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.

Quote:
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 ...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

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


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group