Problem with Loading DICOM Image

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Santhosh_K
Posts: 2
Joined: Wed, 2011-02-02, 07:26
Location: India

Problem with Loading DICOM Image

#1 Post by Santhosh_K »

Hi Experts,
I am developing a DICOM Image Viewer application using DCMTK 3.5.4.
I am trying to load monochrome-2, RGB, monochrome-1, YCbCr images. But I could load only monochrome-2 dicom images. Can anyone help me to solve the problem?

My Code
--------
DcmFileFormat m_DcFile;
DicomImage* m_pDcmImage;
OFCondition cond = m_DcFile.loadFile(szImagePath, EXS_Unknown, EGL_withoutGL, DCM_MaxReadLength, ERM_autoDetect);
//Gets the Transfersyntax of the dicomfile
E_TransferSyntax xfer = m_DcFile.getDataset()->getOriginalXfer();
if(cond.good())
{
m_pDcmImage = new DicomImage(&m_DcFile, xfer, CIF_AcrNemaCompatibility, 0, 0);
//Gets the status of the dicomImage
if(m_pDcmImage->getStatus() != EIS_Normal)
{
AfxMessageBox((CString)m_pDcmImage->getString(m_pDcmImage->getStatus()));
}
}

I got the status code string as UNSUPPORTED DATA VALUE for the images otherthan monochrome-2.

Best Regards
Santhosh

alwittta
Posts: 111
Joined: Wed, 2006-03-15, 08:30

#2 Post by alwittta »

Hello Santhosh,

Check the transfer syntax of the IOD.
If its compressed, use the corresponding codec.

Cheers....
Alvin

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 »

If (uncompressed) color images fail to load, you probably forgot to register support for color images. The example in the documentation shows that you need to include the header file "diregist.h" for this purpose (and link the dcmimage library).

Of course, MONOCHROME1 images should not fail for this reason.

Santhosh_K
Posts: 2
Joined: Wed, 2011-02-02, 07:26
Location: India

#4 Post by Santhosh_K »

Thanks a lot alwittta and Jörg Riesmeier. We could solve the issue. Basically the problem was, our program didnt consider the compressed images. By using appropriate Codecs for each compression types we could solve it.

Post Reply

Who is online

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