getCount() API crashing for compressed dicom images

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
angad
Posts: 112
Joined: Thu, 2010-02-18, 09:54

getCount() API crashing for compressed dicom images

#1 Post by angad »

Hi All,

I want to calculate the pixel count from PixelData element tag.

i am using following code :

E_TransferSyntax xfer = dataset->getOriginalXfer();
DicomImage * dcmImage = new DicomImage(dataset,xfer);
const DiPixel * dmp = dcmImage->getInterData();


unsigned long pixelCount = dmp->getCount();
unsigned long pixelDataCount = dmp->getInputCount();

Its working fine for uncompressed dicom images. But for compressed dicom images, getCount() API is crashing. I understand that this problem is because of compressed images.

I don't want to uncompress these images before using getCount() API because that will be overhead.

Can anyone please help me out to use getCount() and getInputCount() API for compressed images without un compressing those images.

Thanks,
Angad Nath

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 »

Which version of the DCMTK are you using? Have you checked that the image could be processed at all (using DicomImage::getStatus())? Have you checked that "dmp" is not NULL?

angad
Posts: 112
Joined: Thu, 2010-02-18, 09:54

#3 Post by angad »

Hi,

I am using dcmtk 3.4 version. i want to use getCount() and getInputCount() API. These API's are working fine for un compressed images but crashing for compressed images.

I want to use these API's directly on compressed images.

Some one please help me out.

Thanks,
Angad nath

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 »

There is no version 3.4 - do you man 3.5.4? The current version is 3.6.0, btw.
i want to use getCount() and getInputCount() API. These API's are working fine for un compressed images but crashing for compressed images.
I can only repeat:
  1. Have you checked that the image could be processed at all (using DicomImage::getStatus())?
  2. Have you checked that "dmp" is not NULL?
I guess that you haven't registered the required decoders and, therefore, the image cannot be processed by the DicomImage constructor. That means that getStatus() returns a value that is different from EIS_Normal. So, the pointer returned by getInterData() is probably NULL - and that's the reason for you crash. Got it?

angad
Posts: 112
Joined: Thu, 2010-02-18, 09:54

#5 Post by angad »

Hi,

Sorry, i wrote 3.4. We are also using 3.5.4.

And also thanks for your help. I have not registered the required decoders.

Thanks,
Angad Nath

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest