GDCM_NAME_SPACE::ElementSet Class Reference

ElementSet is based on the STL map<> container (see ElementSet::TagHT), as opposed to SQItem which is based on an STL list container (see ListDocEntry). It contains the 'zero-level- DocEntry (out of any Dicom Sequence) More...

#include <gdcmElementSet.h>

Inheritance diagram for GDCM_NAME_SPACE::ElementSet:

Inheritance graph
[legend]
Collaboration diagram for GDCM_NAME_SPACE::ElementSet:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void Print (std::ostream &os=std::cout, std::string const &indent="")
 Prints the Header Entries (Dicom Elements) from the H Table.
void WriteContent (std::ofstream *fp, FileType filetype, bool insideMetaElements)
 Writes the Header Entries (Dicom Elements) from the H Table.
bool AddEntry (DocEntry *Entry)
 add a new Dicom Element pointer to the H Table
bool RemoveEntry (DocEntry *EntryToRemove)
 Clear the hash table from given entry AND delete the entry.
void ClearEntry ()
 delete all entries in the ElementSet
DocEntryGetFirstEntry ()
 Get the first entry while visiting *the* 'zero level' DocEntrySet (DocEntries out of any Sequence).
DocEntryGetNextEntry ()
 Get the next entry while visiting *the* 'zero level' DocEntrySet (DocEntries out of any Sequence).
DocEntryGetDocEntry (uint16_t group, uint16_t elem)
 retrieves a Dicom Element using (group, element)
bool IsEmpty ()
 Tells us if the ElementSet contains no entry.
int IsVRCoherent (uint16_t group)
 Checks whether *all* the DataEntries of the group have all the same type for VR (ImplicitVR or ExplicitVR).
virtual void Copy (DocEntrySet *set)
 Copies all the attributes from an other DocEntrySet.
virtual std::string GetEntryString (uint16_t group, uint16_t elem)
 Get the "std::string representable" value of the Dicom entry.
virtual void * GetEntryBinArea (uint16_t group, uint16_t elem)
 Gets (from Header) a 'non string' element value.
virtual int GetEntryLength (uint16_t group, uint16_t elem)
 Searches within the DocEntrySet for the value length of a given tag..
DataEntryGetDataEntry (uint16_t group, uint16_t elem)
 Same as Document::GetDocEntry except it returns a result only when the corresponding entry is of type DataEntry.
SeqEntryGetSeqEntry (uint16_t group, uint16_t elem)
 Same as Document::GetDocEntry except it returns a result only when the corresponding entry is of type SeqEntry.
bool SetEntryString (std::string const &content, uint16_t group, uint16_t elem)
 Accesses an existing DocEntry (i.e. a Dicom Element) through its (group, element) and modifies its content with the given value.
bool SetEntryString (std::string const &content, DataEntry *entry)
 Accesses an existing DocEntry (i.e. a Dicom Element) and modifies its content with the given value.
bool SetEntryBinArea (uint8_t *content, int lgth, uint16_t group, uint16_t elem)
 Accesses an existing DocEntry (i.e. a Dicom Element) through its (group, element) and modifies its content with the given value.
bool SetEntryBinArea (uint8_t *content, int lgth, DataEntry *entry)
 Accesses an existing DataEntry (i.e. a Dicom Element) and modifies its content with the given value.
DataEntryInsertEntryString (std::string const &value, uint16_t group, uint16_t elem, VRKey const &vr=GDCM_VRUNKNOWN)
 Modifies the value of a given Doc Entry (Dicom Element) when it exists. Creates it with the given value when unexistant.
DataEntryInsertEntryBinArea (uint8_t *binArea, int lgth, uint16_t group, uint16_t elem, VRKey const &vr=GDCM_VRUNKNOWN)
 Modifies the value of a given Header Entry (Dicom Element) when it exists. Create it with the given value when unexistant. A copy of the binArea is made to be kept in the Document.
SeqEntryInsertSeqEntry (uint16_t group, uint16_t elem)
 Creates a new gdcm::SeqEntry and adds it to the current DocEntrySet. (remove any existing entry with same group,elem).
virtual bool CheckIfEntryExist (uint16_t group, uint16_t elem)
 Checks if a given Dicom Element exists within the DocEntrySet.
DataEntryNewDataEntry (uint16_t group, uint16_t elem, VRKey const &vr=GDCM_VRUNKNOWN)
 Build a new DataEntry from all the low level arguments.
SeqEntryNewSeqEntry (uint16_t group, uint16_t elem)
 Build a new SeqEntry from all the low level arguments.
void Delete ()
 Delete the object.
void Register ()
 Register the object.
void Unregister ()
 Unregister the object.
const unsigned long & GetRefCount () const
 Get the reference counting.
void SetPrintLevel (int level)
 Sets the print level for the Dicom Header Elements.
int GetPrintLevel ()
 Gets the print level for the Dicom Entries.

Protected Member Functions

 ElementSet ()
 Constructor for a given ElementSet.
 ~ElementSet ()
 Canonical destructor.
bool MayIWrite (uint16_t)
 Some group are illegal withing some Dicom Documents Only the Document knows it.
DictEntryGetDictEntry (uint16_t group, uint16_t elem)
 Searches [both] the public [and the shadow dictionary (when they exist)] for the presence of the DictEntry with given group and element. The public dictionary has precedence on the shadow one(s), if any.

Protected Attributes

DocEntryPreviousDocEntry
 To be able to backtrack (Private Sequence, Implicit VR related pb).
int PrintLevel
 Amount of printed details for each Dicom Entries : 0 : stands for the least detail level.

Private Member Functions

 gdcmTypeMacro (ElementSet)

Private Attributes

TagDocEntryHT TagHT
 Hash Table (map), to provide fast access.
TagDocEntryHT::iterator ItTagHT
 iterator, used to visit the TagHT variable

Detailed Description

ElementSet is based on the STL map<> container (see ElementSet::TagHT), as opposed to SQItem which is based on an STL list container (see ListDocEntry). It contains the 'zero-level- DocEntry (out of any Dicom Sequence)

Definition at line 40 of file gdcmElementSet.h.


Constructor & Destructor Documentation

GDCM_NAME_SPACE::ElementSet::ElementSet  )  [protected]
 

Constructor for a given ElementSet.

Definition at line 31 of file gdcmElementSet.cxx.

00032           : DocEntrySet()
00033 {
00034 }

GDCM_NAME_SPACE::ElementSet::~ElementSet  )  [protected]
 

Canonical destructor.

Definition at line 39 of file gdcmElementSet.cxx.

References ClearEntry().

00040 {
00041    ClearEntry();
00042 }


Member Function Documentation

bool GDCM_NAME_SPACE::ElementSet::AddEntry DocEntry newEntry  )  [virtual]
 

add a new Dicom Element pointer to the H Table

Parameters:
newEntry entry to add

Implements GDCM_NAME_SPACE::DocEntrySet.

Definition at line 101 of file gdcmElementSet.cxx.

References gdcmWarningMacro, GDCM_NAME_SPACE::DocEntry::GetKey(), and TagHT.

Referenced by GDCM_NAME_SPACE::DocEntryArchive::Push(), and GDCM_NAME_SPACE::DocEntryArchive::Restore().

00102 {
00103    const TagKey &key = newEntry->GetKey();
00104 
00105    if ( TagHT.count(key) == 1 )
00106    {
00107       gdcmWarningMacro( "Key already present: " << key );
00108       return false;
00109    }
00110    else
00111    {
00112       TagHT.insert(TagDocEntryHT::value_type(newEntry->GetKey(), newEntry));
00113       newEntry->Register();
00114       return true;
00115    }
00116 }

bool GDCM_NAME_SPACE::DocEntrySet::CheckIfEntryExist uint16_t  group,
uint16_t  elem
[virtual, inherited]
 

Checks if a given Dicom Element exists within the DocEntrySet.

Parameters:
group Group number of the searched Dicom Element
elem Element number of the searched Dicom Element
Returns:
true is found

Definition at line 412 of file gdcmDocEntrySet.cxx.

References GDCM_NAME_SPACE::DocEntrySet::GetDocEntry().

00413 {
00414    return GetDocEntry(group,elem)!=NULL;
00415 }

void GDCM_NAME_SPACE::ElementSet::ClearEntry  )  [virtual]
 

delete all entries in the ElementSet

Implements GDCM_NAME_SPACE::DocEntrySet.

Definition at line 139 of file gdcmElementSet.cxx.

References TagHT.

Referenced by Copy(), GDCM_NAME_SPACE::DicomDir::CreateDicomDir(), GDCM_NAME_SPACE::Document::DoTheLoadingDocumentJob(), GDCM_NAME_SPACE::DicomDir::SetElements(), and ~ElementSet().

00140 {
00141    for(TagDocEntryHT::iterator cc = TagHT.begin();cc != TagHT.end(); ++cc)
00142    {
00143       if ( cc->second )
00144       {
00145          cc->second->Unregister();
00146       }
00147    }
00148    TagHT.clear();
00149 }

void GDCM_NAME_SPACE::ElementSet::Copy DocEntrySet set  )  [virtual]
 

Copies all the attributes from an other DocEntrySet.

Parameters:
set entry to copy from
Remarks:
The contained DocEntries a not copied, only referenced

Reimplemented from GDCM_NAME_SPACE::DocEntrySet.

Reimplemented in GDCM_NAME_SPACE::DicomDir.

Definition at line 201 of file gdcmElementSet.cxx.

References ClearEntry(), GDCM_NAME_SPACE::DocEntrySet::Copy(), ItTagHT, and TagHT.

Referenced by GDCM_NAME_SPACE::DicomDir::Copy().

00202 {
00203    // Remove all previous entries
00204    ClearEntry();
00205 
00206    DocEntrySet::Copy(set);
00207 
00208    ElementSet *eltSet = dynamic_cast<ElementSet *>(set);
00209    if( eltSet )
00210    {
00211       TagHT = eltSet->TagHT;
00212       for(ItTagHT = TagHT.begin();ItTagHT != TagHT.end();++ItTagHT)
00213       {
00214          (ItTagHT->second)->Register();
00215       }
00216    }
00217 }

void GDCM_NAME_SPACE::RefCounter::Delete  )  [inline, inherited]
 

Delete the object.

Remarks:
The object is deleted only if its reference counting is to zero

Definition at line 41 of file gdcmRefCounter.h.

Referenced by GDCM_NAME_SPACE::SerieHelper::AddFileName(), GDCM_NAME_SPACE::Document::Backtrack(), GDCM_NAME_SPACE::FileHelper::CheckMandatoryElements(), GDCM_NAME_SPACE::FileHelper::CheckMandatoryEntry(), GDCM_NAME_SPACE::FileHelper::CopyMandatoryEntry(), GDCM_NAME_SPACE::Dict::DoTheLoadingJob(), GDCM_NAME_SPACE::FillDefaultDataDict(), GDCM_NAME_SPACE::DicomDirObject::FillObject(), vtkGdcmReader::GetFileInformation(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryBinArea(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryString(), GDCM_NAME_SPACE::DocEntrySet::InsertSeqEntry(), vtkGdcmReader::LoadFileInformation(), GDCM_NAME_SPACE::DicomDir::NewMeta(), GDCM_NAME_SPACE::DicomDirStudy::NewVisit(), GDCM_NAME_SPACE::Document::ReadNextDocEntry(), GDCM_NAME_SPACE::DicomDir::SetElement(), GDCM_NAME_SPACE::FileHelper::SetMandatoryEntry(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToExplicitVR(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToImplicitVR(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToJPEG(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToJPEG2000(), GDCM_NAME_SPACE::FileHelper::SetWriteToLibido(), GDCM_NAME_SPACE::DicomDir::~DicomDir(), GDCM_NAME_SPACE::DictSet::~DictSet(), and GDCM_NAME_SPACE::Global::~Global().

00041 { Unregister(); }

GDCM_NAME_SPACE::ElementSet::gdcmTypeMacro ElementSet   )  [private]
 

DataEntry * GDCM_NAME_SPACE::DocEntrySet::GetDataEntry uint16_t  group,
uint16_t  elem
[inherited]
 

Same as Document::GetDocEntry except it returns a result only when the corresponding entry is of type DataEntry.

Parameters:
group Group number of the searched Dicom Element
elem Element number of the searched Dicom Element
Returns:
When present, the corresponding DataEntry.

Definition at line 103 of file gdcmDocEntrySet.cxx.

References GDCM_NAME_SPACE::DocEntrySet::GetDocEntry().

Referenced by GDCM_NAME_SPACE::FileHelper::CheckMandatoryElements(), GDCM_NAME_SPACE::FileHelper::CheckMandatoryEntry(), GDCM_NAME_SPACE::Document::DoTheLoadingDocumentJob(), GDCM_NAME_SPACE::File::GetBitsAllocated(), GDCM_NAME_SPACE::File::GetBitsStored(), GDCM_NAME_SPACE::DocEntrySet::GetEntryBinArea(), GDCM_NAME_SPACE::File::GetHighBitPosition(), GDCM_NAME_SPACE::File::GetPlanarConfiguration(), GDCM_NAME_SPACE::File::GetRescaleIntercept(), GDCM_NAME_SPACE::File::GetSamplesPerPixel(), GDCM_NAME_SPACE::File::GetTSize(), GDCM_NAME_SPACE::File::GetXOrigin(), GDCM_NAME_SPACE::File::GetXSize(), GDCM_NAME_SPACE::File::GetXSpacing(), GDCM_NAME_SPACE::File::GetYOrigin(), GDCM_NAME_SPACE::File::GetYSize(), GDCM_NAME_SPACE::File::GetYSpacing(), GDCM_NAME_SPACE::File::GetZOrigin(), GDCM_NAME_SPACE::File::GetZSize(), GDCM_NAME_SPACE::File::GetZSpacing(), GDCM_NAME_SPACE::File::IsSignedPixelData(), Print(), GDCM_NAME_SPACE::DocEntrySet::SetEntryBinArea(), GDCM_NAME_SPACE::DocEntrySet::SetEntryString(), GDCM_NAME_SPACE::FileHelper::SetWriteToLibido(), GDCM_NAME_SPACE::FileHelper::SetWriteToNoLibido(), GDCM_NAME_SPACE::FileHelper::Write(), GDCM_NAME_SPACE::File::Write(), and GDCM_NAME_SPACE::DicomDirMeta::WriteContent().

00104 {
00105    DocEntry *currentEntry = GetDocEntry(group, elem);
00106    if ( !currentEntry )
00107       return NULL;
00108 
00109    return dynamic_cast<DataEntry*>(currentEntry);
00110 }

DictEntry * GDCM_NAME_SPACE::DocEntrySet::GetDictEntry uint16_t  group,
uint16_t  elem
[protected, inherited]
 

Searches [both] the public [and the shadow dictionary (when they exist)] for the presence of the DictEntry with given group and element. The public dictionary has precedence on the shadow one(s), if any.

Parameters:
group Group number of the searched DictEntry
elem Element number of the searched DictEntry
Returns:
Corresponding DictEntry when it exists, NULL otherwise.
Remarks:
The returned DictEntry is registered when existing
Todo:
store the DefaultPubDict somwhere, in order not to access the HTable every time ! --> Done!

Definition at line 473 of file gdcmDocEntrySet.cxx.

References gdcmWarningMacro, GDCM_NAME_SPACE::DictSet::GetDefaultPubDict(), GDCM_NAME_SPACE::Global::GetDicts(), GDCM_NAME_SPACE::Dict::GetEntry(), and GDCM_NAME_SPACE::RefCounter::Register().

Referenced by GDCM_NAME_SPACE::Document::ReadNextDocEntry().

00474 {
00475    DictEntry *found = 0;
00478    Dict *pubDict = Global::GetDicts()->GetDefaultPubDict();
00479    if (!pubDict) 
00480    {
00481       gdcmWarningMacro( "We SHOULD have a default dictionary");
00482    }
00483    else
00484    {
00485       found = pubDict->GetEntry(group, elem);
00486       if( found )
00487          found->Register();
00488    }
00489    return found;
00490 }

DocEntry * GDCM_NAME_SPACE::ElementSet::GetDocEntry uint16_t  group,
uint16_t  elem
[virtual]
 

retrieves a Dicom Element using (group, element)

Parameters:
group Group number of the searched Dicom Element
elem Element number of the searched Dicom Element
Returns:

Implements GDCM_NAME_SPACE::DocEntrySet.

Definition at line 186 of file gdcmElementSet.cxx.

References TagHT, and GDCM_NAME_SPACE::DictEntry::TranslateToKey().

Referenced by GDCM_NAME_SPACE::File::AnonymizeFile(), GDCM_NAME_SPACE::File::AnonymizeNoLoad(), GDCM_NAME_SPACE::FileHelper::CopyDataEntry(), GDCM_NAME_SPACE::DicomDir::CreateDicomDir(), GDCM_NAME_SPACE::File::DoTheLoadingJob(), GDCM_NAME_SPACE::DicomDir::DoTheLoadingJob(), GDCM_NAME_SPACE::File::GetPixelAreaLength(), GDCM_NAME_SPACE::File::GetPixelOffset(), GDCM_NAME_SPACE::Document::GetTransferSyntax(), GDCM_NAME_SPACE::File::HasLUT(), GDCM_NAME_SPACE::Document::IsDicomV3(), GDCM_NAME_SPACE::Document::IsPapyrus(), GDCM_NAME_SPACE::File::IsReadable(), GDCM_NAME_SPACE::Document::LoadEntryBinArea(), GDCM_NAME_SPACE::DocEntryArchive::Push(), and GDCM_NAME_SPACE::DocEntryArchive::Restore().

00187 {
00188    TagKey key = DictEntry::TranslateToKey(group, elem);
00189    TagDocEntryHT::iterator it = TagHT.find(key);
00190 
00191    if ( it!=TagHT.end() )
00192       return it->second;
00193    return NULL;
00194 }

void * GDCM_NAME_SPACE::DocEntrySet::GetEntryBinArea uint16_t  group,
uint16_t  elem
[virtual, inherited]
 

Gets (from Header) a 'non string' element value.

Parameters:
group group number of the Entry
elem element number of the Entry
Returns:
Pointer to the 'non string' area

Definition at line 73 of file gdcmDocEntrySet.cxx.

References GDCM_NAME_SPACE::DataEntry::GetBinArea(), and GDCM_NAME_SPACE::DocEntrySet::GetDataEntry().

00074 {
00075    DataEntry *entry = GetDataEntry(group, elem);
00076    if ( entry )
00077       return entry->GetBinArea();
00078    return 0;
00079 }

int GDCM_NAME_SPACE::DocEntrySet::GetEntryLength uint16_t  group,
uint16_t  elem
[virtual, inherited]
 

Searches within the DocEntrySet for the value length of a given tag..

Parameters:
group Group number of the searched tag.
elem Element number of the searched tag.
Returns:
Corresponding element length; -1 if not found

Definition at line 88 of file gdcmDocEntrySet.cxx.

References GDCM_NAME_SPACE::DocEntrySet::GetDocEntry(), and GDCM_NAME_SPACE::DocEntry::GetLength().

Referenced by GDCM_NAME_SPACE::DicomDir::SetElement(), and GDCM_NAME_SPACE::File::Write().

00089 {
00090    DocEntry *entry = GetDocEntry(group, elem);
00091    if ( entry )
00092       return entry->GetLength();
00093    return -1;
00094 }

std::string GDCM_NAME_SPACE::DocEntrySet::GetEntryString uint16_t  group,
uint16_t  elem
[virtual, inherited]
 

Get the "std::string representable" value of the Dicom entry.

Parameters:
group Group number of the searched tag.
elem Element number of the searched tag.
Returns:
Corresponding element value when it exists, and the string GDCM_UNFOUND otherwise.

Definition at line 51 of file gdcmDocEntrySet.cxx.

References GDCM_NAME_SPACE::GDCM_NOTLOADED, GDCM_NAME_SPACE::GDCM_UNFOUND, GDCM_NAME_SPACE::GDCM_UNREAD, GDCM_NAME_SPACE::DocEntrySet::GetDocEntry(), GDCM_NAME_SPACE::DataEntry::GetString(), GDCM_NAME_SPACE::DataEntry::IsNotLoaded(), GDCM_NAME_SPACE::DataEntry::IsUnfound(), and GDCM_NAME_SPACE::DataEntry::IsUnread().

Referenced by GDCM_NAME_SPACE::SerieHelper::AddFile(), GDCM_NAME_SPACE::File::AnonymizeFile(), GDCM_NAME_SPACE::FileHelper::CheckMandatoryElements(), GDCM_NAME_SPACE::SerieHelper::CreateUniqueSeriesIdentifier(), GDCM_NAME_SPACE::SerieHelper::CreateUserDefinedFileIdentifier(), GDCM_NAME_SPACE::Document::DoTheLoadingDocumentJob(), GDCM_NAME_SPACE::File::DoTheLoadingJob(), GDCM_NAME_SPACE::DirList::Explore(), GDCM_NAME_SPACE::File::GetImageNumber(), GDCM_NAME_SPACE::File::GetImageOrientationPatient(), GDCM_NAME_SPACE::File::GetImagePositionPatient(), GDCM_NAME_SPACE::File::GetLUTNbits(), GDCM_NAME_SPACE::File::GetModality(), GDCM_NAME_SPACE::File::GetNumberOfScalarComponents(), GDCM_NAME_SPACE::File::GetNumberOfScalarComponentsRaw(), GDCM_NAME_SPACE::File::GetPixelSize(), GDCM_NAME_SPACE::File::GetPixelType(), GDCM_NAME_SPACE::File::GetRescaleSlope(), GDCM_NAME_SPACE::File::GetRescaleSlopeIntercept(), GDCM_NAME_SPACE::File::GetSpacing(), GDCM_NAME_SPACE::Document::GetTransferSyntaxName(), GDCM_NAME_SPACE::File::GetXSpacing(), GDCM_NAME_SPACE::File::GetYSpacing(), GDCM_NAME_SPACE::File::IsMonochrome(), GDCM_NAME_SPACE::File::IsMonochrome1(), GDCM_NAME_SPACE::File::IsPaletteColor(), GDCM_NAME_SPACE::File::IsReadable(), GDCM_NAME_SPACE::File::IsYBRFull(), GDCM_NAME_SPACE::Document::operator<(), and GDCM_NAME_SPACE::DicomDir::SetElement().

00052 {
00053    DataEntry *entry = dynamic_cast<DataEntry *>(GetDocEntry(group,elem));
00054    if ( entry )
00055    {
00056       if( entry->IsNotLoaded() )
00057          return GDCM_NOTLOADED;
00058       if( entry->IsUnfound() )
00059          return GDCM_UNFOUND;
00060       if( entry->IsUnread() )
00061          return GDCM_UNREAD;
00062       return entry->GetString();
00063    }
00064    return GDCM_UNFOUND;
00065 }

DocEntry * GDCM_NAME_SPACE::ElementSet::GetFirstEntry  )  [virtual]
 

Get the first entry while visiting *the* 'zero level' DocEntrySet (DocEntries out of any Sequence).

Returns:
The first DocEntry if found, otherwhise NULL

Implements GDCM_NAME_SPACE::DocEntrySet.

Definition at line 156 of file gdcmElementSet.cxx.

References ItTagHT, and TagHT.

Referenced by GDCM_NAME_SPACE::Document::ComputeGroup0002Length(), GDCM_NAME_SPACE::DicomDir::DoTheLoadingJob(), GDCM_NAME_SPACE::DicomDir::NewMeta(), and GDCM_NAME_SPACE::Validator::SetInput().

00157 {
00158    ItTagHT = TagHT.begin();
00159    if (ItTagHT != TagHT.end())
00160       return  ItTagHT->second;
00161    return NULL;
00162 }

DocEntry * GDCM_NAME_SPACE::ElementSet::GetNextEntry  )  [virtual]
 

Get the next entry while visiting *the* 'zero level' DocEntrySet (DocEntries out of any Sequence).

Note:
: meaningfull only if GetFirstEntry already called
Returns:
The next DocEntry if found, otherwhise NULL

Implements GDCM_NAME_SPACE::DocEntrySet.

Definition at line 170 of file gdcmElementSet.cxx.

References gdcmAssertMacro, ItTagHT, and TagHT.

Referenced by GDCM_NAME_SPACE::Document::ComputeGroup0002Length(), and GDCM_NAME_SPACE::Validator::SetInput().

00171 {
00172    gdcmAssertMacro (ItTagHT != TagHT.end());
00173 
00174    ++ItTagHT;
00175    if (ItTagHT != TagHT.end())
00176       return  ItTagHT->second;
00177    return NULL;
00178 }

int GDCM_NAME_SPACE::Base::GetPrintLevel  )  [inline, inherited]
 

Gets the print level for the Dicom Entries.

Definition at line 50 of file gdcmBase.h.

00050 { return PrintLevel; }

const unsigned long& GDCM_NAME_SPACE::RefCounter::GetRefCount  )  const [inline, inherited]
 

Get the reference counting.

Returns:
Reference count

Definition at line 59 of file gdcmRefCounter.h.

00060    {
00061       return RefCount;
00062    }

SeqEntry * GDCM_NAME_SPACE::DocEntrySet::GetSeqEntry uint16_t  group,
uint16_t  elem
[inherited]
 

Same as Document::GetDocEntry except it returns a result only when the corresponding entry is of type SeqEntry.

Parameters:
group Group number of the searched Dicom Element
elem Element number of the searched Dicom Element
Returns:
When present, the corresponding SeqEntry.

Definition at line 119 of file gdcmDocEntrySet.cxx.

References GDCM_NAME_SPACE::DocEntrySet::GetDocEntry().

Referenced by GDCM_NAME_SPACE::Document::DoTheLoadingDocumentJob(), GDCM_NAME_SPACE::File::GetRescaleSlopeIntercept(), and GDCM_NAME_SPACE::File::GetSpacing().

00120 {
00121    DocEntry *currentEntry = GetDocEntry(group, elem);
00122    if ( !currentEntry )
00123       return NULL;
00124 
00125    return dynamic_cast<SeqEntry*>(currentEntry);
00126 }

DataEntry * GDCM_NAME_SPACE::DocEntrySet::InsertEntryBinArea uint8_t *  binArea,
int  lgth,
uint16_t  group,
uint16_t  elem,
VRKey const &  vr = GDCM_VRUNKNOWN
[inherited]
 

Modifies the value of a given Header Entry (Dicom Element) when it exists. Create it with the given value when unexistant. A copy of the binArea is made to be kept in the Document.

Parameters:
binArea (binary) value to be set
lgth length of the Bin Area we want to set
group Group number of the Entry
elem Element number of the Entry
vr V(alue) R(epresentation) of the Entry -if private Entry-
Returns:
pointer to the modified/created Header Entry (NULL when creation failed).

Definition at line 290 of file gdcmDocEntrySet.cxx.

References GDCM_NAME_SPACE::DocEntrySet::AddEntry(), GDCM_NAME_SPACE::RefCounter::Delete(), gdcmWarningMacro, GDCM_NAME_SPACE::DocEntrySet::GetDocEntry(), GDCM_NAME_SPACE::DocEntry::GetVR(), GDCM_NAME_SPACE::DocEntrySet::NewDataEntry(), GDCM_NAME_SPACE::DocEntrySet::RemoveEntry(), and GDCM_NAME_SPACE::DocEntrySet::SetEntryBinArea().

Referenced by GDCM_NAME_SPACE::FileHelper::InsertEntryBinArea().

00293 {
00294    DataEntry *dataEntry = 0;
00295    DocEntry *currentEntry = GetDocEntry( group, elem );
00296 
00297    // Verify the currentEntry
00298    if (currentEntry)
00299    {
00300       dataEntry = dynamic_cast<DataEntry *>(currentEntry);
00301 
00302       // Verify the VR
00303       if ( dataEntry )
00304          if ( dataEntry->GetVR()!=vr )
00305             dataEntry = NULL;
00306 
00307       // if currentEntry doesn't correspond to the requested dataEntry
00308       if ( !dataEntry)
00309       {
00310          if ( !RemoveEntry(currentEntry) )
00311          {
00312             gdcmWarningMacro( "Removal of previous DocEntry failed.");
00313             return NULL;
00314          }
00315       }
00316    }
00317 
00318    // Create a new dataEntry if necessary
00319    if ( !dataEntry)
00320    {
00321       dataEntry = NewDataEntry(group, elem, vr);
00322 
00323       if ( !AddEntry(dataEntry) )
00324       {
00325          gdcmWarningMacro( "AddEntry failed although this is a creation.");
00326          dataEntry->Delete();
00327          return NULL;
00328       }
00329       dataEntry->Delete();
00330    }
00331 
00332    // Set the dataEntry value
00333    uint8_t *tmpArea;
00334    if ( lgth>0 && binArea )
00335    {
00336       tmpArea = new uint8_t[lgth];
00337       memcpy(tmpArea,binArea,lgth);
00338    }
00339    else
00340    {
00341       tmpArea = 0;
00342    }
00343    if ( !SetEntryBinArea(tmpArea,lgth,dataEntry) )
00344    {
00345       if ( tmpArea )
00346       {
00347          delete[] tmpArea;
00348       }
00349    }
00350    return dataEntry;
00351 }  

DataEntry * GDCM_NAME_SPACE::DocEntrySet::InsertEntryString std::string const &  value,
uint16_t  group,
uint16_t  elem,
VRKey const &  vr = GDCM_VRUNKNOWN
[inherited]
 

Modifies the value of a given Doc Entry (Dicom Element) when it exists. Creates it with the given value when unexistant.

Parameters:
value (string) Value to be set
group Group number of the Entry
elem Element number of the Entry
vr V(alue) R(epresentation) of the Entry -if private Entry-
Returns:
pointer to the modified/created Header Entry (NULL when creation failed).

Definition at line 216 of file gdcmDocEntrySet.cxx.

References GDCM_NAME_SPACE::DocEntrySet::AddEntry(), GDCM_NAME_SPACE::RefCounter::Delete(), GDCM_NAME_SPACE::GDCM_VRUNKNOWN, gdcmWarningMacro, GDCM_NAME_SPACE::DictSet::GetDefaultPubDict(), GDCM_NAME_SPACE::Global::GetDicts(), GDCM_NAME_SPACE::DocEntrySet::GetDocEntry(), GDCM_NAME_SPACE::Dict::GetEntry(), GDCM_NAME_SPACE::DocEntry::GetKey(), GDCM_NAME_SPACE::DictEntry::GetVR(), GDCM_NAME_SPACE::DocEntry::GetVR(), GDCM_NAME_SPACE::DocEntrySet::NewDataEntry(), GDCM_NAME_SPACE::RefCounter::Register(), GDCM_NAME_SPACE::DocEntrySet::RemoveEntry(), and GDCM_NAME_SPACE::DocEntrySet::SetEntryString().

Referenced by GDCM_NAME_SPACE::FileHelper::InsertEntryString(), GDCM_NAME_SPACE::FileHelper::Write(), and GDCM_NAME_SPACE::File::Write().

00219 {
00220    DataEntry *dataEntry = 0;
00221    DocEntry *currentEntry = GetDocEntry( group, elem );
00222    VRKey localVR = vr;
00223    if (currentEntry)
00224    {
00225       dataEntry = dynamic_cast<DataEntry *>(currentEntry);
00226 
00227       // Verify the VR
00228       if ( dataEntry )
00229          if ( dataEntry->GetVR()!=vr )
00230             dataEntry = NULL;
00231 
00232       // if currentEntry doesn't correspond to the requested dataEntry
00233       if ( !dataEntry)
00234       {
00235          if ( !RemoveEntry(currentEntry) )
00236          {
00237             gdcmWarningMacro( "Removal of previous DocEntry failed.");
00238             return NULL;
00239          }
00240       }
00241    }
00242   
00243    else // the 'currentEntry' was not found
00244    {
00245       if ( vr == GDCM_VRUNKNOWN ) // user didn't specify a VR.
00246                                   //  Probabely he trusts the Dicom Dict !
00247       {
00248           DictEntry *e = 
00249             Global::GetDicts()->GetDefaultPubDict()->GetEntry(group, elem);
00250           if ( e )
00251           {
00252              localVR = e->GetVR();  
00253              e->Register(); // ?? JPRx
00254          }
00255       }
00256    }
00257 
00258    // Create a new dataEntry if necessary
00259    if ( !dataEntry )
00260    {
00261       dataEntry = NewDataEntry( group, elem, localVR );
00262 
00263       if ( !AddEntry(dataEntry) )
00264       {
00265          gdcmWarningMacro("AddEntry " << dataEntry->GetKey() 
00266                  << " failed although this is a creation.");
00267          dataEntry->Delete();
00268          return NULL;
00269       }
00270       dataEntry->Delete(); // ?!? JPRx
00271    }
00272 
00273    // Set the dataEntry value
00274    SetEntryString(value, dataEntry); // The std::string value
00275    return dataEntry;
00276 }

SeqEntry * GDCM_NAME_SPACE::DocEntrySet::InsertSeqEntry uint16_t  group,
uint16_t  elem
[inherited]
 

Creates a new gdcm::SeqEntry and adds it to the current DocEntrySet. (remove any existing entry with same group,elem).

Parameters:
group Group number of the Entry
elem Element number of the Entry
Returns:
pointer to the created SeqEntry (NULL when creation failed).

Definition at line 361 of file gdcmDocEntrySet.cxx.

References GDCM_NAME_SPACE::DocEntrySet::AddEntry(), GDCM_NAME_SPACE::RefCounter::Delete(), gdcmWarningMacro, GDCM_NAME_SPACE::DocEntrySet::GetDocEntry(), GDCM_NAME_SPACE::DocEntrySet::NewSeqEntry(), and GDCM_NAME_SPACE::DocEntrySet::RemoveEntry().

Referenced by GDCM_NAME_SPACE::FileHelper::InsertSeqEntry().

00362 {
00363    SeqEntry *seqEntry = 0;
00364    DocEntry *currentEntry = GetDocEntry( group, elem );
00365 
00366    // Verify the currentEntry
00367    if ( currentEntry )
00368    {
00369       seqEntry = dynamic_cast<SeqEntry *>(currentEntry);
00370 
00371       // Verify the VR
00372       if ( seqEntry )
00373          seqEntry = NULL;
00374 
00375       // if currentEntry doesn't correspond to the requested seqEntry
00376       if ( !seqEntry )
00377       {
00378          if (!RemoveEntry(currentEntry))
00379          {
00380             gdcmWarningMacro( "Removal of previous DocEntry failed for ("
00381                <<std::hex << group << "|" << elem <<")" );
00382             return NULL;
00383          }
00384       }
00385    }
00386    // Create a new seqEntry if necessary
00387    if ( !seqEntry )
00388    {
00389       seqEntry = NewSeqEntry(group, elem);
00390 
00391       if ( !AddEntry(seqEntry) )
00392       {
00393          gdcmWarningMacro( "AddEntry failed although this is a creation for ("
00394             <<std::hex << group << "|" << elem <<")" );
00395          seqEntry->Delete();
00396          return NULL;
00397       }
00398       seqEntry->Delete();
00399    }
00400    // Remark :
00401    // SequenceDelimitationItem will be added at the end of the SeqEntry,
00402    // at write time
00403    return seqEntry;
00404 } 

bool GDCM_NAME_SPACE::ElementSet::IsEmpty  )  [inline, virtual]
 

Tells us if the ElementSet contains no entry.

Implements GDCM_NAME_SPACE::DocEntrySet.

Definition at line 59 of file gdcmElementSet.h.

Referenced by GDCM_NAME_SPACE::Document::DoTheLoadingDocumentJob(), and GDCM_NAME_SPACE::Document::IsParsable().

00059 { return TagHT.empty(); }

int GDCM_NAME_SPACE::ElementSet::IsVRCoherent uint16_t  group  ) 
 

Checks whether *all* the DataEntries of the group have all the same type for VR (ImplicitVR or ExplicitVR).

Parameters:
group group number to be checked
Returns:
1:ImplicitVR 2:ExplicitVR -1:NotCoherent

Definition at line 225 of file gdcmElementSet.cxx.

References TagHT.

00226 {
00227    uint16_t currentGroup;
00228    int codeVR = -1;
00229    int currentCodeVR;
00230    for(TagDocEntryHT::iterator cc = TagHT.begin();cc != TagHT.end(); ++cc)
00231    {
00232       currentGroup = cc->second->GetGroup();
00233 
00234       if ( currentGroup < group )
00235          continue;   
00236       if ( currentGroup > group )
00237          break;
00238       // currentGroup == group
00239       if (codeVR == -1)
00240       {
00241          if (cc->second->IsImplicitVR() )
00242             codeVR = 1;
00243          else 
00244             codeVR = 2;
00245          continue;
00246       }
00247       else
00248       {
00249          if (cc->second->IsImplicitVR() )
00250             currentCodeVR = 1; //Implicit
00251          else 
00252             currentCodeVR = 2; // Explicit  
00253   
00254          if ( currentCodeVR == codeVR )
00255            continue;
00256          else
00257             return -1;    // -1 : not coherent 
00258       }
00259    }   
00260    return codeVR;
00261 }

bool GDCM_NAME_SPACE::ElementSet::MayIWrite uint16_t   )  [inline, protected]
 

Some group are illegal withing some Dicom Documents Only the Document knows it.

Reimplemented in GDCM_NAME_SPACE::File.

Definition at line 70 of file gdcmElementSet.h.

Referenced by WriteContent().

00071                  { return true; }

DataEntry * GDCM_NAME_SPACE::DocEntrySet::NewDataEntry uint16_t  group,
uint16_t  elem,
VRKey const &  vr = GDCM_VRUNKNOWN
[inherited]
 

Build a new DataEntry from all the low level arguments.

Parameters:
group Group number of the new Entry
elem Element number of the new Entry
vr V(alue) R(epresentation) of the new Entry
Remarks:
The user of this method must destroy the DataEntry when unused

Definition at line 425 of file gdcmDocEntrySet.cxx.

References gdcmWarningMacro, and GDCM_NAME_SPACE::DataEntry::New().

Referenced by GDCM_NAME_SPACE::FileHelper::CopyDataEntry(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryBinArea(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryString(), and GDCM_NAME_SPACE::Document::ReadNextDocEntry().

00427 {
00428 
00429    DataEntry *newEntry = DataEntry::New(group, elem, vr);
00430    if (!newEntry) 
00431    {
00432       gdcmWarningMacro( "Failed to allocate DataEntry for ("
00433           <<std::hex << group << "|" << elem <<")" );
00434       return 0;
00435    }
00436    return newEntry;
00437 }

SeqEntry * GDCM_NAME_SPACE::DocEntrySet::NewSeqEntry uint16_t  group,
uint16_t  elem
[inherited]
 

Build a new SeqEntry from all the low level arguments.

Parameters:
group Group number of the new Entry
elem Element number of the new Entry
Remarks:
The user of this method must destroy the SeqEntry when unused

Definition at line 445 of file gdcmDocEntrySet.cxx.

References gdcmWarningMacro, and GDCM_NAME_SPACE::SeqEntry::New().

Referenced by GDCM_NAME_SPACE::Document::Backtrack(), GDCM_NAME_SPACE::DocEntrySet::InsertSeqEntry(), and GDCM_NAME_SPACE::Document::ReadNextDocEntry().

00446 {
00447    //DictEntry *dictEntry = GetDictEntry(group, elem, "SQ");
00448 
00449    //SeqEntry *newEntry = SeqEntry::New( dictEntry );
00450    SeqEntry *newEntry = SeqEntry::New( group, elem );
00451    //dictEntry->Unregister(); // GetDictEntry register it
00452    if (!newEntry)
00453    {
00454       gdcmWarningMacro( "Failed to allocate SeqEntry for ("
00455          <<std::hex << group << "|" << elem <<")" );
00456       return 0;
00457    }     
00458    return newEntry;
00459 }

void GDCM_NAME_SPACE::ElementSet::Print std::ostream &  os = std::cout,
std::string const &  indent = ""
[virtual]
 

Prints the Header Entries (Dicom Elements) from the H Table.

Parameters:
os ostream to write to
indent Indentation string to be prepended during printing

Reimplemented from GDCM_NAME_SPACE::Base.

Reimplemented in GDCM_NAME_SPACE::DicomDir.

Definition at line 277 of file gdcmElementSet.cxx.

References GDCM_NAME_SPACE::DataEntry::FLAG_PIXELDATA, GDCM_NAME_SPACE::DocEntrySet::GetDataEntry(), GDCM_NAME_SPACE::Base::PrintLevel, GDCM_NAME_SPACE::DataEntry::SetFlag(), and TagHT.

Referenced by GDCM_NAME_SPACE::FileHelper::Print().

00278 {
00279    // Let's change the 'warning value' for Pixel Data,
00280    // to avoid human reader to be confused by 'gdcm::NotLoaded'.   
00281    DataEntry *pixelElement = GetDataEntry(0x7fe0,0x0010);
00282    if ( pixelElement != 0 )
00283    {
00284       pixelElement->SetFlag( DataEntry::FLAG_PIXELDATA );
00285    }
00286 
00287    for( TagDocEntryHT::const_iterator i = TagHT.begin(); i != TagHT.end(); ++i)
00288    {
00289       DocEntry *entry = i->second;
00290 
00291       entry->SetPrintLevel(PrintLevel);
00292       entry->Print(os);   
00293 
00294       if ( dynamic_cast<SeqEntry*>(entry) )
00295       {
00296          // Avoid the newline for a sequence:
00297          continue;
00298       }
00299       os << std::endl;
00300    }
00301 }

void GDCM_NAME_SPACE::RefCounter::Register  )  [inline, inherited]
 

Register the object.

Remarks:
It increments the reference counting

Definition at line 46 of file gdcmRefCounter.h.

Referenced by GDCM_NAME_SPACE::SQItem::AddEntry(), GDCM_NAME_SPACE::SeqEntry::AddSQItem(), GDCM_NAME_SPACE::SeqEntry::Copy(), GDCM_NAME_SPACE::DicomDir::Copy(), GDCM_NAME_SPACE::FileHelper::FileHelper(), GDCM_NAME_SPACE::DocEntrySet::GetDictEntry(), GDCM_NAME_SPACE::DocEntry::GetName(), GDCM_NAME_SPACE::DocEntry::GetVM(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryString(), GDCM_NAME_SPACE::CommandManager::InSetCommand(), GDCM_NAME_SPACE::DocEntryArchive::Push(), and GDCM_NAME_SPACE::SeqEntry::SetDelimitationItem().

00046 { RefCount++; }

bool GDCM_NAME_SPACE::ElementSet::RemoveEntry DocEntry entryToRemove  )  [virtual]
 

Clear the hash table from given entry AND delete the entry.

Parameters:
entryToRemove Entry to remove AND delete.

Implements GDCM_NAME_SPACE::DocEntrySet.

Definition at line 122 of file gdcmElementSet.cxx.

References GDCM_NAME_SPACE::DocEntry::GetKey(), TagHT, and GDCM_NAME_SPACE::RefCounter::Unregister().

Referenced by GDCM_NAME_SPACE::Document::Backtrack(), GDCM_NAME_SPACE::DicomDir::NewMeta(), GDCM_NAME_SPACE::DocEntryArchive::Push(), and GDCM_NAME_SPACE::DocEntryArchive::Restore().

00123 {
00124    const TagKey &key = entryToRemove->GetKey();
00125    if ( TagHT.count(key) == 1 )
00126    {
00127       TagHT.erase(key);
00128       entryToRemove->Unregister();
00129       return true;
00130    }
00131 
00132    gdcmWarningMacro( "Key not present : " << key);
00133    return false ;
00134 }

bool GDCM_NAME_SPACE::DocEntrySet::SetEntryBinArea uint8_t *  content,
int  lgth,
DataEntry entry
[inherited]
 

Accesses an existing DataEntry (i.e. a Dicom Element) and modifies its content with the given value.

Parameters:
content new value (void* -> uint8_t*) to substitute with
entry Entry to be modified
lgth new value length

Definition at line 195 of file gdcmDocEntrySet.cxx.

References GDCM_NAME_SPACE::DataEntry::SetBinArea(), and GDCM_NAME_SPACE::DocEntry::SetLength().

00196 {
00197    if (entry)
00198    {
00199       entry->SetLength(lgth);
00200       entry->SetBinArea(content);  
00201       return true;
00202    }
00203    return false;
00204 }

bool GDCM_NAME_SPACE::DocEntrySet::SetEntryBinArea uint8_t *  content,
int  lgth,
uint16_t  group,
uint16_t  elem
[inherited]
 

Accesses an existing DocEntry (i.e. a Dicom Element) through its (group, element) and modifies its content with the given value.

Parameters:
content new value (void* -> uint8_t*) to substitute with
lgth new value length
group group number of the Dicom Element to modify
elem element number of the Dicom Element to modify

Definition at line 158 of file gdcmDocEntrySet.cxx.

References gdcmWarningMacro, and GDCM_NAME_SPACE::DocEntrySet::GetDataEntry().

Referenced by GDCM_NAME_SPACE::DocEntrySet::InsertEntryBinArea(), and GDCM_NAME_SPACE::FileHelper::SetEntryBinArea().

00160 {
00161    DataEntry *entry = GetDataEntry(group, elem);
00162    if (!entry )
00163    {
00164       gdcmWarningMacro( "No corresponding DataEntry " << std::hex << group <<
00165                         "," << elem << " element (try promotion first).");
00166       return false;
00167    }
00168 
00169    return SetEntryBinArea(content,lgth,entry);
00170 } 

bool GDCM_NAME_SPACE::DocEntrySet::SetEntryString std::string const &  content,
DataEntry entry
[inherited]
 

Accesses an existing DocEntry (i.e. a Dicom Element) and modifies its content with the given value.

Parameters:
content new value (string) to substitute with
entry Entry to be modified

Definition at line 178 of file gdcmDocEntrySet.cxx.

References GDCM_NAME_SPACE::DataEntry::SetString().

00179 {
00180    if (entry)
00181    {
00182       entry->SetString(content);
00183       return true;
00184    }
00185    return false;
00186 }

bool GDCM_NAME_SPACE::DocEntrySet::SetEntryString std::string const &  content,
uint16_t  group,
uint16_t  elem
[inherited]
 

Accesses an existing DocEntry (i.e. a Dicom Element) through its (group, element) and modifies its content with the given value.

Parameters:
content new value (string) to substitute with
group group number of the Dicom Element to modify
elem element number of the Dicom Element to modify

Definition at line 136 of file gdcmDocEntrySet.cxx.

References gdcmWarningMacro, and GDCM_NAME_SPACE::DocEntrySet::GetDataEntry().

Referenced by GDCM_NAME_SPACE::File::AnonymizeFile(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryString(), and GDCM_NAME_SPACE::FileHelper::SetEntryString().

00138 {
00139    DataEntry *entry = GetDataEntry(group, elem);
00140    if (!entry )
00141    {
00142       gdcmWarningMacro( "No corresponding DataEntry " << std::hex << group <<
00143                          "," << elem << " element (try promotion first).");
00144       return false;
00145    }
00146    return SetEntryString(content,entry);
00147 }

void GDCM_NAME_SPACE::Base::SetPrintLevel int  level  )  [inline, inherited]
 

Sets the print level for the Dicom Header Elements.

Note:
0 for Light Print; 1 for 'medium' Print, 2 for Heavy Print

Definition at line 47 of file gdcmBase.h.

Referenced by GDCM_NAME_SPACE::FileHelper::Print(), and GDCM_NAME_SPACE::DicomDir::Print().

00047 { PrintLevel = level; }

void GDCM_NAME_SPACE::RefCounter::Unregister  )  [inline, inherited]
 

Unregister the object.

Remarks:
It decrements the reference counting

Definition at line 50 of file gdcmRefCounter.h.

Referenced by GDCM_NAME_SPACE::Document::ReadNextDocEntry(), GDCM_NAME_SPACE::SQItem::RemoveEntry(), RemoveEntry(), and GDCM_NAME_SPACE::FileHelper::~FileHelper().

00051    {
00052 //std::cout <<"================Unreg " << typeid(*this).name() << std::endl;
00053       RefCount--;
00054       if(RefCount<=0)
00055         delete this;
00056    }

void GDCM_NAME_SPACE::ElementSet::WriteContent std::ofstream *  fp,
FileType  filetype,
bool  dummy
[virtual]
 

Writes the Header Entries (Dicom Elements) from the H Table.

Parameters:
fp ofstream to write to
filetype ExplicitVR/ImplicitVR/ACR/ACR_LIBIDO/JPEG/JPEG2000/...

Implements GDCM_NAME_SPACE::DocEntrySet.

Definition at line 52 of file gdcmElementSet.cxx.

References GDCM_NAME_SPACE::ACR, GDCM_NAME_SPACE::ACR_LIBIDO, MayIWrite(), and TagHT.

Referenced by GDCM_NAME_SPACE::Document::WriteContent().

00053 {
00054    bool insideMetaElements     = false;
00055    bool yetOutsideMetaElements = false;
00056    
00057    for (TagDocEntryHT::const_iterator i = TagHT.begin(); 
00058                                      i != TagHT.end(); 
00059                                     ++i)
00060    {
00061         int group = (i->second)->GetGroup();
00062        
00063        if (yetOutsideMetaElements==false && group == 0x0002)
00064           insideMetaElements = true;
00065     
00066        if (insideMetaElements == true && group != 0x0002)
00067        {
00068           yetOutsideMetaElements = true;
00069           insideMetaElements     = false;
00070        }
00071    
00072        // depending on the gdcm::Document type 
00073        // (gdcm::File; gdcm::DicomDir, (more to come ?)
00074        // some groups *cannot* be present.
00075        // We hereby protect gdcm for writting stupid things
00076        // if they were found in the original document. 
00077        if ( !MayIWrite( group ) )
00078           continue;
00079   
00080       // Skip 'Group Length' element, since it may be wrong.
00081       //       except for Group 0x0002
00082       // ( keep it as well for Group 0x0008 of ACR Files, 
00083       //  since some ACR readers *need* it )
00084       
00085        if ( (i->second)->GetElement() != 0x0000 
00086            || 
00087             (  (i->second)->GetGroup() == 0x0002 
00088              ||( (filetype == ACR || filetype == ACR_LIBIDO ) && (i->second)->GetGroup() == 0x0008 ) )
00089         )
00090        {
00091              // There are DocEntries, written recursively
00092              i->second->WriteContent(fp, filetype, insideMetaElements );
00093        }             
00094    } 
00095 }


Member Data Documentation

TagDocEntryHT::iterator GDCM_NAME_SPACE::ElementSet::ItTagHT [private]
 

iterator, used to visit the TagHT variable

Definition at line 77 of file gdcmElementSet.h.

Referenced by Copy(), GetFirstEntry(), and GetNextEntry().

DocEntry* GDCM_NAME_SPACE::DocEntrySet::PreviousDocEntry [protected, inherited]
 

To be able to backtrack (Private Sequence, Implicit VR related pb).

Definition at line 128 of file gdcmDocEntrySet.h.

Referenced by GDCM_NAME_SPACE::Document::Backtrack(), and GDCM_NAME_SPACE::DocEntrySet::DocEntrySet().

int GDCM_NAME_SPACE::Base::PrintLevel [protected, inherited]
 

Amount of printed details for each Dicom Entries : 0 : stands for the least detail level.

Definition at line 55 of file gdcmBase.h.

Referenced by GDCM_NAME_SPACE::SeqEntry::Print(), GDCM_NAME_SPACE::FileHelper::Print(), Print(), GDCM_NAME_SPACE::DocEntry::Print(), GDCM_NAME_SPACE::DictEntry::Print(), GDCM_NAME_SPACE::DicomDirStudy::Print(), GDCM_NAME_SPACE::DicomDirSerie::Print(), GDCM_NAME_SPACE::DicomDirPatient::Print(), GDCM_NAME_SPACE::DicomDirMeta::Print(), GDCM_NAME_SPACE::DicomDir::Print(), and GDCM_NAME_SPACE::DataEntry::Print().

TagDocEntryHT GDCM_NAME_SPACE::ElementSet::TagHT [private]
 

Hash Table (map), to provide fast access.

Definition at line 75 of file gdcmElementSet.h.

Referenced by AddEntry(), ClearEntry(), Copy(), GetDocEntry(), GetFirstEntry(), GetNextEntry(), IsVRCoherent(), Print(), RemoveEntry(), and WriteContent().


The documentation for this class was generated from the following files:
Generated on Fri Aug 24 13:01:44 2007 for gdcm by  doxygen 1.4.6