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?
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();
}