Using getPrivateCreator was error

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
buiductoan
Posts: 24
Joined: Thu, 2013-01-10, 16:40

Using getPrivateCreator was error

#1 Post by buiductoan »

Assume that in the my dicom file has two tags which are TAG1(PrivateCreator) and TAG2(member of TAG1). And I will write a function to get TAG2 with input condition is TAG1. That means I will use function getPrivateCreator() and compare the result with TAG1 name. But I can't get result when using getPrivateCreator() function. The application is crashed. What is happend?

Code: Select all

			DcmTag tagprivate(tag) //tag is all tags in the dicom file, maybe get by for loop
			char* pri_ele_name="";
			DcmElement* ele_priv_tag;
                        if(!tagprivate.isPrivateReservation())//get private element tag
			{
			fileformat.getDataset()->findAndGetElement(tag,ele_priv_tag);
			tagprivate=ele_priv_tag->getTag();
			 ele_priv_tag->getString(pri_ele_name);
			 cout<<tagprivate.getPrivateCreator();
			 cout<<tagprivate.getTagName()<< "....TYPE: " << tagprivate.getVRName();
			}

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Using getPrivateCreator was error

#2 Post by J. Riesmeier »

The answer should be obvious after reading the documentation.

buiductoan
Posts: 24
Joined: Thu, 2013-01-10, 16:40

Re: Using getPrivateCreator was error

#3 Post by buiductoan »

Can you explain clearly? I think in DCMTK can't get private creator of a tag.

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Using getPrivateCreator was error

#4 Post by J. Riesmeier »

From the referenced documentation: "returns the current private creator string for this object if any, NULL otherwise."

So, most probably, getPrivateCreator() returns NULL in your case and, therefore, your program crashes.

buiductoan
Posts: 24
Joined: Thu, 2013-01-10, 16:40

Re: Using getPrivateCreator was error

#5 Post by buiductoan »

Thank you. Do you know how to get private creator name of a Tag?

Post Reply

Who is online

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