Problem/Understanding of getInterData()

All other questions regarding DCMTK

Moderator: Moderator Team

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

Problem/Understanding of getInterData()

#1 Post by Snouty » Thu, 2012-12-13, 11:28


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,


I found my mistake. It was really quite stupid.

Best regards,


Post Reply

Who is online

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