Problem/Understanding of getInterData()

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Snouty
Posts: 1
Joined: Sun, 2012-10-07, 19:39

Problem/Understanding of getInterData()

#1 Post by Snouty »

Hi,

It is the first time, that I have to access the the internal pixel data. And after reading some forum threads, I know now, that I have to use the interData. But I have some trouble with the Array returned by getInterData()->getData(). I am quite sure, that the function should return a pointer to Uint16 (at least getRepresentation() gave me this information). But in my case, the returned value is NULL. I tried to allocate the memory first, but it hadnt any effect and I still got the same error. I tried to use the documentation, but couldnt solve my problem.

Sorry, I know, that it's a stupid question, but i couldnt solve it on my own.

Code: Select all

        DicomImage *image = new DicomImage(filename);
	if (image->getStatus() != EIS_Normal){
		cerr << filename << endl;
	}

	cerr<< "interdata, representation: " << image->getInterData()->getRepresentation() << endl;

	unsigned short* p = NULL;                    //new unsigned short[image->getInterData()->getCount()];
	const DiPixel* interData=image->getInterData(); 
	p =(unsigned short*)interData->getData();
 

Best regards and thanks a lot for your help,

Sabine

Edit:
I found my mistake. It was really quite stupid.


Best regards,

Sabine

Post Reply

Who is online

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