Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 22:03:30 $
- Version: $Revision: 1.37 $
+ Date: $Date: 2005/01/07 22:24:00 $
+ Version: $Revision: 1.40 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmValEntry.h"
#include "gdcmBinEntry.h"
-#include <assert.h>
-
namespace gdcm
{
TagName const & vr)
{
DictEntry *dictEntry = GetDictEntryByNumber(group, elem, vr);
- assert(dictEntry);
+ gdcmAssertMacro(dictEntry);
ValEntry *newEntry = new ValEntry(dictEntry);
if (!newEntry)
TagName const & vr)
{
DictEntry *dictEntry = GetDictEntryByNumber(group, elem, vr);
- assert(dictEntry);
+ gdcmAssertMacro(dictEntry);
BinEntry *newEntry = new BinEntry(dictEntry);
if (!newEntry)
SeqEntry* DocEntrySet::NewSeqEntryByNumber(uint16_t group,uint16_t elem)
{
DictEntry *dictEntry = GetDictEntryByNumber(group, elem, "SQ");
- assert(dictEntry);
+ gdcmAssertMacro(dictEntry);
SeqEntry *newEntry = new SeqEntry( dictEntry );
if (!newEntry)
{
DictEntry *dictEntry = GetDictEntryByNumber(group,elem);
DictEntry *goodEntry = dictEntry;
- std::string goodVR=vr;
+ std::string goodVR = vr;
- if (elem==0x0000)
- goodVR="UL";
+ if (elem == 0x0000) goodVR="UL";
- if (goodEntry)
- if (goodEntry->GetVR() != goodVR && goodVR!=GDCM_UNKNOWN)
- goodEntry=NULL;
+ if ( goodEntry )
+ {
+ if ( goodVR != goodEntry->GetVR()
+ && goodVR != GDCM_UNKNOWN )
+ {
+ goodEntry = NULL;
+ }
+ }
// Create a new virtual DictEntry if necessary
if (!goodEntry)
{
if (dictEntry)
- goodEntry = NewVirtualDictEntry(group, elem, goodVR,"FIXME",dictEntry->GetName());
+ {
+ goodEntry = NewVirtualDictEntry(group, elem, goodVR, "FIXME",
+ dictEntry->GetName() );
+ }
else
+ {
goodEntry = NewVirtualDictEntry(group, elem, goodVR);
+ }
}
return goodEntry;