if ( !OpenFile(exception_on_error))
return;
ParseHeader();
+ wasUpdated = 0; // will be set to 1 if user adds an entry
LoadHeaderEntries();
CloseFile();
}
CorrectElem);
if (!NewTag) {
// This correct tag is not in the dictionary. Create a new one.
- NewTag = new gdcmDictEntry(CorrectGroup, CorrectElem);
+ NewTag = Dicts->NewVirtualDictEntry(CorrectGroup, CorrectElem);
}
// FIXME this can create a memory leaks on the old entry that be
// left unreferenced.
// be unwise to overwrite the VR of a dictionary (since it would
// compromise it's next user), we need to clone the actual DictEntry
// and change the VR for the read one.
- gdcmDictEntry* NewTag = new gdcmDictEntry(ElVal->GetGroup(),
+ gdcmDictEntry* NewTag = Dicts->NewVirtualDictEntry(ElVal->GetGroup(),
ElVal->GetElement(),
vr,
"FIXME",
// if we don't, we lost 28800 characters from the Header :-(
else if(ElVal->GetGroup() == 0xfffe){
- //printf("========================= %08x %d\n",FoundLength,FoundLength);
- // sometimes, length seems to be wrong
- //FoundLength =0; // some more clever checking to be done !
+ // sometimes, length seems to be wrong
+ FoundLength =0; // some more clever checking to be done !
+ // I give up!
+ // only gdcm-MR-PHILIPS-16-Multi-Seq.dcm
+ // causes troubles :-(
}
ElVal->SetUsableLength(FoundLength);
gdcmDictEntry * NewTag = GetDictEntryByName(Name);
if (!NewTag)
- NewTag = new gdcmDictEntry(0xffff, 0xffff, "LO", "Unknown", Name);
+ NewTag = Dicts->NewVirtualDictEntry(0xffff, 0xffff, "LO", "Unknown", Name);
gdcmHeaderEntry* NewElVal = new gdcmHeaderEntry(NewTag);
if (!NewElVal) {
// Find out if the tag we encountered is in the dictionaries:
gdcmDictEntry * NewTag = GetDictEntryByNumber(Group, Elem);
if (!NewTag)
- NewTag = new gdcmDictEntry(Group, Elem);
+ NewTag = Dicts->NewVirtualDictEntry(Group, Elem);
gdcmHeaderEntry* NewElVal = new gdcmHeaderEntry(NewTag);
if (!NewElVal) {
* \note A fake TagKey is generated so the PubDict can keep it's coherence.
* @param NewTagName The name to be given to this new tag.
* @param VR The Value Representation to be given to this new tag.
- * @ return The newly hand crafted Element Value.
+ * @return The newly hand crafted Element Value.
*/
gdcmHeaderEntry* gdcmHeader::NewManualHeaderEntryToPubDict(std::string NewTagName,
std::string VR) {
"Group 0xffff in Public Dict is full");
return (gdcmHeaderEntry*)0;
}
- NewEntry = new gdcmDictEntry(StuffGroup, FreeElem,
+ NewEntry = Dicts->NewVirtualDictEntry(StuffGroup, FreeElem,
VR, "GDCM", NewTagName);
NewElVal = new gdcmHeaderEntry(NewEntry);
PubEntrySet.Add(NewElVal);