Program: gdcm
Module: $RCSfile: gdcmDicomDirImage.cxx,v $
Language: C++
- Date: $Date: 2004/10/12 04:35:44 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2004/10/25 03:35:19 $
+ Version: $Revision: 1.13 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-
//-----------------------------------------------------------------------------
// Constructor / Destructor
DicomDirImage::DicomDirImage(SQItem *s, TagDocEntryHT *ptagHT):
DicomDirObject(ptagHT)
{
- docEntries = s->GetDocEntries();
+ DocEntries = s->GetDocEntries();
}
/**
void DicomDirImage::Print(std::ostream &os)
{
os << "IMAGE : ";
- for(ListDocEntry::iterator i=docEntries.begin();i!=docEntries.end();++i)
+ for(ListDocEntry::iterator i = DocEntries.begin();
+ i!= DocEntries.end();
+ ++i)
{
if( (*i)->GetGroup() == 0x0004 && (*i)->GetElement() == 0x1500 )
{
Program: gdcm
Module: $RCSfile: gdcmDicomDirImage.h,v $
Language: C++
- Date: $Date: 2004/10/12 04:35:44 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2004/10/25 03:35:19 $
+ Version: $Revision: 1.11 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#define GDCMDICOMIMAGE_H
#include "gdcmDicomDirObject.h"
+
namespace gdcm
{
-
//-----------------------------------------------------------------------------
class GDCM_EXPORT DicomDirImage : public DicomDirObject
{
~DicomDirImage();
- virtual void Print(std::ostream &os = std::cout);
+ void Print(std::ostream &os = std::cout);
};
} // end namespace gdcm
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.cxx,v $
Language: C++
- Date: $Date: 2004/10/22 03:05:40 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2004/10/25 03:35:19 $
+ Version: $Revision: 1.14 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
os << "META" << std::endl;
// warning : META doesn't behave exactly like a Objet
- for (ListDocEntry::iterator i = docEntries.begin();
- i != docEntries.end();
+ for (ListDocEntry::iterator i = DocEntries.begin();
+ i != DocEntries.end();
++i)
(*i)->Print();
}
*/
void DicomDirMeta::Write(std::ofstream* fp, FileType t)
{
- for (ListDocEntry::iterator i = docEntries.begin();
- i != docEntries.end();
- ++i)
- (*i)->Write(fp, t);
+ for (ListDocEntry::iterator i = DocEntries.begin();
+ i != DocEntries.end();
+ ++i)
+ {
+ (*i)->Write(fp, t);
+ }
}
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDicomDirObject.cxx,v $
Language: C++
- Date: $Date: 2004/10/13 14:15:29 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2004/10/25 03:35:19 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
TagDocEntryHT DicomDirObject::GetEntry()
{
TagDocEntryHT HT;
- docEntries=GetDocEntries();
- for(ListDocEntry::iterator i = docEntries.begin();
- i != docEntries.end(); ++i)
+ DocEntries = GetDocEntries();
+ for(ListDocEntry::iterator i = DocEntries.begin();
+ i != DocEntries.end(); ++i)
{
- HT[(*i)->GetKey()]=*i;
+ HT[(*i)->GetKey()] = *i;
}
return HT;
}
* \brief add the 'Object' related Dicom Elements to the listEntries
* of a partially created DICOMDIR
*/
-void DicomDirObject::FillObject(ListDicomDirMetaElem elemList)
+void DicomDirObject::FillObject(ListDicomDirMetaElem const & elemList)
{
// FillObject rempli le SQItem qui sera accroche au bon endroit
- std::list<Element>::iterator it;
+ std::list<Element>::const_iterator it;
uint16_t tmpGr,tmpEl;
DictEntry *dictEntry;
ValEntry *entry;
Program: gdcm
Module: $RCSfile: gdcmDicomDirObject.h,v $
Language: C++
- Date: $Date: 2004/10/13 14:15:29 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2004/10/25 03:35:19 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-
//-----------------------------------------------------------------------------
class DicomDirObject;
typedef std::list<DicomDirObject *> ListContent;
public:
DicomDirObject(TagDocEntryHT *ptagHT, int depth = 0);
- virtual ~DicomDirObject();
+ ~DicomDirObject();
+
/**
* \brief Sets the print level for the Dicom Header
* \note 0 for Light Print; 1 for 'medium' Print, 2 for Heavy
void SetPrintLevel(int level) { PrintLevel = level; };
TagDocEntryHT GetEntry();
- void FillObject(ListDicomDirMetaElem elemList);
+ void FillObject(ListDicomDirMetaElem const & elemList);
protected:
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
Language: C++
- Date: $Date: 2004/10/22 03:05:41 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2004/10/25 03:35:19 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param ptagHT pointer to the HTable (DicomDirObject needs it
* to build the HeaderEntries)
*/
-DicomDirPatient::DicomDirPatient(SQItem *s, TagDocEntryHT *ptagHT):
+DicomDirPatient::DicomDirPatient(SQItem *s, TagDocEntryHT *ptagHT) :
DicomDirObject(ptagHT)
{
- docEntries = s->GetDocEntries();
+ DocEntries = s->GetDocEntries();
}
/**
* \brief Constructor
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.cxx,v $
Language: C++
- Date: $Date: 2004/10/22 03:05:41 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2004/10/25 03:35:19 $
+ Version: $Revision: 1.19 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param ptagHT pointer to the HTable (DicomDirObject needs it
* to build the DocEntries)
*/
-DicomDirSerie::DicomDirSerie(SQItem* s, TagDocEntryHT* ptagHT):
+DicomDirSerie::DicomDirSerie(SQItem* s, TagDocEntryHT* ptagHT) :
DicomDirObject(ptagHT)
{
- docEntries = s->GetDocEntries();
+ DocEntries = s->GetDocEntries();
}
/**
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
Language: C++
- Date: $Date: 2004/10/22 03:05:41 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2004/10/25 03:35:19 $
+ Version: $Revision: 1.16 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-
//-----------------------------------------------------------------------------
// Constructor / Destructor
DicomDirStudy::DicomDirStudy(SQItem* s, TagDocEntryHT* ptagHT):
DicomDirObject(ptagHT)
{
- docEntries = s->GetDocEntries();
+ DocEntries = s->GetDocEntries();
}
/**
* \ingroup DicomDirStudy
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.h,v $
Language: C++
- Date: $Date: 2004/10/22 03:05:41 $
- Version: $Revision: 1.21 $
+ Date: $Date: 2004/10/25 03:35:19 $
+ 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
virtual void Write (std::ofstream *fp, FileType filetype) = 0;// pure virtual
virtual DocEntry* GetDocEntryByNumber(uint16_t group,
- uint16_t element) = 0;
- DocEntry *GetDocEntryByName(std::string const & name);
- virtual std::string GetEntryByNumber(uint16_t group,uint16_t element) = 0;
+ uint16_t element) = 0;
+ DocEntry *GetDocEntryByName(TagName const & name);
+ virtual std::string GetEntryByNumber(uint16_t group, uint16_t element) = 0;
std::string GetEntryByName(TagName const & name);
DictEntry *NewVirtualDictEntry(uint16_t group,
uint16_t element,
- std::string const & vr = "unkn",
- std::string const & fourth = "unkn",
- std::string const & name = "unkn");
+ TagName const & vr = "unkn",
+ TagName const & fourth = "unkn",
+ TagName const & name = "unkn");
protected:
uint16_t element);
DocEntry* NewDocEntryByNumber(uint16_t group,
uint16_t element,
- std::string const & VR);
- DocEntry* NewDocEntryByName (std::string const & name);
+ TagName const & vr);
+ DocEntry* NewDocEntryByName (TagName const & name);
SeqEntry* NewSeqEntryByNumber(uint16_t group,
uint16_t element);
// DictEntry related utilities
- DictEntry *GetDictEntryByName (std::string const & name);
+ DictEntry *GetDictEntryByName (TagName const & name);
DictEntry *GetDictEntryByNumber(uint16_t, uint16_t);
};
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/10/25 03:03:44 $
- Version: $Revision: 1.112 $
+ Date: $Date: 2004/10/25 03:35:20 $
+ Version: $Revision: 1.113 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if (SQItem* SQItemSet = dynamic_cast< SQItem* > ( set ) )
{
- ListDocEntry& currentList = SQItemSet->GetDocEntries();
- for (ListDocEntry::iterator i = currentList.begin();
- i != currentList.end();
- ++i)
+ const ListDocEntry& currentList = SQItemSet->GetDocEntries();
+ for (ListDocEntry::const_iterator i = currentList.begin();
+ i != currentList.end();
+ ++i)
{
DocEntry* entry = *i;
if ( SeqEntry* seqEntry = dynamic_cast<SeqEntry*>(entry) )
Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2004/10/22 03:05:42 $
- Version: $Revision: 1.30 $
+ Date: $Date: 2004/10/25 03:35:20 $
+ Version: $Revision: 1.31 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
SQItem::~SQItem()
{
- for(ListDocEntry::iterator cc = docEntries.begin();
- cc != docEntries.end();
- ++cc)
+ for(ListDocEntry::iterator cc = DocEntries.begin();
+ cc != DocEntries.end();
+ ++cc)
{
delete (*cc);
}
- docEntries.clear();
+ DocEntries.clear();
}
//-----------------------------------------------------------------------------
}
}
std::cout << s.str() << " --- SQItem number " << SQItemNumber << std::endl;
- for (ListDocEntry::iterator i = docEntries.begin();
- i != docEntries.end();
+ for (ListDocEntry::iterator i = DocEntries.begin();
+ i != DocEntries.end();
++i)
{
DocEntry* Entry = *i;
* \ingroup SQItem
* \brief canonical Writer
*/
-void SQItem::Write(std::ofstream* fp,FileType filetype)
+void SQItem::Write(std::ofstream* fp, FileType filetype)
{
uint16_t item[4] = { 0xfffe, 0xe000, 0xffff, 0xffff };
uint16_t itemt[4]= { 0xfffe, 0xe00d, 0xffff, 0xffff };
// because we want to write the Item as a 'no Length' item
fp->write((char*)&item[0],8); // fffe e000 ffff ffff
- for (ListDocEntry::iterator i = docEntries.begin();
- i != docEntries.end();
- ++i)
+ for (ListDocEntry::iterator i = DocEntries.begin();
+ i != DocEntries.end();
+ ++i)
{
// we skip delimitors (start and end one) because
// we force them as 'no length'
*/
bool SQItem::AddEntry(DocEntry* entry)
{
- docEntries.push_back(entry);
+ DocEntries.push_back(entry);
//TODO : check if it worked
return true;
}
* @return true if element was found or created successfully
*/
-bool SQItem::SetEntryByNumber(std::string val, uint16_t group,
- uint16_t element)
+bool SQItem::SetEntryByNumber(std::string const & val, uint16_t group,
+ uint16_t element)
{
- for(ListDocEntry::iterator i = docEntries.begin(); i != docEntries.end(); ++i)
+ for(ListDocEntry::iterator i = DocEntries.begin();
+ i != DocEntries.end();
+ ++i)
{
if ( (*i)->GetGroup() == 0xfffe && (*i)->GetElement() == 0xe000 )
{
entry->SetValue(val);
}
entry->SetLength(val.length());
- docEntries.insert(i,entry);
+ DocEntries.insert(i,entry);
return true;
}
*/
DocEntry* SQItem::GetDocEntryByNumber(uint16_t group, uint16_t element)
{
- for(ListDocEntry::iterator i = docEntries.begin();
- i != docEntries.end(); ++i)
+ for(ListDocEntry::iterator i = DocEntries.begin();
+ i != DocEntries.end(); ++i)
{
if ( (*i)->GetGroup() == group && (*i)->GetElement() == element )
{
std::string SQItem::GetEntryByNumber(uint16_t group, uint16_t element)
{
- for(ListDocEntry::iterator i = docEntries.begin();
- i != docEntries.end(); ++i)
+ for(ListDocEntry::iterator i = DocEntries.begin();
+ i != DocEntries.end(); ++i)
{
if ( (*i)->GetGroup() == group && (*i)->GetElement() == element)
{
Program: gdcm
Module: $RCSfile: gdcmSQItem.h,v $
Language: C++
- Date: $Date: 2004/10/22 03:05:42 $
- Version: $Revision: 1.20 $
+ Date: $Date: 2004/10/25 03:35:20 $
+ Version: $Revision: 1.21 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmDocEntrySet.h"
#include "gdcmElementSet.h"
-//#include "gdcmDocEntry.h"
-//#include "gdcmDocument.h"
-//#include "gdcmBinEntry.h"
-
#include <list>
namespace gdcm
//-----------------------------------------------------------------------------
typedef std::list<DocEntry *> ListDocEntry;
//-----------------------------------------------------------------------------
-class GDCM_EXPORT SQItem
- :
- public DocEntrySet
+class GDCM_EXPORT SQItem : public DocEntrySet
{
public:
- SQItem(int);
+ SQItem(int depthLevel);
~SQItem();
- virtual void Print(std::ostream &os = std::cout);
- virtual void Write(std::ofstream *fp, FileType filetype);
+ void Print(std::ostream &os = std::cout);
+ void Write(std::ofstream *fp, FileType filetype);
/// \brief returns the DocEntry chained List for this SQ Item.
- ListDocEntry &GetDocEntries() { return docEntries; };
+ ListDocEntry const &GetDocEntries() const { return DocEntries; };
/// \brief adds the passed DocEntry to the DocEntry chained List for
/// this SQ Item.
- void AddDocEntry(DocEntry *e) { docEntries.push_back(e); };
+ void AddDocEntry(DocEntry *e) { DocEntries.push_back(e); };
virtual bool AddEntry(DocEntry *Entry); // add to the List
// FIXME method to write
//DocEntry *GetDocEntryByName (std::string Name);
- bool SetEntryByNumber(std::string val, uint16_t group, uint16_t element);
+ bool SetEntryByNumber(std::string const & val, uint16_t group, uint16_t element);
- virtual std::string GetEntryByNumber(uint16_t group, uint16_t element);
+ std::string GetEntryByNumber(uint16_t group, uint16_t element);
/// \brief returns the ordinal position of a given SQItem
int GetSQItemNumber() { return SQItemNumber; };
void SetDepthLevel(int depth) { SQDepthLevel = depth; }
/// Accessor on \ref BaseTagKey.
- void SetBaseTagKey( BaseTagKey key ) { BaseTagKeyNested = key; }
+ void SetBaseTagKey( BaseTagKey const & key ) { BaseTagKeyNested = key; }
/// Accessor on \ref BaseTagKey.
- BaseTagKey GetBaseTagKey( ) { return BaseTagKeyNested; }
+ BaseTagKey const & GetBaseTagKey() const { return BaseTagKeyNested; }
protected:
-
-// Variables
+// Variables that need to be access in subclasses
/// \brief chained list of (Elementary) Doc Entries
- ListDocEntry docEntries;
-
- /// \brief SQ Item ordinal number
- int SQItemNumber;
-
+ ListDocEntry DocEntries;
+
///\brief pointer to the HTable of the Document,
/// (because we don't know it within any DicomDirObject nor any SQItem)
TagDocEntryHT *PtagHT;
-
private:
/// \brief Sequences can be nested. This \ref SQDepthLevel represents
/// with this BaseTagKey.
BaseTagKey BaseTagKeyNested;
+
+ /// \brief SQ Item ordinal number
+ int SQItemNumber;
+
};
} // end namespace gdcm
//-----------------------------------------------------------------------------