GDCM_NAME_SPACE::SeqEntry Class Reference

a SeqEntry (as opposed to a DataEntry) is a non elementary DocEntry. It is composed by a set of SQItems. Each SQItem is composed by a set of DocEntry A DocEntry may be a SeqEntry ... and so forth More...

#include <gdcmSeqEntry.h>

Inheritance diagram for GDCM_NAME_SPACE::SeqEntry:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

void Print (std::ostream &os=std::cout, std::string const &indent="")
 canonical Printer
void WriteContent (std::ofstream *fp, FileType filetype, bool insideMetaElements)
 Writes the common part of any DataEntry, SeqEntry.
uint32_t ComputeFullLength ()
 Compute the full length of the SeqEntry (not only value length) depending on the VR.
void AddSQItem (SQItem *it, int itemNumber)
 adds the passed ITEM to the ITEM chained List for this SeQuence.
void ClearSQItem ()
 Remove all SQItem.
SQItemGetFirstSQItem ()
 Get the first entry while visiting the SeqEntry.
SQItemGetNextSQItem ()
 Get the next SQItem while visiting the SeqEntry.
SQItemGetSQItem (int itemNumber)
 return a pointer to the SQItem referenced by its ordinal number. Returns the first item when argument is negative. Returns the last item when argument is bigger than the total item number.
unsigned int GetNumberOfSQItems ()
 returns the number of SQItems within the current Sequence
void SetDelimitorMode (bool dm)
 Sets the delimitor mode.
void SetDelimitationItem (DocEntry *e)
 Sets the Sequence Delimitation Item.
DocEntryGetDelimitationItem ()
 Gets the Sequence Delimitation Item.
int GetDepthLevel () const
 Gets the depth level.
void SetDepthLevel (int depth)
 Sets the depth level of a Sequence Entry embedded in a SeQuence.
virtual void Copy (DocEntry *doc)
 Copies all the attributes from an other DocEntry.
DictEntryGetDictEntry ()
 Gets the DicEntry of the current Dicom entry.
uint16_t const & GetGroup () const
 Returns the Dicom Group number of the current Dicom entry.
uint16_t const & GetElement () const
 Returns the Dicom Element number of the current Dicom entry.
TagKey const & GetKey () const
 Returns the 'key' of the current Dicom entry.
std::string const & GetName ()
 Returns the 'Name' '(e.g. "Patient's Name") found in the Dicom Dictionnary of the current Dicom Header Entry.
VRKey const & GetVR () const
 Returns the 'Value Representation' (e.g. "PN" : Person Name, "SL" : Signed Long), found in the Dicom header or in the Dicom Dictionnary, of the current Dicom entry.
std::string const & GetVM ()
 Returns the 'Value Multiplicity' (e.g. "1", "6", "1-n", "3-n"), found in the Dicom entry or in the Dicom Dictionnary of the current Dicom entry.
void SetVM (TagName &)
 Sets the 'Value Multiplicity' of the current Dicom entry.
const size_t & GetOffset () const
 Returns offset (since the beginning of the file, including the File Preamble, if any) of the value of the current Dicom entry.
void SetReadLength (uint32_t l)
 Sets only 'Read Length' (*not* 'Usable Length') of the current Dicom entry.
const uint32_t & GetReadLength () const
 Returns the 'read length' of the current Dicom entry.
virtual void SetLength (uint32_t l)
 Sets both 'Read Length' and 'Usable Length' of the current Dicom entry.
const uint32_t & GetLength () const
 Returns the actual value length of the current Dicom entry.
uint32_t GetFullLength ()
 Gets the full length of the elementary DocEntry (not only value length) depending on the VR.
void SetOffset (size_t of)
 Sets the offset of the Dicom entry.
void SetImplicitVR ()
 Sets to TRUE the ImplicitVr flag of the current Dicom entry.
void SetVR (VRKey const &vr)
void SetTag (TagKey const &key)
bool IsImplicitVR () const
 Tells us if the current Dicom entry was checked as ImplicitVr.
bool IsVRUnknown () const
 Tells us if the VR of the current Dicom entry is Unknown.
bool IsVMUnknown ()
 Tells us if the VM of the current Dicom entry is Unknown.
bool IsItemDelimitor ()
 tells us if entry is the last one of a 'no length' SequenceItem (fffe,e00d)
bool IsItemStarter ()
 tells us if entry is the last one of a 'no length' Sequence (fffe,e0dd)
bool IsSequenceDelimitor ()
 tells us if entry is the last one of a 'no length' Sequence (fffe,e0dd)
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.

Static Public Member Functions

static SeqEntryNew (DocEntry *d, int depth)
 Contructs a SeqEntry with a RefCounter from DocEntry.
static SeqEntryNew (uint16_t group, uint16_t elem)
 Constructs a SeqEntry with a RefCounter from elementary values.

Protected Attributes

DictEntryDicomDict
 pointer to the underlying Dicom dictionary element
uint32_t Length
 Corresponds to the real length of the data This length might always be even.
uint32_t ReadLength
 Length to read in the file to obtain data.
bool ImplicitVR
 Even when reading explicit vr files, some elements happen to be implicit. Flag them here since we can't use the entry->vr without breaking the underlying dictionary.
size_t Offset
 Offset from the beginning of file for direct user access.
VRKey VR
 Value Representation (to avoid accessing Dicom Dict every time!).
TagKey Key
 Dicom TagKey. Contains Dicom Group number and Dicom Element number (to avoid accessing Dicom Dict every time !) // JPRx.
int PrintLevel
 Amount of printed details for each Dicom Entries : 0 : stands for the least detail level.

Private Member Functions

 gdcmTypeMacro (SeqEntry)
 SeqEntry (DocEntry *d, int depth)
 Constructor from a given DocEntry.
 SeqEntry (uint16_t group, uint16_t elem)
 Constructor from a given SeqEntry.
 ~SeqEntry ()
 Canonical destructor.

Private Attributes

bool DelimitorMode
 If this Sequence is in delimitor mode (length =0xffffffff) or not.
ListSQItem Items
 Chained list of SQ Items.
ListSQItem::iterator ItSQItem
 iterator on the SQItems of the current SeqEntry
DocEntrySeqTerm
 sequence terminator item
int SQDepthLevel
 Defines the depth level of this SeqEntry inside the (optionaly) nested sequences. SQDepthLevel and its SQItem::SQDepthLevel counterpart are only defined on printing purposes (see Print).

Detailed Description

a SeqEntry (as opposed to a DataEntry) is a non elementary DocEntry. It is composed by a set of SQItems. Each SQItem is composed by a set of DocEntry A DocEntry may be a SeqEntry ... and so forth

Definition at line 40 of file gdcmSeqEntry.h.


Constructor & Destructor Documentation

GDCM_NAME_SPACE::SeqEntry::SeqEntry DocEntry e,
int  depth
[private]
 

Constructor from a given DocEntry.

Parameters:
e Pointer to existing Doc entry
depth depth level of the current Seq entry

Definition at line 55 of file gdcmSeqEntry.cxx.

References GDCM_NAME_SPACE::DocEntry::GetOffset(), GDCM_NAME_SPACE::DocEntry::ImplicitVR, GDCM_NAME_SPACE::DocEntry::IsImplicitVR(), GDCM_NAME_SPACE::DocEntry::Length, GDCM_NAME_SPACE::DocEntry::Offset, GDCM_NAME_SPACE::DocEntry::ReadLength, SeqTerm, and SQDepthLevel.

00056                : DocEntry( e->GetDictEntry() )
00057             : DocEntry( e->GetGroup(), e->GetElement(), "SQ" /*e->GetVR()*/ )
00058 {
00059    Length       = 0;
00060    ReadLength   = 0xffffffff;
00061    SQDepthLevel = depth;
00062 
00063    ImplicitVR   = e->IsImplicitVR();
00064    Offset       = e->GetOffset();
00065    SeqTerm = NULL;
00066 }

GDCM_NAME_SPACE::SeqEntry::SeqEntry uint16_t  group,
uint16_t  elem
[private]
 

Constructor from a given SeqEntry.

Definition at line 39 of file gdcmSeqEntry.cxx.

References DelimitorMode, GDCM_NAME_SPACE::DocEntry::Length, GDCM_NAME_SPACE::DocEntry::ReadLength, SeqTerm, and SQDepthLevel.

00040              : DocEntry(group, elem, "SQ")
00041 {
00042    Length       = 0;
00043    ReadLength   = 0xffffffff;
00044    SQDepthLevel = -1;
00045 
00046    DelimitorMode = false;
00047    SeqTerm  = NULL;
00048 }

GDCM_NAME_SPACE::SeqEntry::~SeqEntry  )  [private]
 

Canonical destructor.

Definition at line 71 of file gdcmSeqEntry.cxx.

References ClearSQItem().

00072 {
00073    ClearSQItem();
00074 }


Member Function Documentation

void GDCM_NAME_SPACE::SeqEntry::AddSQItem SQItem sqItem,
int  itemNumber
 

adds the passed ITEM to the ITEM chained List for this SeQuence.

Parameters:
sqItem SQItem to be pushed back in the SeqEntry
itemNumber ordinal number of the SQItem
Note:
NOT end-user intendend method !

Definition at line 131 of file gdcmSeqEntry.cxx.

References Items, GDCM_NAME_SPACE::RefCounter::Register(), and GDCM_NAME_SPACE::SQItem::SetSQItemNumber().

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

00132 {
00133 // FIXME : SQItemNumber is supposed to be the ordinal number of the SQItem
00134 //         within the Sequence.
00135 //         Either only 'push_back' is allowed, 
00136 //                and we just have to do something like SeqEntry::lastNb++
00137 //         Or we can add (or remove) anywhere, and SQItemNumber will be broken
00138    sqItem->SetSQItemNumber(itemNumber);
00139    Items.push_back(sqItem);
00140    sqItem->Register();
00141 }

void GDCM_NAME_SPACE::SeqEntry::ClearSQItem  ) 
 

Remove all SQItem.

Definition at line 146 of file gdcmSeqEntry.cxx.

References Items.

Referenced by Copy(), and ~SeqEntry().

00147 {
00148    for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc)
00149    {
00150       (*cc)->Unregister();
00151    }
00152    if (SeqTerm)
00153    {
00154       SeqTerm->Unregister();
00155    }
00156 }

uint32_t GDCM_NAME_SPACE::SeqEntry::ComputeFullLength  )  [virtual]
 

Compute the full length of the SeqEntry (not only value length) depending on the VR.

Implements GDCM_NAME_SPACE::DocEntry.

Definition at line 112 of file gdcmSeqEntry.cxx.

References Items.

00113 {
00114    uint32_t l = 12; // Tag (4) + VR (explicit) 4 + 4 (length);   
00115    for(ListSQItem::iterator cc  = Items.begin();
00116                             cc != Items.end();
00117                           ++cc)
00118    {        
00119       l += (*cc)->ComputeFullLength();
00120    }   
00121    l += 8; // seq_term Tag (4) +  seq_term_lg (4)
00122    return l;
00123 }

void GDCM_NAME_SPACE::SeqEntry::Copy DocEntry doc  )  [virtual]
 

Copies all the attributes from an other DocEntry.

Parameters:
doc entry to copy from
Remarks:
The contained SQItems a not copied, only referenced

Reimplemented from GDCM_NAME_SPACE::DocEntry.

Definition at line 241 of file gdcmSeqEntry.cxx.

References ClearSQItem(), GDCM_NAME_SPACE::DocEntry::Copy(), DelimitorMode, Items, ItSQItem, GDCM_NAME_SPACE::RefCounter::Register(), SeqTerm, and SQDepthLevel.

00242 {
00243    // Delete previous SQ items
00244    ClearSQItem();
00245 
00246    DocEntry::Copy(doc);
00247    SeqEntry *entry = dynamic_cast<SeqEntry *>(doc);
00248    if ( entry )
00249    {
00250       DelimitorMode = entry->DelimitorMode;
00251       SQDepthLevel = entry->SQDepthLevel;
00252 
00253       SeqTerm = entry->SeqTerm;
00254       if(SeqTerm)
00255          SeqTerm->Register();
00256       Items = entry->Items;
00257       for(ItSQItem = Items.begin();ItSQItem != Items.end(); ++ItSQItem)
00258       {
00259          (*ItSQItem)->Register();
00260       }
00261    }
00262 }

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::SeqEntry::gdcmTypeMacro SeqEntry   )  [private]
 

DocEntry* GDCM_NAME_SPACE::SeqEntry::GetDelimitationItem  )  [inline]
 

Gets the Sequence Delimitation Item.

Definition at line 70 of file gdcmSeqEntry.h.

00070 { return SeqTerm;}

int GDCM_NAME_SPACE::SeqEntry::GetDepthLevel  )  const [inline]
 

Gets the depth level.

Definition at line 73 of file gdcmSeqEntry.h.

00073 { return SQDepthLevel; }

DictEntry* GDCM_NAME_SPACE::DocEntry::GetDictEntry  )  [inline, inherited]
 

Gets the DicEntry of the current Dicom entry.

Returns:
The DicEntry of the current Dicom entry

Definition at line 49 of file gdcmDocEntry.h.

00049 { return DicomDict; } 

uint16_t const& GDCM_NAME_SPACE::DocEntry::GetElement  )  const [inline, inherited]
 

Returns the Dicom Element number of the current Dicom entry.

Definition at line 56 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::Document::Backtrack(), GDCM_NAME_SPACE::Document::ComputeGroup0002Length(), GDCM_NAME_SPACE::DicomDirMeta::ComputeGroup0002Length(), GDCM_NAME_SPACE::Document::FixDocEntryFoundLength(), GDCM_NAME_SPACE::DataEntry::GetValue(), GDCM_NAME_SPACE::Document::IsDocEntryAnInteger(), GDCM_NAME_SPACE::Document::LoadDocEntry(), GDCM_NAME_SPACE::Document::LoadEntryBinArea(), GDCM_NAME_SPACE::DocEntry::Print(), GDCM_NAME_SPACE::DocEntryArchive::Push(), and GDCM_NAME_SPACE::DocEntry::WriteContent().

00056 { return Key[1];}   

SQItem * GDCM_NAME_SPACE::SeqEntry::GetFirstSQItem  ) 
 

Get the first entry while visiting the SeqEntry.

Returns:
The first SQItem if found, otherwhise NULL

Definition at line 162 of file gdcmSeqEntry.cxx.

References Items, and ItSQItem.

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

00163 {
00164    ItSQItem = Items.begin();
00165    if (ItSQItem != Items.end())
00166       return *ItSQItem;
00167    return NULL;
00168 } 

uint32_t GDCM_NAME_SPACE::DocEntry::GetFullLength  )  [inherited]
 

Gets the full length of the elementary DocEntry (not only value length) depending on the VR.

Definition at line 227 of file gdcmDocEntry.cxx.

References GDCM_NAME_SPACE::DocEntry::GetReadLength(), GDCM_NAME_SPACE::DocEntry::GetVR(), and GDCM_NAME_SPACE::DocEntry::IsImplicitVR().

Referenced by GDCM_NAME_SPACE::DataEntry::ComputeFullLength().

00228 {
00229    uint32_t l = GetReadLength();
00230    if ( IsImplicitVR() )
00231    {
00232       l = l + 8;  // 2 (gr) + 2 (el) + 4 (lgth) 
00233    }
00234    else
00235    {
00236       if ( GetVR()=="OB" || GetVR()=="OW" || GetVR()=="SQ" )
00237       {
00238          l = l + 12; // 2 (gr) + 2 (el) + 2 (vr) + 2 (unused) + 4 (lgth)
00239       }
00240       else
00241       {
00242          l = l + 8;  // 2 (gr) + 2 (el) + 2 (vr) + 2 (lgth)
00243       }
00244    }
00245    return l;
00246 }

uint16_t const& GDCM_NAME_SPACE::DocEntry::GetGroup  )  const [inline, inherited]
 

Returns the Dicom Group number of the current Dicom entry.

Definition at line 52 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::Document::Backtrack(), GDCM_NAME_SPACE::Document::ComputeGroup0002Length(), GDCM_NAME_SPACE::DicomDirMeta::ComputeGroup0002Length(), GDCM_NAME_SPACE::Document::FixDocEntryFoundLength(), GDCM_NAME_SPACE::DataEntry::GetValue(), GDCM_NAME_SPACE::Document::IsDocEntryAnInteger(), GDCM_NAME_SPACE::Document::LoadDocEntry(), GDCM_NAME_SPACE::Document::LoadEntryBinArea(), GDCM_NAME_SPACE::DocEntry::Print(), GDCM_NAME_SPACE::DataEntry::Print(), GDCM_NAME_SPACE::DocEntryArchive::Push(), GDCM_NAME_SPACE::Document::SkipToNextDocEntry(), GDCM_NAME_SPACE::DocEntry::WriteContent(), and GDCM_NAME_SPACE::DataEntry::WriteContent().

00052 { return Key[0];  }

TagKey const& GDCM_NAME_SPACE::DocEntry::GetKey  )  const [inline, inherited]
 

Returns the 'key' of the current Dicom entry.

Definition at line 60 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::ElementSet::AddEntry(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryString(), GDCM_NAME_SPACE::Document::ParseDES(), GDCM_NAME_SPACE::DocEntryArchive::Push(), GDCM_NAME_SPACE::Document::ReadNextDocEntry(), GDCM_NAME_SPACE::SQItem::RemoveEntry(), GDCM_NAME_SPACE::ElementSet::RemoveEntry(), GDCM_NAME_SPACE::Validator::SetInput(), and GDCM_NAME_SPACE::DataEntry::WriteContent().

00060 { return Key; }   

const uint32_t& GDCM_NAME_SPACE::DocEntry::GetLength  )  const [inline, inherited]
 

Returns the actual value length of the current Dicom entry.

Warning:
this value is not *always* the one stored in the Dicom header in case of well known bugs

Definition at line 102 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::Document::Backtrack(), GDCM_NAME_SPACE::Document::ComputeGroup0002Length(), GDCM_NAME_SPACE::DicomDirMeta::ComputeGroup0002Length(), GDCM_NAME_SPACE::DataEntry::Copy(), GDCM_NAME_SPACE::Document::DoTheLoadingDocumentJob(), GDCM_NAME_SPACE::DocEntrySet::GetEntryLength(), GDCM_NAME_SPACE::File::GetPixelAreaLength(), GDCM_NAME_SPACE::DataEntry::GetValue(), GDCM_NAME_SPACE::DataEntry::GetValueCount(), GDCM_NAME_SPACE::Document::IsDocEntryAnInteger(), GDCM_NAME_SPACE::Document::LoadDocEntry(), GDCM_NAME_SPACE::Document::LoadEntryBinArea(), GDCM_NAME_SPACE::DataEntry::NewBinArea(), GDCM_NAME_SPACE::DataEntry::Print(), GDCM_NAME_SPACE::Document::SkipDocEntry(), GDCM_NAME_SPACE::DocEntry::WriteContent(), and GDCM_NAME_SPACE::DataEntry::WriteContent().

00102 { return Length; }

std::string const & GDCM_NAME_SPACE::DocEntry::GetName  )  [inherited]
 

Returns the 'Name' '(e.g. "Patient's Name") found in the Dicom Dictionnary of the current Dicom Header Entry.

Definition at line 192 of file gdcmDocEntry.cxx.

References GDCM_NAME_SPACE::DocEntry::DicomDict, GDCM_NAME_SPACE::GDCM_UNKNOWN, GDCM_NAME_SPACE::DictSet::GetDefaultPubDict(), GDCM_NAME_SPACE::Global::GetDicts(), GDCM_NAME_SPACE::Dict::GetEntry(), GDCM_NAME_SPACE::DictEntry::GetName(), GDCM_NAME_SPACE::DocEntry::Key, and GDCM_NAME_SPACE::RefCounter::Register().

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

00193 { 
00194    if (DicomDict == 0)
00195       DicomDict =
00196                  Global::GetDicts()->GetDefaultPubDict()->GetEntry(Key[0],Key[1]);
00197    if (DicomDict == 0)
00198       return GDCM_UNKNOWN;
00199    else
00200    {
00201       DicomDict->Register();
00202       return DicomDict->GetName();
00203    }
00204 }

SQItem * GDCM_NAME_SPACE::SeqEntry::GetNextSQItem  ) 
 

Get the next SQItem while visiting the SeqEntry.

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

Definition at line 176 of file gdcmSeqEntry.cxx.

References gdcmAssertMacro, Items, and ItSQItem.

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

00177 {
00178    gdcmAssertMacro (ItSQItem != Items.end())
00179    {
00180       ++ItSQItem;
00181       if (ItSQItem != Items.end())
00182          return *ItSQItem;
00183    }
00184    return NULL;
00185 }

unsigned int GDCM_NAME_SPACE::SeqEntry::GetNumberOfSQItems  ) 
 

returns the number of SQItems within the current Sequence

Definition at line 215 of file gdcmSeqEntry.cxx.

References Items.

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

00216 {
00217    return Items.size();
00218 }

const size_t& GDCM_NAME_SPACE::DocEntry::GetOffset  )  const [inline, inherited]
 

Returns offset (since the beginning of the file, including the File Preamble, if any) of the value of the current Dicom entry.

Warning:
offset of the *value*, not of the Dicom entry

Definition at line 85 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::Document::Backtrack(), GDCM_NAME_SPACE::File::DoTheLoadingJob(), GDCM_NAME_SPACE::File::GetPixelOffset(), GDCM_NAME_SPACE::Document::LoadEntryBinArea(), GDCM_NAME_SPACE::DocEntry::Print(), SeqEntry(), and GDCM_NAME_SPACE::Document::SkipToNextDocEntry().

00085 { return Offset; }

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 uint32_t& GDCM_NAME_SPACE::DocEntry::GetReadLength  )  const [inline, inherited]
 

Returns the 'read length' of the current Dicom entry.

Warning:
this value is the one stored in the Dicom header but not mandatoryly the one thats's used (in case of SQ, or delimiters, the usable length is set to zero)

Definition at line 94 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::DocEntry::GetFullLength(), Print(), GDCM_NAME_SPACE::DocEntry::Print(), GDCM_NAME_SPACE::Document::SkipToNextDocEntry(), and WriteContent().

00094 { return ReadLength; }

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    }

SQItem * GDCM_NAME_SPACE::SeqEntry::GetSQItem int  itemNumber  ) 
 

return a pointer to the SQItem referenced by its ordinal number. Returns the first item when argument is negative. Returns the last item when argument is bigger than the total item number.

Definition at line 193 of file gdcmSeqEntry.cxx.

References Items.

00194 {
00195    if (nb<0)
00196    {
00197       return *(Items.begin());
00198    }
00199    int count = 0 ;
00200    for(ListSQItem::iterator cc = Items.begin();
00201                            cc != Items.end();
00202                            count ++, ++cc)
00203    {
00204       if (count == nb)
00205       {
00206          return *cc;
00207       }
00208    }
00209    return *(Items.end());
00210 }

std::string const & GDCM_NAME_SPACE::DocEntry::GetVM  )  [inherited]
 

Returns the 'Value Multiplicity' (e.g. "1", "6", "1-n", "3-n"), found in the Dicom entry or in the Dicom Dictionnary of the current Dicom entry.

Definition at line 209 of file gdcmDocEntry.cxx.

References GDCM_NAME_SPACE::DocEntry::DicomDict, GDCM_NAME_SPACE::GDCM_UNKNOWN, GDCM_NAME_SPACE::DictSet::GetDefaultPubDict(), GDCM_NAME_SPACE::Global::GetDicts(), GDCM_NAME_SPACE::Dict::GetEntry(), GDCM_NAME_SPACE::DictEntry::GetVM(), GDCM_NAME_SPACE::DocEntry::Key, and GDCM_NAME_SPACE::RefCounter::Register().

Referenced by GDCM_NAME_SPACE::CheckVM(), and GDCM_NAME_SPACE::DataEntry::IsValueCountValid().

00210 {
00211    if (DicomDict == 0)
00212       DicomDict =
00213                  Global::GetDicts()->GetDefaultPubDict()->GetEntry(Key[0],Key[1]);
00214    if (DicomDict == 0)
00215       return GDCM_UNKNOWN;
00216    else
00217    {
00218       DicomDict->Register();
00219       return DicomDict->GetVM();
00220    }
00221 }

VRKey const& GDCM_NAME_SPACE::DocEntry::GetVR  )  const [inline, inherited]
 

Returns the 'Value Representation' (e.g. "PN" : Person Name, "SL" : Signed Long), found in the Dicom header or in the Dicom Dictionnary, of the current Dicom entry.

Definition at line 70 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::CheckVM(), GDCM_NAME_SPACE::Document::ComputeGroup0002Length(), GDCM_NAME_SPACE::DicomDirMeta::ComputeGroup0002Length(), GDCM_NAME_SPACE::FileHelper::CopyDataEntry(), GDCM_NAME_SPACE::File::DoTheLoadingJob(), GDCM_NAME_SPACE::Document::FixDocEntryFoundLength(), GDCM_NAME_SPACE::DataEntry::GetDSValue(), GDCM_NAME_SPACE::DocEntry::GetFullLength(), GDCM_NAME_SPACE::DataEntry::GetString(), GDCM_NAME_SPACE::DataEntry::GetValue(), GDCM_NAME_SPACE::DataEntry::GetValueCount(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryBinArea(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryString(), GDCM_NAME_SPACE::Document::IsDocEntryAnInteger(), GDCM_NAME_SPACE::Document::LoadDocEntry(), GDCM_NAME_SPACE::Document::ParseDES(), GDCM_NAME_SPACE::DocEntry::Print(), GDCM_NAME_SPACE::DataEntry::Print(), GDCM_NAME_SPACE::DataEntry::SetString(), GDCM_NAME_SPACE::DataEntry::SetValue(), and GDCM_NAME_SPACE::DocEntry::WriteContent().

00070 { return VR; }   

bool GDCM_NAME_SPACE::DocEntry::IsImplicitVR  )  const [inline, inherited]
 

Tells us if the current Dicom entry was checked as ImplicitVr.

Returns:
true if the current Dicom entry was checked as ImplicitVr

Definition at line 129 of file gdcmDocEntry.h.

References GDCM_NAME_SPACE::ImplicitVR.

Referenced by GDCM_NAME_SPACE::DocEntry::GetFullLength(), and SeqEntry().

00129 { return ImplicitVR; }

bool GDCM_NAME_SPACE::DocEntry::IsItemDelimitor  )  [inline, inherited]
 

tells us if entry is the last one of a 'no length' SequenceItem (fffe,e00d)

Definition at line 143 of file gdcmDocEntry.h.

00144                       {return (GetGroup() == 0xfffe && GetElement() == 0xe00d);}

bool GDCM_NAME_SPACE::DocEntry::IsItemStarter  )  [inline, inherited]
 

tells us if entry is the last one of a 'no length' Sequence (fffe,e0dd)

Definition at line 147 of file gdcmDocEntry.h.

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

00147                        { if (GetGroup() != 0xfffe) return false;
00148                          return (GetElement() == 0xe000); }

bool GDCM_NAME_SPACE::DocEntry::IsSequenceDelimitor  )  [inline, inherited]
 

tells us if entry is the last one of a 'no length' Sequence (fffe,e0dd)

Definition at line 151 of file gdcmDocEntry.h.

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

00151 { return (GetGroup() == 0xfffe && GetElement() == 0xe0dd);}  

bool GDCM_NAME_SPACE::DocEntry::IsVMUnknown  )  [inline, inherited]
 

Tells us if the VM of the current Dicom entry is Unknown.

Returns:
true if the VM is unknown

Definition at line 139 of file gdcmDocEntry.h.

References GDCM_NAME_SPACE::GDCM_UNKNOWN.

00139 { return GetVM() == GDCM_UNKNOWN; }

bool GDCM_NAME_SPACE::DocEntry::IsVRUnknown  )  const [inline, inherited]
 

Tells us if the VR of the current Dicom entry is Unknown.

Returns:
true if the VR is unknown

Definition at line 134 of file gdcmDocEntry.h.

References GDCM_NAME_SPACE::GDCM_VRUNKNOWN.

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

00134 { return VR == GDCM_VRUNKNOWN; }

static SeqEntry* GDCM_NAME_SPACE::SeqEntry::New uint16_t  group,
uint16_t  elem
[inline, static]
 

Constructs a SeqEntry with a RefCounter from elementary values.

Definition at line 50 of file gdcmSeqEntry.h.

00051                            {return new SeqEntry(group,elem);}

static SeqEntry* GDCM_NAME_SPACE::SeqEntry::New DocEntry d,
int  depth
[inline, static]
 

Contructs a SeqEntry with a RefCounter from DocEntry.

Definition at line 48 of file gdcmSeqEntry.h.

Referenced by GDCM_NAME_SPACE::FileHelper::CheckMandatoryElements(), and GDCM_NAME_SPACE::DocEntrySet::NewSeqEntry().

00048 {return new SeqEntry(d,depth);}

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

canonical Printer

Reimplemented from GDCM_NAME_SPACE::DocEntry.

Definition at line 275 of file gdcmSeqEntry.cxx.

References GDCM_NAME_SPACE::DocEntry::GetReadLength(), Items, GDCM_NAME_SPACE::DocEntry::Print(), and GDCM_NAME_SPACE::Base::PrintLevel.

00276 {
00277    // First, Print the Dicom Element itself.
00278    os << "S ";
00279    DocEntry::Print(os);
00280    os << std::endl;
00281 
00282    if (GetReadLength() == 0)
00283       return;
00284 
00285    // Then, Print each SQ Item   
00286    for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc)
00287    {
00288       (*cc)->SetPrintLevel(PrintLevel);
00289       (*cc)->Print(os);   
00290    }
00291 
00292    // at end, print the sequence terminator item, if any
00293    if (DelimitorMode)
00294    {
00295       int i;
00296       for ( i = 0; i < SQDepthLevel; i++ )
00297          os << "   | " ;
00298       os << " --- "  << std::endl;
00299       for ( i = 0; i < SQDepthLevel; i++ )
00300          os << "   | " ;
00301       if (SeqTerm != NULL)
00302       {
00303          SeqTerm->SetPrintLevel(PrintLevel);
00304          SeqTerm->Print(os);
00305          os << std::endl;
00306       } 
00307       else 
00308       {
00309          // fuse
00310          gdcmWarningMacro("  -------- should have a sequence terminator item");
00311       }
00312    }
00313 }

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(), AddSQItem(), 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 SetDelimitationItem().

00046 { RefCount++; }

void GDCM_NAME_SPACE::SeqEntry::SetDelimitationItem DocEntry e  ) 
 

Sets the Sequence Delimitation Item.

Parameters:
e Delimitation item

Definition at line 224 of file gdcmSeqEntry.cxx.

References GDCM_NAME_SPACE::RefCounter::Register(), and SeqTerm.

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

00225 {
00226    if( SeqTerm != e )
00227    {
00228       if( SeqTerm )
00229          SeqTerm->Unregister();
00230       SeqTerm = e;
00231       if( SeqTerm )
00232          SeqTerm->Register();
00233    }
00234 }

void GDCM_NAME_SPACE::SeqEntry::SetDelimitorMode bool  dm  )  [inline]
 

Sets the delimitor mode.

Definition at line 65 of file gdcmSeqEntry.h.

00065 { DelimitorMode = dm; }

void GDCM_NAME_SPACE::SeqEntry::SetDepthLevel int  depth  )  [inline]
 

Sets the depth level of a Sequence Entry embedded in a SeQuence.

Definition at line 75 of file gdcmSeqEntry.h.

00075 { SQDepthLevel = depth; }

void GDCM_NAME_SPACE::DocEntry::SetImplicitVR  )  [inline, inherited]
 

Sets to TRUE the ImplicitVr flag of the current Dicom entry.

Definition at line 115 of file gdcmDocEntry.h.

References GDCM_NAME_SPACE::ImplicitVR.

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

00115 { ImplicitVR = true; }

virtual void GDCM_NAME_SPACE::DocEntry::SetLength uint32_t  l  )  [inline, virtual, inherited]
 

Sets both 'Read Length' and 'Usable Length' of the current Dicom entry.

Definition at line 98 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::Document::Backtrack(), GDCM_NAME_SPACE::FileHelper::CheckMandatoryElements(), GDCM_NAME_SPACE::DataEntry::CopyBinArea(), GDCM_NAME_SPACE::Document::FixDocEntryFoundLength(), GDCM_NAME_SPACE::DocEntrySet::SetEntryBinArea(), and GDCM_NAME_SPACE::DataEntry::SetString().

00098 { Length = l; }

void GDCM_NAME_SPACE::DocEntry::SetOffset size_t  of  )  [inline, inherited]
 

Sets the offset of the Dicom entry.

Warning:
use with caution !
Parameters:
of offset to be set

Definition at line 112 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::Document::Backtrack(), GDCM_NAME_SPACE::DicomDirObject::FillObject(), GDCM_NAME_SPACE::Document::ReadNextDocEntry(), and GDCM_NAME_SPACE::DicomDir::SetElement().

00112 { Offset = of; }

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::DocEntry::SetReadLength uint32_t  l  )  [inline, inherited]
 

Sets only 'Read Length' (*not* 'Usable Length') of the current Dicom entry.

Definition at line 89 of file gdcmDocEntry.h.

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

00089 { ReadLength = l; }

void GDCM_NAME_SPACE::DocEntry::SetTag TagKey const &  key  )  [inline, inherited]
 

Sets the 'Value Representation' of the current Dicom entry

Parameters:
key TagKey to be set

Definition at line 123 of file gdcmDocEntry.h.

00123 { Key = key; } 

void GDCM_NAME_SPACE::DocEntry::SetVM TagName  )  [inline, inherited]
 

Sets the 'Value Multiplicity' of the current Dicom entry.

Definition at line 80 of file gdcmDocEntry.h.

00080 { std::cout << "-----------------FIXME : SetVM "; }

void GDCM_NAME_SPACE::DocEntry::SetVR VRKey const &  vr  )  [inline, inherited]
 

Sets the 'Value Representation' of the current Dicom entry

Parameters:
vr VR to be set

Definition at line 119 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::File::DoTheLoadingJob(), and GDCM_NAME_SPACE::DocEntry::WriteContent().

00119 { VR = vr; } 

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(), GDCM_NAME_SPACE::ElementSet::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::SeqEntry::WriteContent std::ofstream *  fp,
FileType  filetype,
bool  insideMetaElements
[virtual]
 

Writes the common part of any DataEntry, SeqEntry.

Parameters:
fp already open ofstream pointer
filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
Todo:
allow skipping Shadow groups

Reimplemented from GDCM_NAME_SPACE::DocEntry.

Definition at line 83 of file gdcmSeqEntry.cxx.

References GDCM_NAME_SPACE::DocEntry::GetReadLength(), Items, and GDCM_NAME_SPACE::DocEntry::WriteContent().

00084 {
00085    uint16_t seq_term_gr = 0xfffe;
00086    uint16_t seq_term_el = 0xe0dd;
00087    uint32_t seq_term_lg = 0x00000000;
00088  
00089    // ignore 'Zero length' Sequences
00090    if ( GetReadLength() == 0 )
00091       return;
00092    // false : we are not in MetaElements
00093    DocEntry::WriteContent(fp, filetype, false);
00094    for(ListSQItem::iterator cc  = Items.begin();
00095                             cc != Items.end();
00096                           ++cc)
00097    {   
00098       (*cc)->WriteContent(fp, filetype, false);
00099    }
00100    
00101    // we force the writting of a Sequence Delimitation item
00102    // because we wrote the Sequence as a 'no Length' sequence
00103    binary_write(*fp, seq_term_gr);
00104    binary_write(*fp, seq_term_el);
00105    binary_write(*fp, seq_term_lg);
00106 }


Member Data Documentation

bool GDCM_NAME_SPACE::SeqEntry::DelimitorMode [private]
 

If this Sequence is in delimitor mode (length =0xffffffff) or not.

Definition at line 89 of file gdcmSeqEntry.h.

Referenced by Copy(), and SeqEntry().

DictEntry* GDCM_NAME_SPACE::DocEntry::DicomDict [protected, inherited]
 

pointer to the underlying Dicom dictionary element

Definition at line 161 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::DocEntry::DocEntry(), GDCM_NAME_SPACE::DocEntry::GetName(), GDCM_NAME_SPACE::DocEntry::GetVM(), and GDCM_NAME_SPACE::DocEntry::~DocEntry().

bool GDCM_NAME_SPACE::DocEntry::ImplicitVR [protected, inherited]
 

Even when reading explicit vr files, some elements happen to be implicit. Flag them here since we can't use the entry->vr without breaking the underlying dictionary.

Definition at line 173 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::DocEntry::Copy(), GDCM_NAME_SPACE::DocEntry::DocEntry(), and SeqEntry().

ListSQItem GDCM_NAME_SPACE::SeqEntry::Items [private]
 

Chained list of SQ Items.

Definition at line 92 of file gdcmSeqEntry.h.

Referenced by AddSQItem(), ClearSQItem(), ComputeFullLength(), Copy(), GetFirstSQItem(), GetNextSQItem(), GetNumberOfSQItems(), GetSQItem(), Print(), and WriteContent().

ListSQItem::iterator GDCM_NAME_SPACE::SeqEntry::ItSQItem [private]
 

iterator on the SQItems of the current SeqEntry

Definition at line 94 of file gdcmSeqEntry.h.

Referenced by Copy(), GetFirstSQItem(), and GetNextSQItem().

TagKey GDCM_NAME_SPACE::DocEntry::Key [protected, inherited]
 

Dicom TagKey. Contains Dicom Group number and Dicom Element number (to avoid accessing Dicom Dict every time !) // JPRx.

Definition at line 183 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::DocEntry::DocEntry(), GDCM_NAME_SPACE::DocEntry::GetName(), and GDCM_NAME_SPACE::DocEntry::GetVM().

uint32_t GDCM_NAME_SPACE::DocEntry::Length [protected, inherited]
 

Corresponds to the real length of the data This length might always be even.

Definition at line 165 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::DocEntry::Copy(), GDCM_NAME_SPACE::DocEntry::DocEntry(), and SeqEntry().

size_t GDCM_NAME_SPACE::DocEntry::Offset [protected, inherited]
 

Offset from the beginning of file for direct user access.

Definition at line 176 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::DocEntry::Copy(), GDCM_NAME_SPACE::DocEntry::DocEntry(), and SeqEntry().

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 Print(), GDCM_NAME_SPACE::FileHelper::Print(), GDCM_NAME_SPACE::ElementSet::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().

uint32_t GDCM_NAME_SPACE::DocEntry::ReadLength [protected, inherited]
 

Length to read in the file to obtain data.

Definition at line 168 of file gdcmDocEntry.h.

Referenced by GDCM_NAME_SPACE::DocEntry::Copy(), GDCM_NAME_SPACE::DocEntry::DocEntry(), and SeqEntry().

DocEntry* GDCM_NAME_SPACE::SeqEntry::SeqTerm [private]
 

sequence terminator item

Definition at line 97 of file gdcmSeqEntry.h.

Referenced by Copy(), SeqEntry(), and SetDelimitationItem().

int GDCM_NAME_SPACE::SeqEntry::SQDepthLevel [private]
 

Defines the depth level of this SeqEntry inside the (optionaly) nested sequences. SQDepthLevel and its SQItem::SQDepthLevel counterpart are only defined on printing purposes (see Print).

Definition at line 103 of file gdcmSeqEntry.h.

Referenced by Copy(), and SeqEntry().

VRKey GDCM_NAME_SPACE::DocEntry::VR [protected, inherited]
 

Value Representation (to avoid accessing Dicom Dict every time!).

Definition at line 179 of file gdcmDocEntry.h.


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