Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/10/24 03:33:40 $
- Version: $Revision: 1.111 $
+ Date: $Date: 2004/10/25 03:03:44 $
+ Version: $Revision: 1.112 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
DocEntry* entry = i->second;
if ( SeqEntry* seqEntry = dynamic_cast<SeqEntry*>(entry) )
{
- ListSQItem& items = seqEntry->GetSQItems();
+ const ListSQItem& items = seqEntry->GetSQItems();
for( ListSQItem::const_iterator item = items.begin();
item != items.end();
++item)
DocEntry* entry = *i;
if ( SeqEntry* seqEntry = dynamic_cast<SeqEntry*>(entry) )
{
- ListSQItem& items = seqEntry->GetSQItems();
+ const ListSQItem& items = seqEntry->GetSQItems();
for( ListSQItem::const_iterator item = items.begin();
item != items.end();
++item)
Program: gdcm
Module: $RCSfile: gdcmSeqEntry.cxx,v $
Language: C++
- Date: $Date: 2004/10/22 03:05:42 $
- Version: $Revision: 1.32 $
+ Date: $Date: 2004/10/25 03:03:45 $
+ Version: $Revision: 1.33 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
ReadLength = 0xffffffff;
SQDepthLevel = -1;
- delimitor_mode = false;
- seq_term = NULL;
+ DelimitorMode = false;
+ SeqTerm = NULL;
}
/**
/**
* \brief Canonical destructor.
*/
-SeqEntry::~SeqEntry() {
- for(ListSQItem::iterator cc = items.begin();cc != items.end();++cc)
+SeqEntry::~SeqEntry()
+{
+ for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc)
{
delete *cc;
}
- if (!seq_term)
- delete seq_term;
+ if (!SeqTerm)
+ {
+ delete SeqTerm;
+ }
}
/**
return;
// Then, Print each SQ Item
- for(ListSQItem::iterator cc = items.begin();cc != items.end();++cc)
+ for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc)
{
(*cc)->Print(os);
}
// at end, print the sequence terminator item, if any
- if (delimitor_mode) {
+ if (DelimitorMode)
+ {
for ( int i = 0; i < SQDepthLevel; i++ )
{
os << " | " ;
}
- if (seq_term != NULL)
+ if (SeqTerm != NULL)
{
- seq_term->Print(os);
+ SeqTerm->Print(os);
os << std::endl;
}
else
//uint16_t item_term_el = 0xe00d;
DocEntry::Write(fp, filetype);
- for(ListSQItem::iterator cc = GetSQItems().begin();
- cc != GetSQItems().end();
+ for(ListSQItem::iterator cc = Items.begin();
+ cc != Items.end();
++cc)
{
(*cc)->Write(fp, filetype);
void SeqEntry::AddEntry(SQItem *sqItem, int itemNumber)
{
sqItem->SetSQItemNumber(itemNumber);
- items.push_back(sqItem);
+ Items.push_back(sqItem);
}
/**
SQItem* SeqEntry::GetSQItemByOrdinalNumber(int nb)
{
if (nb<0)
- return (*(items.begin()));
+ {
+ return *(Items.begin());
+ }
int count = 0 ;
- for(ListSQItem::iterator cc = items.begin();
- cc != items.end();
- count ++, ++cc){
- if (count==nb)
+ for(ListSQItem::iterator cc = Items.begin();
+ cc != Items.end();
+ count ++, ++cc)
+ {
+ if (count == nb)
+ {
return *cc;
+ }
}
- return (*(items.end())); // Euhhhhh ?!? Is this the last one . FIXME
+ return *(Items.end()); // Euhhhhh ?!? Is this the last one . FIXME
}
//-----------------------------------------------------------------------------
// Protected
Program: gdcm
Module: $RCSfile: gdcmSeqEntry.h,v $
Language: C++
- Date: $Date: 2004/10/22 03:05:42 $
- Version: $Revision: 1.21 $
+ Date: $Date: 2004/10/25 03:03:45 $
+ Version: $Revision: 1.22 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
public:
SeqEntry( DictEntry* );
SeqEntry(DocEntry* d, int depth);
- virtual ~SeqEntry();
+ ~SeqEntry();
virtual void Print(std::ostream &os = std::cout);
virtual void Write(std::ofstream *fp, FileType);
/// returns the SQITEM chained List for this SeQuence.
- ListSQItem &GetSQItems() { return items; }
+ ListSQItem const & GetSQItems() const { return Items; }
/// Sets the delimitor mode
- void SetDelimitorMode(bool dm) { delimitor_mode = dm;}
+ void SetDelimitorMode(bool dm) { DelimitorMode = dm;}
/// Sets the Sequence Delimitation Item
- void SetSequenceDelimitationItem(DocEntry * e) { seq_term = e;}
+ void SetSequenceDelimitationItem(DocEntry * e) { SeqTerm = e;}
void AddEntry(SQItem *it, int itemNumber);
SQItem *GetSQItemByOrdinalNumber(int itemNumber);
/// Gets the depth level
- int GetDepthLevel() { return SQDepthLevel; }
-
+ int GetDepthLevel() const { return SQDepthLevel; }
+
/// Sets the depth level of a Sequence Entry embedded in a SeQuence
void SetDepthLevel(int depth) { SQDepthLevel = depth; }
+
protected:
private:
// Variables
/// If this Sequence is in delimitor mode (length =0xffffffff) or not
- bool delimitor_mode;
+ bool DelimitorMode;
/// Chained list of SQ Items
- ListSQItem items;
+ ListSQItem Items;
/// sequence terminator item
- DocEntry *seq_term;
+ DocEntry *SeqTerm;
/// \brief Defines the depth level of this \ref SeqEntry inside
/// the (optionaly) nested sequences. \ref SQDepthLevel
Program: gdcm
Module: $RCSfile: gdcmValEntry.h,v $
Language: C++
- Date: $Date: 2004/10/22 03:05:42 $
- Version: $Revision: 1.27 $
+ Date: $Date: 2004/10/25 03:03:45 $
+ Version: $Revision: 1.28 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmDocEntry.h"
#include <iostream>
+
namespace gdcm
{
-
//-----------------------------------------------------------------------------
/**
* \ingroup ValEntry
/// \brief Returns the 'Value' (e.g. "Dupond Marcel") converted into a
/// 'string', if it's stored as an integer in the header of the
/// current Dicom Document Entry
- std::string & GetValue() { return Value; };
+ std::string const & GetValue() const { return Value; };
/// Sets the value (string) of the current Dicom Document Entry
void SetValue(std::string const & val) { Value = val; };
/// \brief Document Entry value, internaly represented as a std::string
/// The Value Representation (\ref VR) is independently used
/// in order to interpret (decode) this field.
- std::string Value;
+ std::string Value;
};
} // end namespace gdcm