+2004-12-16 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+ * src/gdcmBase.[h|cxx] : new base class. Contains the PrintLevel and an
+ empty Print Method
+ * Set the gdcm::Base class to some Printable classes
+
2004-12-16 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
* src/gdcmFile.[h|cxx] : add the Print method
* src/gdcmPixelReadConvert.[h|cxx] : add the generalized Print method
)
SET(libgdcm_la_SOURCES
+ gdcmBase.cxx
gdcmBinEntry.cxx
gdcmDebug.cxx
gdcmDicomDir.cxx
--- /dev/null
+ /*=========================================================================
+
+ Program: gdcm
+ Module: $RCSfile: gdcmBase.cxx,v $
+ Language: C++
+ Date: $Date: 2004/12/16 13:46:38 $
+ Version: $Revision: 1.1 $
+
+ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+ l'Image). All rights reserved. See Doc/License.txt or
+ http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+
+#include "gdcmBase.h"
+
+namespace gdcm
+{
+//-------------------------------------------------------------------------
+// Constructor / Destructor
+/**
+ * \brief canonical constructor
+ */
+Base::Base( )
+{
+ PrintLevel = 0;
+}
+
+/**
+ * \brief canonical destructor
+ * \note If the Header was created by the File constructor,
+ * it is destroyed by the File
+ */
+Base::~Base()
+{
+}
+
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Print all the object
+ * @param os The output stream to be written to.
+ */
+void Base::Print(std::ostream &os)
+{
+}
+
+//-----------------------------------------------------------------------------
+// Public
+
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+} // end namespace gdcm
+
--- /dev/null
+/*=========================================================================
+
+ Program: gdcm
+ Module: $RCSfile: gdcmBase.h,v $
+ Language: C++
+ Date: $Date: 2004/12/16 13:46:38 $
+ Version: $Revision: 1.1 $
+
+ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+ l'Image). All rights reserved. See Doc/License.txt or
+ http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+
+#ifndef GDCMBASE_H
+#define GDCMBASE_H
+
+#include "gdcmCommon.h"
+#include <iostream>
+
+namespace gdcm
+{
+//-----------------------------------------------------------------------------
+/*
+ * \brief Base class of all gdcm classes
+ *
+ * Contains all to correctly print
+ * - Print method
+ * - SetPrintLevel method
+ */
+class GDCM_EXPORT Base
+{
+public:
+ Base( );
+ virtual ~Base();
+
+ virtual void Print(std::ostream &os = std::cout);
+
+ /// \brief Sets the print level for the Dicom Header Elements
+ /// \note 0 for Light Print; 1 for 'medium' Print, 2 for Heavy
+ void SetPrintLevel(int level) { PrintLevel = level; };
+
+ /// \brief Gets the print level for the Dicom Header Elements
+ int GetPrintLevel() { return PrintLevel; };
+
+protected:
+ /// \brief Amount of printed details for each Header Entry (Dicom Element):
+ /// 0 : stands for the least detail level.
+ int PrintLevel;
+};
+} // end namespace gdcm
+
+//-----------------------------------------------------------------------------
+#endif
Program: gdcm
Module: $RCSfile: gdcmBinEntry.cxx,v $
Language: C++
- Date: $Date: 2004/11/30 16:29:01 $
- Version: $Revision: 1.41 $
+ Date: $Date: 2004/12/16 13:46:36 $
+ Version: $Revision: 1.42 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
ReadLength = e->GetReadLength();
ImplicitVR = e->IsImplicitVR();
Offset = e->GetOffset();
- PrintLevel = e->GetPrintLevel();
//FIXME
//SQDepthLevel = e->GetDepthLevel();
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2004/12/07 17:28:50 $
- Version: $Revision: 1.89 $
+ Date: $Date: 2004/12/16 13:46:36 $
+ Version: $Revision: 1.90 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
cc != Patients.end();
++cc)
{
- (*cc)->SetPrintLevel( PrintLevel );
- (*cc)->Print( os );
+ (*cc)->SetPrintLevel(PrintLevel);
+ (*cc)->Print(os);
}
}
Program: gdcm
Module: $RCSfile: gdcmDicomDir.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:57 $
- Version: $Revision: 1.41 $
+ Date: $Date: 2004/12/16 13:46:36 $
+ Version: $Revision: 1.42 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
~DicomDir();
/// \brief canonical Printer
- /// \sa SetPrintLevel
void Print(std::ostream &os = std::cout);
/// Informations contained in the parser
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.h,v $
Language: C++
- Date: $Date: 2004/11/03 18:08:56 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2004/12/16 13:46:36 $
+ 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
/**
* \brief canonical Printer
- * \sa SetPrintLevel
*/
void Print(std::ostream &os);
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.cxx,v $
Language: C++
- Date: $Date: 2004/12/06 11:37:38 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ 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
i != DocEntries.end();
++i)
{
+ (*i)->SetPrintLevel(PrintLevel);
(*i)->Print();
os << std::endl;
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirObject.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:57 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ Version: $Revision: 1.9 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
typedef std::list<DicomDirObject *> ListContent;
public:
-
- DicomDirObject(int depth = 1);
- ~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 const & elemList);
protected:
-
// Constructor and destructor are protected to avoid end user to
// instanciate from this class.
// NO ! DicomDir needs to instanciate it!
-
-// Members :
- ///\brief detail level to be printed
- int PrintLevel;
+ DicomDirObject(int depth = 1);
+ ~DicomDirObject();
};
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDict.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:57 $
- Version: $Revision: 1.24 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ Version: $Revision: 1.25 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#ifndef GDCMDICT_H
#define GDCMDICT_H
+#include "gdcmBase.h"
#include "gdcmDictEntry.h"
#include <iostream>
* combined with all software versions...
* \see DictSet
*/
-class GDCM_EXPORT Dict
+class GDCM_EXPORT Dict : public Base
{
public:
Dict(std::string const & filename);
Program: gdcm
Module: $RCSfile: gdcmDictEntry.h,v $
Language: C++
- Date: $Date: 2004/10/18 02:35:35 $
- Version: $Revision: 1.20 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ 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
#ifndef GDCMDICTENTRY_H
#define GDCMDICTENTRY_H
-#include "gdcmCommon.h"
+#include "gdcmBase.h"
namespace gdcm
{
* - the owner group
* - etc.
*/
-class GDCM_EXPORT DictEntry
+class GDCM_EXPORT DictEntry : public Base
{
public:
DictEntry(uint16_t group,
Program: gdcm
Module: $RCSfile: gdcmDictSet.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:57 $
- Version: $Revision: 1.29 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ Version: $Revision: 1.30 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#ifndef GDCMDICTSET_H
#define GDCMDICTSET_H
+#include "gdcmBase.h"
#include "gdcmDict.h"
#include <map>
* \par having many in memory representations of the same dictionary
* (saving memory).
*/
-class GDCM_EXPORT DictSet
+class GDCM_EXPORT DictSet : public Base
{
public:
DictSet();
Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:57 $
- Version: $Revision: 1.34 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ Version: $Revision: 1.35 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// init some variables
ReadLength = 0;
UsableLength = 0;
- PrintLevel = 0;
}
//-----------------------------------------------------------------------------
*/
void DocEntry::Print(std::ostream& os)
{
- PrintLevel = 2; // FIXME
-
size_t o;
std::string st;
TSKey v;
ReadLength = e->ReadLength;
ImplicitVR = e->ImplicitVR;
Offset = e->Offset;
- PrintLevel = e->PrintLevel;
// TODO : remove DocEntry SQDepth
}
Program: gdcm
Module: $RCSfile: gdcmDocEntry.h,v $
Language: C++
- Date: $Date: 2004/12/03 20:16:58 $
- Version: $Revision: 1.32 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ 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
#ifndef GDCMDOCENTRY_H
#define GDCMDOCENTRY_H
+#include "gdcmBase.h"
#include "gdcmDictEntry.h"
#include <iostream>
* \brief The dicom header of a Dicom file contains a set of such entries
* (when successfuly parsed against a given Dicom dictionary)
*/
-class GDCM_EXPORT DocEntry
+class GDCM_EXPORT DocEntry : public Base
{
public:
DocEntry(DictEntry*);
/// \brief Gets the DicEntry of the current Dicom Element
/// @return The DicEntry of the current Dicom Element
DictEntry * GetDictEntry() { return DicomDict; };
-
- /// \brief Sets the print level for the Dicom Header Elements
- /// \note 0 for Light Print; 1 for 'medium' Print, 2 for Heavy
- void SetPrintLevel(int level) { PrintLevel = level; };
-
- /// \brief Gets the print level for the Dicom Header Elements
- int GetPrintLevel() { return PrintLevel; };
- virtual void Print (std::ostream & os = std::cout);
virtual void WriteContent(std::ofstream *fp, FileType filetype);
uint32_t GetFullLength();
bool IsItemDelimitor();
bool IsSequenceDelimitor();
+ virtual void Print (std::ostream & os = std::cout);
+
private:
// FIXME: In fact we should be more specific and use :
// friend DocEntry * Header::ReadNextElement(void);
/// Offset from the begining of file for direct user access
size_t Offset;
- /// How many details are to be printed (value : 0,1,2)
- int PrintLevel;
-
/// \brief Generalized key of this DocEntry (for details on
/// the generalized key refer to \ref TagKey documentation).
TagKey Key;
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.h,v $
Language: C++
- Date: $Date: 2004/12/16 11:37:02 $
- Version: $Revision: 1.28 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ Version: $Revision: 1.29 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#ifndef GDCMDOCENTRYSET_H
#define GDCMDOCENTRYSET_H
+#include "gdcmBase.h"
#include "gdcmException.h"
#include <fstream>
* members to this class since this class is designed as an adapter
* in the form of an abstract base class.
*/
-class GDCM_EXPORT DocEntrySet
+class GDCM_EXPORT DocEntrySet : public Base
{
friend class File;
public:
DocEntrySet() {};
virtual ~DocEntrySet() {};
- /// \brief prints any type of entry to the entry set (pure vitual)
- virtual void Print (std::ostream & os = std::cout) = 0;// pure virtual
- /// Accessor to \ref PrintLevel
- void SetPrintLevel(int level) { PrintLevel = level; }
-
/// \brief adds any type of entry to the entry set (pure vitual)
virtual bool AddEntry(DocEntry *Entry) = 0; // pure virtual
virtual bool RemoveEntry(DocEntry *EntryToRemove)=0; // pure virtual
// DictEntry related utilities
DictEntry *GetDictEntryByName (TagName const & name);
DictEntry *GetDictEntryByNumber(uint16_t, uint16_t);
-
- /// \brief Amount of printed details for each Header Entry (Dicom Element):
- /// 0 : stands for the least detail level.
- int PrintLevel;
};
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/12/10 13:49:07 $
- Version: $Revision: 1.150 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ Version: $Revision: 1.151 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
SetEntryByNumber(rows , 0x0028, 0x0011);
}
// ----------------- End of ACR-LibIDO kludge ------------------
-
- PrintLevel = 1; // 'Medium' print level by default
}
/**
Initialise();
SwapCode = 0;
Filetype = ExplicitVR;
- PrintLevel = 1; // 'Medium' print level by default
}
/**
*/
void Document::PrintPubDict(std::ostream & os)
{
+ RefPubDict->SetPrintLevel(PrintLevel);
RefPubDict->Print(os);
}
*/
void Document::PrintShaDict(std::ostream & os)
{
+ RefShaDict->SetPrintLevel(PrintLevel);
RefShaDict->Print(os);
}
Program: gdcm
Module: $RCSfile: gdcmElementSet.cxx,v $
Language: C++
- Date: $Date: 2004/12/16 11:37:02 $
- Version: $Revision: 1.34 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ Version: $Revision: 1.35 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
for( TagDocEntryHT::const_iterator i = TagHT.begin(); i != TagHT.end(); ++i)
{
DocEntry* entry = i->second;
+
+ entry->SetPrintLevel(PrintLevel);
entry->Print(os);
+
if ( SeqEntry* seqEntry = dynamic_cast<SeqEntry*>(entry) )
{
(void)seqEntry;
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2004/12/16 11:37:03 $
- Version: $Revision: 1.178 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ Version: $Revision: 1.179 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
HeaderInternal->SetPrintLevel(PrintLevel);
HeaderInternal->Print(os);
+
+ PixelReadConverter->SetPrintLevel(PrintLevel);
PixelReadConverter->Print(os);
}
Program: gdcm
Module: $RCSfile: gdcmFile.h,v $
Language: C++
- Date: $Date: 2004/12/16 11:37:03 $
- Version: $Revision: 1.88 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ Version: $Revision: 1.89 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#define GDCMFILE_H
#include <iostream>
-#include "gdcmCommon.h"
+#include "gdcmBase.h"
namespace gdcm
{
* for accessing the image/volume content. One can also use it to
* write Dicom/ACR-NEMA/RAW files.
*/
-class GDCM_EXPORT File
+class GDCM_EXPORT File : public Base
{
public:
enum FileMode
virtual ~File();
void Print(std::ostream &os = std::cout);
- /// Accessor to \ref PrintLevel
- void SetPrintLevel(int level) { PrintLevel = level; }
/// Accessor to \ref Header
Header* GetHeader() { return HeaderInternal; }
ValEntry* CopyValEntry(uint16_t group,uint16_t element);
BinEntry* CopyBinEntry(uint16_t group,uint16_t element);
- /// \brief Amount of printed details for each Header Entry (Dicom Element):
- /// 0 : stands for the least detail level.
- int PrintLevel;
-
private:
void Initialise();
Program: gdcm
Module: $RCSfile: gdcmPixelReadConvert.h,v $
Language: C++
- Date: $Date: 2004/12/16 11:37:03 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ Version: $Revision: 1.7 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#define GDCMPIXELREADCONVERT_H
#include "gdcmCommon.h"
+#include "gdcmBase.h"
#include "gdcmException.h"
namespace gdcm
* \brief Utility container for gathering the various forms the pixel data
* migth take during the user demanded processes.
*/
-class GDCM_EXPORT PixelReadConvert
+class GDCM_EXPORT PixelReadConvert : public Base
{
public:
PixelReadConvert();
Program: gdcm
Module: $RCSfile: gdcmPixelWriteConvert.h,v $
Language: C++
- Date: $Date: 2004/12/07 09:32:24 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#define GDCMPIXELWRITECONVERT_H
#include "gdcmCommon.h"
+#include "gdcmBase.h"
namespace gdcm
{
* \brief Utility container for gathering the various forms the pixel data
* migth take during the user demanded processes.
*/
-class GDCM_EXPORT PixelWriteConvert
+class GDCM_EXPORT PixelWriteConvert : public Base
{
public:
PixelWriteConvert();
Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2004/12/07 13:39:33 $
- Version: $Revision: 1.42 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ Version: $Revision: 1.43 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
bool PrintEndLine = true;
os << s.str();
- Entry->SetPrintLevel(2);
+ Entry->SetPrintLevel(PrintLevel);
Entry->Print(os);
if ( SeqEntry* seqEntry = dynamic_cast<SeqEntry*>(Entry) )
{
Program: gdcm
Module: $RCSfile: gdcmSeqEntry.cxx,v $
Language: C++
- Date: $Date: 2004/12/02 15:14:18 $
- Version: $Revision: 1.39 $
+ Date: $Date: 2004/12/16 13:46:37 $
+ Version: $Revision: 1.40 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void SeqEntry::Print( std::ostream &os )
{
// First, Print the Dicom Element itself.
- SetPrintLevel(2);
-
os << "S ";
DocEntry::Print(os);
os << std::endl;
// Then, Print each SQ Item
for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc)
{
+ (*cc)->SetPrintLevel(PrintLevel);
(*cc)->Print(os);
}
}
if (SeqTerm != NULL)
{
+ SeqTerm->SetPrintLevel(PrintLevel);
SeqTerm->Print(os);
os << std::endl;
}
Program: gdcm
Module: $RCSfile: gdcmValEntry.cxx,v $
Language: C++
- Date: $Date: 2004/12/07 17:28:50 $
- Version: $Revision: 1.40 $
+ Date: $Date: 2004/12/16 13:46:38 $
+ Version: $Revision: 1.41 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
ReadLength = e->GetReadLength();
ImplicitVR = e->IsImplicitVR();
Offset = e->GetOffset();
- PrintLevel = e->GetPrintLevel();
}