From 327dfe7647e3720b0f3125f9b19397cb9afc0ed3 Mon Sep 17 00:00:00 2001 From: jpr Date: Thu, 6 Jan 2005 20:03:26 +0000 Subject: [PATCH] Coding Style + Doxygenation --- Testing/TestVR.cxx | 5 +- src/gdcmBase.cxx | 6 +- src/gdcmBinEntry.cxx | 12 +-- src/gdcmBinEntry.h | 18 ++-- src/gdcmCommon.h | 6 +- src/gdcmDebug.cxx | 16 +-- src/gdcmDebug.h | 12 +-- src/gdcmDicomDir.cxx | 44 ++++----- src/gdcmDicomDir.h | 54 +++++----- src/gdcmDicomDirElement.cxx | 8 +- src/gdcmDicomDirElement.h | 16 +-- src/gdcmDicomDirMeta.cxx | 8 +- src/gdcmDicomDirMeta.h | 6 +- src/gdcmDicomDirObject.cxx | 6 +- src/gdcmDicomDirObject.h | 6 +- src/gdcmDicomDirPatient.cxx | 12 +-- src/gdcmDicomDirPatient.h | 8 +- src/gdcmDicomDirSerie.cxx | 14 +-- src/gdcmDicomDirSerie.h | 12 +-- src/gdcmDicomDirStudy.cxx | 12 +-- src/gdcmDict.cxx | 10 +- src/gdcmDict.h | 12 +-- src/gdcmDictEntry.cxx | 10 +- src/gdcmDictEntry.h | 22 ++--- src/gdcmDictSet.cxx | 14 +-- src/gdcmDictSet.h | 22 ++--- src/gdcmDirList.cxx | 14 +-- src/gdcmDirList.h | 10 +- src/gdcmDocEntry.cxx | 12 +-- src/gdcmDocEntry.h | 16 +-- src/gdcmDocEntrySet.h | 33 ++++--- src/gdcmDocument.cxx | 180 +++++++++++++++++----------------- src/gdcmDocument.h | 93 +++++++++--------- src/gdcmElementSet.cxx | 22 ++--- src/gdcmElementSet.h | 6 +- src/gdcmException.cxx | 6 +- src/gdcmException.h | 6 +- src/gdcmFile.cxx | 88 ++++++++--------- src/gdcmFile.h | 48 ++++----- src/gdcmHeader.cxx | 12 +-- src/gdcmHeader.h | 6 +- src/gdcmPixelReadConvert.cxx | 56 +++++------ src/gdcmPixelReadConvert.h | 42 ++++---- src/gdcmPixelWriteConvert.cxx | 10 +- src/gdcmPixelWriteConvert.h | 18 ++-- src/gdcmSQItem.cxx | 16 +-- src/gdcmSQItem.h | 16 +-- src/gdcmSeqEntry.cxx | 12 +-- src/gdcmSeqEntry.h | 12 +-- src/gdcmSerieHeader.cxx | 8 +- src/gdcmSerieHeader.h | 12 +-- src/gdcmTS.cxx | 10 +- src/gdcmTS.h | 8 +- src/gdcmUtil.cxx | 42 ++++---- src/gdcmUtil.h | 38 +++---- src/gdcmVR.cxx | 18 ++-- src/gdcmVR.h | 15 +-- src/gdcmValEntry.cxx | 14 +-- src/gdcmValEntry.h | 14 +-- 59 files changed, 644 insertions(+), 640 deletions(-) diff --git a/Testing/TestVR.cxx b/Testing/TestVR.cxx index 1087e1bb..6801c655 100644 --- a/Testing/TestVR.cxx +++ b/Testing/TestVR.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestVR.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 17:16:15 $ - Version: $Revision: 1.3 $ + Date: $Date: 2005/01/06 20:03:26 $ + Version: $Revision: 1.4 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -22,6 +22,7 @@ int TestVR(int , char *[]) gdcm::VR vr; // There should be 16 entries vr.Print( std::cout ); + vr.IsVROfStringRepresentable( "" ); vr.IsVROfBinaryRepresentable( "" ); vr.IsVROfSequence( "" ); diff --git a/src/gdcmBase.cxx b/src/gdcmBase.cxx index dafc627a..4f70298c 100644 --- a/src/gdcmBase.cxx +++ b/src/gdcmBase.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmBase.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 17:08:06 $ - Version: $Revision: 1.3 $ + Date: $Date: 2005/01/06 20:03:26 $ + Version: $Revision: 1.4 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -45,7 +45,7 @@ Base::~Base() * \brief Print all the object * @param os The output stream to be written to. */ -void Base::Print(std::ostream & os) +void Base::Print(std::ostream &os) { } diff --git a/src/gdcmBinEntry.cxx b/src/gdcmBinEntry.cxx index 991d3a01..d382e73c 100644 --- a/src/gdcmBinEntry.cxx +++ b/src/gdcmBinEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmBinEntry.cxx,v $ Language: C++ - Date: $Date: 2004/12/16 13:46:36 $ - Version: $Revision: 1.42 $ + Date: $Date: 2005/01/06 20:03:26 $ + 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 @@ -30,7 +30,7 @@ namespace gdcm /** * \brief Constructor from a given BinEntry */ -BinEntry::BinEntry(DictEntry* e) : ValEntry(e) +BinEntry::BinEntry(DictEntry *e) : ValEntry(e) { BinArea = 0; SelfArea = true; @@ -40,7 +40,7 @@ BinEntry::BinEntry(DictEntry* e) : ValEntry(e) * \brief Constructor from a given BinEntry * @param e Pointer to existing Doc entry */ -BinEntry::BinEntry(DocEntry* e) : ValEntry(e->GetDictEntry()) +BinEntry::BinEntry(DocEntry *e) : ValEntry(e->GetDictEntry()) { UsableLength = e->GetLength(); ReadLength = e->GetReadLength(); @@ -105,7 +105,7 @@ void BinEntry::Print(std::ostream &os) * @param fp already open file pointer * @param filetype type of the file to be written */ -void BinEntry::WriteContent(std::ofstream* fp, FileType filetype) +void BinEntry::WriteContent(std::ofstream *fp, FileType filetype) { DocEntry::WriteContent(fp, filetype); void* binArea = GetBinArea(); @@ -128,7 +128,7 @@ void BinEntry::WriteContent(std::ofstream* fp, FileType filetype) /// \brief Sets the value (non string) of the current Dicom Header Entry -void BinEntry::SetBinArea( uint8_t* area, bool self ) +void BinEntry::SetBinArea( uint8_t *area, bool self ) { if (BinArea && SelfArea) delete[] BinArea; diff --git a/src/gdcmBinEntry.h b/src/gdcmBinEntry.h index 1142ed57..c0ff6fdb 100644 --- a/src/gdcmBinEntry.h +++ b/src/gdcmBinEntry.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmBinEntry.h,v $ Language: C++ - Date: $Date: 2004/12/07 13:39:32 $ - Version: $Revision: 1.28 $ + Date: $Date: 2005/01/06 20:03:26 $ + 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 @@ -35,25 +35,25 @@ namespace gdcm class GDCM_EXPORT BinEntry : public ValEntry { public: - BinEntry( DictEntry* e ); - BinEntry( DocEntry* d ); + BinEntry( DictEntry *e ); + BinEntry( DocEntry *d ); ~BinEntry(); void Print( std::ostream &os = std::cout ); - void WriteContent( std::ofstream*, FileType ); + void WriteContent( std::ofstream *fp, FileType ft); /// \brief Returns the area value of the current Dicom Header Entry /// when it's not string-translatable (e.g : a LUT table) - uint8_t* GetBinArea() { return BinArea; } - void SetBinArea( uint8_t* area, bool self = true ); + uint8_t *GetBinArea() { return BinArea; } + void SetBinArea( uint8_t *area, bool self = true ); /// Sets the value (string) of the current Dicom Document Entry - virtual void SetValue(std::string const & val) {SetValueOnly(val);}; + virtual void SetValue(std::string const &val) { SetValueOnly(val); }; private: /// \brief unsecure memory area to hold 'non string' values /// (ie : Lookup Tables, overlays, icons) - uint8_t* BinArea; + uint8_t *BinArea; bool SelfArea; }; } // end namespace gdcm diff --git a/src/gdcmCommon.h b/src/gdcmCommon.h index d7e55592..2fb15391 100644 --- a/src/gdcmCommon.h +++ b/src/gdcmCommon.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmCommon.h,v $ Language: C++ - Date: $Date: 2005/01/05 15:38:28 $ - Version: $Revision: 1.43 $ + Date: $Date: 2005/01/06 20:03:26 $ + Version: $Revision: 1.44 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -60,7 +60,7 @@ #include // For uint8_t uint16_t and uint32_t #else #if defined(_MSC_VER) || defined(__BORLANDC__) -typedef signed char int8_t; +typedef signed char int8_t; #endif typedef unsigned char uint8_t; typedef unsigned short uint16_t; diff --git a/src/gdcmDebug.cxx b/src/gdcmDebug.cxx index 6bff5c2b..d301a9bf 100644 --- a/src/gdcmDebug.cxx +++ b/src/gdcmDebug.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDebug.cxx,v $ Language: C++ - Date: $Date: 2004/11/09 22:30:43 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/01/06 20:03:26 $ + 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 @@ -47,7 +47,7 @@ void Debug::SetDebug(int level) * @param msg1 first message part * @param msg2 second message part */ -void Debug::Verbose(int level, const char * msg1, const char * msg2) +void Debug::Verbose(int level, const char *msg1, const char *msg2) { if (level > DebugLevel) { @@ -62,7 +62,7 @@ void Debug::Verbose(int level, const char * msg1, const char * msg2) * @param msg1 first message part * @param msg2 second message part */ -void Debug::Error(bool test, const char * msg1, const char * msg2) +void Debug::Error(bool test, const char *msg1, const char *msg2) { if (!test) { @@ -78,8 +78,8 @@ void Debug::Error(bool test, const char * msg1, const char * msg2) * @param msg2 second message part * @param msg3 Third message part */ -void Debug::Error(const char* msg1, const char* msg2, - const char* msg3) +void Debug::Error(const char *msg1, const char *msg2, + const char *msg3) { std::cerr << "gdcm::" << msg1 << ' ' << msg2 << ' ' << msg3 << std::endl << std::flush; @@ -93,8 +93,8 @@ void Debug::Error(const char* msg1, const char* msg2, * @param msg1 first message part * @param msg2 second message part */ -void Debug::Assert(int level, bool test, const char * msg1, - const char * msg2) +void Debug::Assert(int level, bool test, const char *msg1, + const char *msg2) { if (level > DebugLevel) { diff --git a/src/gdcmDebug.h b/src/gdcmDebug.h index 6e719784..4b6d6824 100644 --- a/src/gdcmDebug.h +++ b/src/gdcmDebug.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDebug.h,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:57 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/01/06 20:03:26 $ + Version: $Revision: 1.10 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -42,11 +42,11 @@ public: Debug(int level = -1); void SetDebug (int level); - void Verbose(int level, const char* msg1, const char* msg2 = "") ; - void Error (bool test, const char* msg1, const char* msg2 = ""); - void Error (const char* msg1, const char* msg2 = "", const char* msg3 = ""); + void Verbose(int level, const char *msg1, const char *msg2 = "") ; + void Error (bool test, const char *msg1, const char *msg2 = ""); + void Error (const char *msg1, const char *msg2 = "", const char *msg3 = ""); - void Assert(int level, bool test, const char * msg1, const char * msg2); + void Assert(int level, bool test, const char *msg1, const char *msg2); void Exit(int a); static Debug &GetReference(); diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index 57401965..d8ca6287 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 15:41:28 $ - Version: $Revision: 1.91 $ + Date: $Date: 2005/01/06 20:03:26 $ + Version: $Revision: 1.92 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -79,7 +79,7 @@ DicomDir::DicomDir() * - false if user passed an already built DICOMDIR file * and wants to use it */ -DicomDir::DicomDir(std::string const & fileName, bool parseDir ): +DicomDir::DicomDir(std::string const &fileName, bool parseDir ): Document( fileName ) { // Whatever user passed (a root directory or a DICOMDIR) @@ -244,8 +244,8 @@ void DicomDir::ParseDirectory() * @param argDelete Argument * \warning In python : the arg parameter isn't considered */ -void DicomDir::SetStartMethod( DicomDir::Method* method, void* arg, - DicomDir::Method* argDelete ) +void DicomDir::SetStartMethod( DicomDir::Method *method, void *arg, + DicomDir::Method *argDelete ) { if( StartArg && StartMethodArgDelete ) { @@ -264,7 +264,7 @@ void DicomDir::SetStartMethod( DicomDir::Method* method, void* arg, * class is destroyed * @param method Method to call to delete the argument */ -void DicomDir::SetStartMethodArgDelete( DicomDir::Method* method ) +void DicomDir::SetStartMethodArgDelete( DicomDir::Method *method ) { StartMethodArgDelete = method; } @@ -278,8 +278,8 @@ void DicomDir::SetStartMethodArgDelete( DicomDir::Method* method ) * @param argDelete Argument * \warning In python : the arg parameter isn't considered */ -void DicomDir::SetProgressMethod( DicomDir::Method* method, void* arg, - DicomDir::Method* argDelete ) +void DicomDir::SetProgressMethod( DicomDir::Method *method, void *arg, + DicomDir::Method *argDelete ) { if( ProgressArg && ProgressMethodArgDelete ) { @@ -298,7 +298,7 @@ void DicomDir::SetProgressMethod( DicomDir::Method* method, void* arg, * class is destroyed * @param method Method to call to delete the argument */ -void DicomDir::SetProgressMethodArgDelete( DicomDir::Method* method ) +void DicomDir::SetProgressMethodArgDelete( DicomDir::Method *method ) { ProgressMethodArgDelete = method; } @@ -311,8 +311,8 @@ void DicomDir::SetProgressMethodArgDelete( DicomDir::Method* method ) * @param argDelete Argument * \warning In python : the arg parameter isn't considered */ -void DicomDir::SetEndMethod( DicomDir::Method* method, void* arg, - DicomDir::Method* argDelete ) +void DicomDir::SetEndMethod( DicomDir::Method *method, void *arg, + DicomDir::Method *argDelete ) { if( EndArg && EndMethodArgDelete ) { @@ -331,7 +331,7 @@ void DicomDir::SetEndMethod( DicomDir::Method* method, void* arg, * the class is destroyed * @param method Method to call to delete the argument */ -void DicomDir::SetEndMethodArgDelete( DicomDir::Method* method ) +void DicomDir::SetEndMethodArgDelete( DicomDir::Method *method ) { EndMethodArgDelete = method; } @@ -348,13 +348,13 @@ void DicomDir::SetEndMethodArgDelete( DicomDir::Method* method ) * @return false only when fail to open */ -bool DicomDir::WriteDicomDir(std::string const& fileName) +bool DicomDir::WriteDicomDir(std::string const &fileName) { int i; uint16_t sq[4] = { 0x0004, 0x1220, 0xffff, 0xffff }; uint16_t sqt[4]= { 0xfffe, 0xe0dd, 0xffff, 0xffff }; - std::ofstream* fp = new std::ofstream(fileName.c_str(), + std::ofstream *fp = new std::ofstream(fileName.c_str(), std::ios::out | std::ios::binary); if( !fp ) { @@ -486,7 +486,7 @@ DicomDirMeta * DicomDir::NewMeta() } else // after root directory parsing { - ListDicomDirMetaElem const & elemList = + ListDicomDirMetaElem const &elemList = Global::GetDicomDirElements()->GetDicomDirMetaElements(); m->FillObject(elemList); } @@ -497,7 +497,7 @@ DicomDirMeta * DicomDir::NewMeta() /** * \brief adds a new Patient (with the basic elements) to a partially created DICOMDIR */ -DicomDirPatient * DicomDir::NewPatient() +DicomDirPatient *DicomDir::NewPatient() { ListDicomDirPatientElem::const_iterator it; uint16_t tmpGr,tmpEl; @@ -534,7 +534,7 @@ DicomDirPatient * DicomDir::NewPatient() * GDCM_DICOMDIR_STUDY, GDCM_DICOMDIR_SERIE ...) * @param header Header of the current file */ -void DicomDir::SetElement(std::string const & path, DicomDirType type, +void DicomDir::SetElement(std::string const &path, DicomDirType type, Document *header) { ListDicomDirElem elemList; //FIXME this is going to be a by copy operation @@ -737,7 +737,7 @@ void DicomDir::CreateDicomDir() return; } - SeqEntry* s = dynamic_cast(e); + SeqEntry *s = dynamic_cast(e); if ( !s ) { dbg.Verbose(0, "DicomDir::CreateDicomDir: no SeqEntry present"); @@ -750,14 +750,14 @@ void DicomDir::CreateDicomDir() ListSQItem listItems = s->GetSQItems(); - DocEntry * d; + DocEntry *d; std::string v; - SQItem * si; + SQItem *si; for( ListSQItem::iterator i = listItems.begin(); i !=listItems.end(); ++i ) { d = (*i)->GetDocEntryByNumber(0x0004, 0x1430); // Directory Record Type - if ( ValEntry* valEntry = dynamic_cast< ValEntry* >(d) ) + if ( ValEntry* valEntry = dynamic_cast(d) ) { v = valEntry->GetValue(); } @@ -970,7 +970,7 @@ void DicomDir::SetElements(std::string const & path, VectDocument const &list) * Only DocEntry's are moved * */ -void DicomDir::MoveSQItem(SQItem* dst,SQItem *src) +void DicomDir::MoveSQItem(SQItem *dst,SQItem *src) { DocEntry *entry; diff --git a/src/gdcmDicomDir.h b/src/gdcmDicomDir.h index 4594450a..66bfe02f 100644 --- a/src/gdcmDicomDir.h +++ b/src/gdcmDicomDir.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.h,v $ Language: C++ - Date: $Date: 2004/12/16 13:46:36 $ - Version: $Revision: 1.42 $ + Date: $Date: 2005/01/06 20:03:26 $ + 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 @@ -35,8 +35,8 @@ class DicomDirSerie; class DicomDirImage; class SQItem; -typedef std::list ListDicomDirPatient; -typedef std::vector VectDocument; +typedef std::list ListDicomDirPatient; +typedef std::vector VectDocument; //----------------------------------------------------------------------------- @@ -50,7 +50,7 @@ class GDCM_EXPORT DicomDir: public Document public: typedef void(Method)(void*); - DicomDir( std::string const & filename, bool parseDir = false ); + DicomDir( std::string const &filename, bool parseDir = false ); DicomDir(); ~DicomDir(); @@ -73,18 +73,18 @@ public: // Note: the DicomDir:: namespace prefix is needed by Swig in the // following method declarations. Refer to gdcmPython/gdcm.i // for the reasons of this unecessary notation at C++ level. - void SetStartMethod( DicomDir::Method*, + void SetStartMethod( DicomDir::Method *m, void* = NULL, - DicomDir::Method* = NULL ); - void SetProgressMethod( DicomDir::Method*, + DicomDir::Method *m = NULL ); + void SetProgressMethod( DicomDir::Method *m, void* = NULL, - DicomDir::Method* = NULL ); - void SetEndMethod( DicomDir::Method*, + DicomDir::Method *m = NULL ); + void SetEndMethod( DicomDir::Method *m, void* = NULL, - DicomDir::Method* = NULL ); - void SetStartMethodArgDelete( DicomDir::Method* ); - void SetProgressMethodArgDelete( DicomDir::Method* ); - void SetEndMethodArgDelete( DicomDir::Method* ); + DicomDir::Method *m = NULL ); + void SetStartMethodArgDelete( DicomDir::Method *m ); + void SetProgressMethodArgDelete( DicomDir::Method *m ); + void SetEndMethodArgDelete( DicomDir::Method *m ); /// GetProgress GetProgress float GetProgress() { return Progress; }; @@ -96,11 +96,11 @@ public: bool IsAborted() { return Abort; }; /// Adding - DicomDirMeta* NewMeta(); - DicomDirPatient* NewPatient(); + DicomDirMeta *NewMeta(); + DicomDirPatient *NewPatient(); /// Write - bool WriteDicomDir(std::string const & fileName); + bool WriteDicomDir(std::string const &fileName); /// Types of the DicomDirObject within the DicomDir typedef enum @@ -114,7 +114,7 @@ public: } DicomDirType; protected: - void CreateDicomDirChainedList(std::string const & path); + void CreateDicomDirChainedList(std::string const &path); void CallStartMethod(); void CallProgressMethod(); void CallEndMethod(); @@ -124,17 +124,17 @@ private: void CreateDicomDir(); bool AddDicomDirMeta(); - bool AddDicomDirPatientToEnd(DicomDirPatient* dd); - bool AddDicomDirStudyToEnd (DicomDirStudy* dd); - bool AddDicomDirSerieToEnd (DicomDirSerie* dd); - bool AddDicomDirImageToEnd (DicomDirImage* dd); + bool AddDicomDirPatientToEnd(DicomDirPatient *dd); + bool AddDicomDirStudyToEnd (DicomDirStudy *dd); + bool AddDicomDirSerieToEnd (DicomDirSerie *dd); + bool AddDicomDirImageToEnd (DicomDirImage *dd); - void SetElements(std::string const & path, VectDocument const &list); - void SetElement (std::string const & path, DicomDirType type, - Document* header); - void MoveSQItem(SQItem* dst,SQItem *src); + void SetElements(std::string const &path, VectDocument const &list); + void SetElement (std::string const &path, DicomDirType type, + Document *header); + void MoveSQItem(SQItem *dst,SQItem *src); - static bool HeaderLessThan(Document* header1, Document* header2); + static bool HeaderLessThan(Document *header1, Document *header2); // Variables diff --git a/src/gdcmDicomDirElement.cxx b/src/gdcmDicomDirElement.cxx index 2769450b..f719d3c8 100644 --- a/src/gdcmDicomDirElement.cxx +++ b/src/gdcmDicomDirElement.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirElement.cxx,v $ Language: C++ - Date: $Date: 2004/11/04 15:59:37 $ - Version: $Revision: 1.22 $ + Date: $Date: 2005/01/06 20:03:26 $ + Version: $Revision: 1.23 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -146,8 +146,8 @@ void DicomDirElement::Print(std::ostream &os) //----------------------------------------------------------------------------- // Public -bool DicomDirElement::AddNewEntry(std::string const & type, - Element const & elem) +bool DicomDirElement::AddNewEntry(std::string const &type, + Element const &elem) { if( type == "metaElem" ) { diff --git a/src/gdcmDicomDirElement.h b/src/gdcmDicomDirElement.h index 8a17cbed..9a879015 100644 --- a/src/gdcmDicomDirElement.h +++ b/src/gdcmDicomDirElement.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirElement.h,v $ Language: C++ - Date: $Date: 2005/01/05 15:38:28 $ - Version: $Revision: 1.17 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.18 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -66,7 +66,7 @@ public: * \brief returns a reference to the chained List * related to the META Elements of a DICOMDIR. */ - ListDicomDirMetaElem const & GetDicomDirMetaElements() const + ListDicomDirMetaElem const &GetDicomDirMetaElements() const { return DicomDirMetaList; }; /** @@ -74,7 +74,7 @@ public: * \brief returns a reference to the chained List * related to the PATIENT Elements of a DICOMDIR. */ - ListDicomDirPatientElem const & GetDicomDirPatientElements() const + ListDicomDirPatientElem const &GetDicomDirPatientElements() const { return DicomDirPatientList; }; /** @@ -82,7 +82,7 @@ public: * \brief returns a reference to the chained List * related to the STUDY Elements of a DICOMDIR. */ - ListDicomDirStudyElem const & GetDicomDirStudyElements() const + ListDicomDirStudyElem const &GetDicomDirStudyElements() const { return DicomDirStudyList; }; /** @@ -90,7 +90,7 @@ public: * \brief returns a reference to the chained List * related to the SERIE Elements of a DICOMDIR. */ - ListDicomDirSerieElem const & GetDicomDirSerieElements() const + ListDicomDirSerieElem const &GetDicomDirSerieElements() const { return DicomDirSerieList; }; /** @@ -98,13 +98,13 @@ public: * \brief returns a reference to the chained List * related to the IMAGE Elements of a DICOMDIR. */ - ListDicomDirImageElem const & GetDicomDirImageElements() const + ListDicomDirImageElem const &GetDicomDirImageElements() const { return DicomDirImageList; }; /** * Public method to add an element */ - bool AddNewEntry(std::string const & type, Element const & elem); + bool AddNewEntry(std::string const &type, Element const &elem); private: /// Elements chained list, related to the MetaElements of DICOMDIR diff --git a/src/gdcmDicomDirMeta.cxx b/src/gdcmDicomDirMeta.cxx index 9c4a3cc8..05ef4358 100644 --- a/src/gdcmDicomDirMeta.cxx +++ b/src/gdcmDicomDirMeta.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirMeta.cxx,v $ Language: C++ - Date: $Date: 2004/12/16 13:46:37 $ - Version: $Revision: 1.19 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.20 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -48,7 +48,7 @@ DicomDirMeta::~DicomDirMeta() /** * \brief Prints the Meta Elements */ -void DicomDirMeta::Print(std::ostream& os) +void DicomDirMeta::Print(std::ostream &os) { os << "META" << std::endl; // warning : META doesn't behave exactly like a Objet @@ -71,7 +71,7 @@ void DicomDirMeta::Print(std::ostream& os) * \brief Writes the Meta Elements * @return */ -void DicomDirMeta::WriteContent(std::ofstream* fp, FileType t) +void DicomDirMeta::WriteContent(std::ofstream *fp, FileType t) { for (ListDocEntry::iterator i = DocEntries.begin(); i != DocEntries.end(); diff --git a/src/gdcmDicomDirMeta.h b/src/gdcmDicomDirMeta.h index 5dd4ee82..8162055a 100644 --- a/src/gdcmDicomDirMeta.h +++ b/src/gdcmDicomDirMeta.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirMeta.h,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:57 $ - Version: $Revision: 1.13 $ + Date: $Date: 2005/01/06 20:03:27 $ + 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 @@ -32,7 +32,7 @@ public: ~DicomDirMeta(); virtual void Print(std::ostream &os = std::cout); - virtual void WriteContent(std::ofstream * fp, FileType t); + virtual void WriteContent(std::ofstream *fp, FileType t); }; } // end namespace gdcm //----------------------------------------------------------------------------- diff --git a/src/gdcmDicomDirObject.cxx b/src/gdcmDicomDirObject.cxx index d4d62160..ce17714b 100644 --- a/src/gdcmDicomDirObject.cxx +++ b/src/gdcmDicomDirObject.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirObject.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 16:05:06 $ - Version: $Revision: 1.13 $ + Date: $Date: 2005/01/06 20:03:27 $ + 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 @@ -75,7 +75,7 @@ TagDocEntryHT DicomDirObject::GetEntry() * of a partially created DICOMDIR * @param elemList Element List to add at the right place */ -void DicomDirObject::FillObject(ListDicomDirMetaElem const & elemList) +void DicomDirObject::FillObject(ListDicomDirMetaElem const &elemList) { // FillObject rempli le SQItem qui sera accroche au bon endroit diff --git a/src/gdcmDicomDirObject.h b/src/gdcmDicomDirObject.h index 52633eb5..92a2d7a1 100644 --- a/src/gdcmDicomDirObject.h +++ b/src/gdcmDicomDirObject.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirObject.h,v $ Language: C++ - Date: $Date: 2004/12/16 13:46:37 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.10 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -40,7 +40,7 @@ class GDCM_EXPORT DicomDirObject : public SQItem typedef std::list ListContent; public: TagDocEntryHT GetEntry(); - void FillObject(ListDicomDirMetaElem const & elemList); + void FillObject(ListDicomDirMetaElem const &elemList); protected: // Constructor and destructor are protected to avoid end user to diff --git a/src/gdcmDicomDirPatient.cxx b/src/gdcmDicomDirPatient.cxx index f01d3984..815cdc1a 100644 --- a/src/gdcmDicomDirPatient.cxx +++ b/src/gdcmDicomDirPatient.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirPatient.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 16:05:06 $ - Version: $Revision: 1.22 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.23 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -53,7 +53,7 @@ DicomDirPatient::~DicomDirPatient() * \brief Prints the Object * @param os ostream to write to */ -void DicomDirPatient::Print(std::ostream& os) +void DicomDirPatient::Print(std::ostream &os) { os << "PATIENT" << std::endl; DicomDirObject::Print(os); @@ -72,7 +72,7 @@ void DicomDirPatient::Print(std::ostream& os) * @param fp ofstream to write to * @param t Type of the File (explicit VR, implicitVR, ...) */ -void DicomDirPatient::WriteContent(std::ofstream* fp, FileType t) +void DicomDirPatient::WriteContent(std::ofstream *fp, FileType t) { DicomDirObject::WriteContent(fp, t); @@ -92,10 +92,10 @@ void DicomDirPatient::WriteContent(std::ofstream* fp, FileType t) */ DicomDirStudy* DicomDirPatient::NewStudy() { - ListDicomDirStudyElem const & elemList = + ListDicomDirStudyElem const &elemList = Global::GetDicomDirElements()->GetDicomDirStudyElements(); - DicomDirStudy* st = new DicomDirStudy(); + DicomDirStudy *st = new DicomDirStudy(); st->FillObject(elemList); Studies.push_front(st); diff --git a/src/gdcmDicomDirPatient.h b/src/gdcmDicomDirPatient.h index 5c4505fd..08d435cc 100644 --- a/src/gdcmDicomDirPatient.h +++ b/src/gdcmDicomDirPatient.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirPatient.h,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:57 $ - Version: $Revision: 1.15 $ + Date: $Date: 2005/01/06 20:03:27 $ + 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 @@ -38,13 +38,13 @@ public: void WriteContent(std::ofstream *fp, FileType t); /// Returns the STUDY chained List for this PATIENT. - ListDicomDirStudy const & GetDicomDirStudies() const { return Studies; }; + ListDicomDirStudy const &GetDicomDirStudies() const { return Studies; }; /// adds the passed STUDY to the STUDY chained List for this PATIENT. void AddDicomDirStudy (DicomDirStudy *obj) { Studies.push_back(obj); }; /// TODO - DicomDirStudy* NewStudy(); + DicomDirStudy *NewStudy(); private: diff --git a/src/gdcmDicomDirSerie.cxx b/src/gdcmDicomDirSerie.cxx index 5055d4b6..2edbf5ea 100644 --- a/src/gdcmDicomDirSerie.cxx +++ b/src/gdcmDicomDirSerie.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirSerie.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 16:05:06 $ - Version: $Revision: 1.24 $ + Date: $Date: 2005/01/06 20:03:27 $ + 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 @@ -52,7 +52,7 @@ DicomDirSerie::~DicomDirSerie() * \brief Prints the Object * @param os ostream to write to */ -void DicomDirSerie::Print(std::ostream& os) +void DicomDirSerie::Print(std::ostream &os) { os << "SERIE" << std::endl; DicomDirObject::Print(os); @@ -74,7 +74,7 @@ void DicomDirSerie::Print(std::ostream& os) * @param fp ofstream to write to * @param t Type of the File (explicit VR, implicitVR, ...) */ -void DicomDirSerie::WriteContent(std::ofstream* fp, FileType t) +void DicomDirSerie::WriteContent(std::ofstream *fp, FileType t) { DicomDirObject::WriteContent(fp, t); @@ -89,12 +89,12 @@ void DicomDirSerie::WriteContent(std::ofstream* fp, FileType t) /** * \brief adds a new Image (with the basic elements) to a partially created DICOMDIR */ -DicomDirImage* DicomDirSerie::NewImage() +DicomDirImage *DicomDirSerie::NewImage() { - ListDicomDirImageElem const & elemList = + ListDicomDirImageElem const &elemList = Global::GetDicomDirElements()->GetDicomDirImageElements(); - DicomDirImage* st = new DicomDirImage(); + DicomDirImage *st = new DicomDirImage(); FillObject(elemList); Images.push_front(st); diff --git a/src/gdcmDicomDirSerie.h b/src/gdcmDicomDirSerie.h index c9d14d6a..5dbf4005 100644 --- a/src/gdcmDicomDirSerie.h +++ b/src/gdcmDicomDirSerie.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirSerie.h,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:57 $ - Version: $Revision: 1.16 $ + Date: $Date: 2005/01/06 20:03:27 $ + 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 @@ -34,14 +34,14 @@ public: DicomDirSerie(); ~DicomDirSerie(); - void Print( std::ostream& os = std::cout ); - void WriteContent( std::ofstream* fp, FileType t ); + void Print( std::ostream &os = std::cout ); + void WriteContent( std::ofstream *fp, FileType t ); /** * \ingroup DicomDirSerie * \brief returns the IMAGE chained List for this SERIE. */ - ListDicomDirImage const & GetDicomDirImages() const { return Images; }; + ListDicomDirImage const &GetDicomDirImages() const { return Images; }; /** * \ingroup DicomDirSerie @@ -53,7 +53,7 @@ public: * \ingroup DicomDirSerie * \brief TODO */ - DicomDirImage* NewImage(); + DicomDirImage *NewImage(); private: /** diff --git a/src/gdcmDicomDirStudy.cxx b/src/gdcmDicomDirStudy.cxx index 1c940c7e..e817e734 100644 --- a/src/gdcmDicomDirStudy.cxx +++ b/src/gdcmDicomDirStudy.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirStudy.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 16:05:06 $ - Version: $Revision: 1.21 $ + Date: $Date: 2005/01/06 20:03:27 $ + 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 @@ -53,7 +53,7 @@ DicomDirStudy::~DicomDirStudy() * @param os ostream to write to * @return */ -void DicomDirStudy::Print(std::ostream& os) +void DicomDirStudy::Print(std::ostream &os) { os << "STUDY" << std::endl; DicomDirObject::Print(os); @@ -76,7 +76,7 @@ void DicomDirStudy::Print(std::ostream& os) * @param t Type of the File (explicit VR, implicitVR, ...) * @return */ -void DicomDirStudy::WriteContent(std::ofstream* fp, FileType t) +void DicomDirStudy::WriteContent(std::ofstream *fp, FileType t) { DicomDirObject::WriteContent(fp, t); @@ -92,9 +92,9 @@ void DicomDirStudy::WriteContent(std::ofstream* fp, FileType t) * \brief adds a new Serie at the begining of the SerieList * of a partially created DICOMDIR */ -DicomDirSerie* DicomDirStudy::NewSerie() +DicomDirSerie *DicomDirStudy::NewSerie() { - ListDicomDirSerieElem const & elemList = + ListDicomDirSerieElem const &elemList = Global::GetDicomDirElements()->GetDicomDirSerieElements(); DicomDirSerie* st = new DicomDirSerie(); diff --git a/src/gdcmDict.cxx b/src/gdcmDict.cxx index 78c3f3f3..8887d8b2 100644 --- a/src/gdcmDict.cxx +++ b/src/gdcmDict.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDict.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 17:08:06 $ - Version: $Revision: 1.53 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.54 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -211,12 +211,12 @@ bool Dict::RemoveEntry (TagKey const &key) * \brief removes an already existing Dicom Dictionary Entry, * identified by its group,element number * @param group Dicom group number of the Dicom Element - * @param element Dicom element number of the Dicom Element + * @param elem Dicom element number of the Dicom Element * @return false if Dicom Dictionary Entry doesn't exist */ -bool Dict::RemoveEntry (uint16_t group, uint16_t element) +bool Dict::RemoveEntry (uint16_t group, uint16_t elem) { - return RemoveEntry(DictEntry::TranslateToKey(group, element)); + return RemoveEntry(DictEntry::TranslateToKey(group, elem)); } /** diff --git a/src/gdcmDict.h b/src/gdcmDict.h index b7c3c5bc..cfbdb9e9 100644 --- a/src/gdcmDict.h +++ b/src/gdcmDict.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDict.h,v $ Language: C++ - Date: $Date: 2004/12/16 13:46:37 $ - Version: $Revision: 1.25 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.26 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -59,13 +59,13 @@ public: void PrintByName(std::ostream &os = std::cout); // Entries - bool AddNewEntry (DictEntry const & newEntry); - bool ReplaceEntry(DictEntry const & newEntry); - bool RemoveEntry (TagKey const & key); + bool AddNewEntry (DictEntry const &newEntry); + bool ReplaceEntry(DictEntry const &newEntry); + bool RemoveEntry (TagKey const &key); bool RemoveEntry (uint16_t group, uint16_t element); // Tag - DictEntry *GetDictEntryByName(TagName const & name); + DictEntry *GetDictEntryByName(TagName const &name); DictEntry *GetDictEntryByNumber(uint16_t group, uint16_t element); EntryNamesList *GetDictEntryNames(); diff --git a/src/gdcmDictEntry.cxx b/src/gdcmDictEntry.cxx index bc0dddfd..f56e73ac 100644 --- a/src/gdcmDictEntry.cxx +++ b/src/gdcmDictEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDictEntry.cxx,v $ Language: C++ - Date: $Date: 2004/11/16 02:54:35 $ - Version: $Revision: 1.29 $ + Date: $Date: 2005/01/06 20:03:27 $ + 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 @@ -36,8 +36,8 @@ namespace gdcm */ DictEntry::DictEntry(uint16_t group, uint16_t element, - TagName const & vr, TagName const & fourth, - TagName const & name) + TagName const &vr, TagName const &fourth, + TagName const &name) { Group = group; Element = element; @@ -70,7 +70,7 @@ TagKey DictEntry::TranslateToKey(uint16_t group, uint16_t element) * \ is unset then overwrite it. * @param vr New V(alue) R(epresentation) to be set. */ -void DictEntry::SetVR(TagName const & vr) +void DictEntry::SetVR(TagName const &vr) { if ( IsVRUnknown() ) { diff --git a/src/gdcmDictEntry.h b/src/gdcmDictEntry.h index b8dffd1d..ab4b95f4 100644 --- a/src/gdcmDictEntry.h +++ b/src/gdcmDictEntry.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDictEntry.h,v $ Language: C++ - Date: $Date: 2005/01/06 13:35:38 $ - Version: $Revision: 1.23 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.24 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -40,13 +40,13 @@ class GDCM_EXPORT DictEntry : public Base public: DictEntry(uint16_t group, uint16_t element, - TagName const & vr = GDCM_UNKNOWN, - TagName const & fourth = GDCM_UNKNOWN, - TagName const & name = GDCM_UNKNOWN); + TagName const &vr = GDCM_UNKNOWN, + TagName const &fourth = GDCM_UNKNOWN, + TagName const &name = GDCM_UNKNOWN); static TagKey TranslateToKey(uint16_t group, uint16_t element); - void SetVR(TagName const & vr); + void SetVR(TagName const &vr); /// \brief tells if the V(alue) R(epresentation) is known (?!) /// @return @@ -63,26 +63,26 @@ public: /// \brief Returns the Dicom Value Representation of the current /// DictEntry /// @return the Dicom Value Representation - const TagName & GetVR() const { return VR; } + const TagName &GetVR() const { return VR; } /// \brief sets the key of the current DictEntry /// @param k New key to be set. - void SetKey(TagName const & k) { Key = k; } + void SetKey(TagName const &k) { Key = k; } /// \brief returns the Fourth field of the current DictEntry /// \warning NOT part of the Dicom Standard. /// May be REMOVED an any time. NEVER use it. /// @return The Fourth field - const TagName & GetFourth() const { return Fourth; } + const TagName &GetFourth() const { return Fourth; } /// \brief Returns the Dicom Name of the current DictEntry /// e.g. "Patient Name" for Dicom Tag (0x0010, 0x0010) /// @return the Dicom Name - const TagName & GetName() const { return Name; } + const TagName &GetName() const { return Name; } /// \brief Gets the key of the current DictEntry /// @return the key. - const TagName & GetKey() const { return Key; } + const TagName &GetKey() const { return Key; } private: /// \todo FIXME diff --git a/src/gdcmDictSet.cxx b/src/gdcmDictSet.cxx index 3b3c53c6..25a848e9 100644 --- a/src/gdcmDictSet.cxx +++ b/src/gdcmDictSet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDictSet.cxx,v $ Language: C++ - Date: $Date: 2004/10/28 19:53:29 $ - Version: $Revision: 1.44 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.45 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -69,7 +69,7 @@ DictSet::~DictSet() * contained is this DictSet, along with their respective content. * @param os Output stream used for printing. */ -void DictSet::Print(std::ostream& os) +void DictSet::Print(std::ostream &os) { for (DictSetHT::iterator dict = Dicts.begin(); dict != Dicts.end(); ++dict) { @@ -87,7 +87,7 @@ void DictSet::Print(std::ostream& os) * \sa DictSet::GetPubDictTagNamesByCategory * @return A list of all entries of the public dicom dictionnary. */ -EntryNamesList * DictSet::GetPubDictEntryNames() +EntryNamesList *DictSet::GetPubDictEntryNames() { return GetDefaultPubDict()->GetDictEntryNames(); } @@ -118,7 +118,7 @@ EntryNamesList * DictSet::GetPubDictEntryNames() * corresponding values are lists of all the dictionnary entries * among that group. */ -EntryNamesByCatMap * DictSet::GetPubDictEntryNamesByCategory() +EntryNamesByCatMap *DictSet::GetPubDictEntryNamesByCategory() { return GetDefaultPubDict()->GetDictEntryNamesByCategory(); } @@ -148,7 +148,7 @@ Dict *DictSet::LoadDictFromFile(std::string const & filename, * @param dictName The symbolic name of the searched dictionary. * \result The retrieved dictionary. */ -Dict *DictSet::GetDict(DictKey const & dictName) +Dict *DictSet::GetDict(DictKey const &dictName) { DictSetHT::iterator dict = Dicts.find(dictName); if(dict != Dicts.end()) @@ -224,7 +224,7 @@ std::string DictSet::BuildDictPath() //----------------------------------------------------------------------------- // Protected -bool DictSet::AppendDict(Dict *newDict, DictKey const & name) +bool DictSet::AppendDict(Dict *newDict, DictKey const &name) { Dicts[name] = newDict; diff --git a/src/gdcmDictSet.h b/src/gdcmDictSet.h index 89b1ff88..abf1a0f6 100644 --- a/src/gdcmDictSet.h +++ b/src/gdcmDictSet.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDictSet.h,v $ Language: C++ - Date: $Date: 2005/01/05 15:38:28 $ - Version: $Revision: 1.31 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.32 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -44,24 +44,24 @@ public: DictSet(); ~DictSet(); - void Print(std::ostream& os); + void Print(std::ostream &os); - EntryNamesList * GetPubDictEntryNames(); - EntryNamesByCatMap * GetPubDictEntryNamesByCategory(); + EntryNamesList *GetPubDictEntryNames(); + EntryNamesByCatMap* GetPubDictEntryNamesByCategory(); - Dict* LoadDictFromFile( std::string const & fileName, - DictKey const & name ); + Dict *LoadDictFromFile( std::string const &fileName, + DictKey const &name ); - Dict* GetDict( DictKey const & DictName ); + Dict *GetDict( DictKey const &DictName ); /// \brief Retrieve the default reference DICOM V3 public dictionary. Dict* GetDefaultPubDict() { return GetDict(PUB_DICT_NAME); }; // \brief Retrieve the virtual reference DICOM dictionary. // \warning : not end user intended - // Dict* GetVirtualDict() { return &VirtualEntry; }; + // Dict *GetVirtualDict() { return &VirtualEntry; }; - DictEntry* NewVirtualDictEntry(uint16_t group, uint16_t element, + DictEntry *NewVirtualDictEntry(uint16_t group, uint16_t element, TagName vr = GDCM_UNKNOWN, TagName fourth = GDCM_UNKNOWN, TagName name = GDCM_UNKNOWN); @@ -69,7 +69,7 @@ public: static std::string BuildDictPath(); protected: - bool AppendDict(Dict *NewDict, DictKey const & name); + bool AppendDict(Dict *NewDict, DictKey const &name); private: /// Hash table of all dictionaries contained in this DictSet diff --git a/src/gdcmDirList.cxx b/src/gdcmDirList.cxx index ca5c5fa1..c363f7b8 100644 --- a/src/gdcmDirList.cxx +++ b/src/gdcmDirList.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDirList.cxx,v $ Language: C++ - Date: $Date: 2004/12/12 13:32:23 $ - Version: $Revision: 1.29 $ + Date: $Date: 2005/01/06 20:03:27 $ + 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 @@ -43,7 +43,7 @@ namespace gdcm * @param dirName root directory name * @param recursive whether we want to explore recursively or not */ -DirList::DirList(std::string const & dirName, bool recursive) +DirList::DirList(std::string const &dirName, bool recursive) { name = dirName; Util::NormalizePath(name); @@ -68,7 +68,7 @@ DirList::~DirList() * \brief Get the directory name * @return the directory name */ -std::string const & DirList::GetDirName() const +std::string const &DirList::GetDirName() const { return name; } @@ -85,7 +85,7 @@ std::string const & DirList::GetDirName() const * @param dirpath directory to explore * @param recursive whether we want recursion or not */ -int DirList::Explore(std::string const & dirpath, bool recursive) +int DirList::Explore(std::string const &dirpath, bool recursive) { int numberOfFiles = 0; std::string fileName; @@ -112,7 +112,7 @@ int DirList::Explore(std::string const & dirpath, bool recursive) numberOfFiles++; } - found = FindNextFile(hFile,&fileData); + found = FindNextFile(hFile, &fileData); } #else @@ -131,7 +131,7 @@ int DirList::Explore(std::string const & dirpath, bool recursive) // bility of your programs. struct stat buf; - dirent* d = 0; + dirent *d = 0; for (d = readdir(dir); d; d = readdir(dir)) { fileName = dirName + d->d_name; diff --git a/src/gdcmDirList.h b/src/gdcmDirList.h index 47a55050..2685ca37 100644 --- a/src/gdcmDirList.h +++ b/src/gdcmDirList.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDirList.h,v $ Language: C++ - Date: $Date: 2004/10/27 22:58:06 $ - Version: $Revision: 1.13 $ + Date: $Date: 2005/01/06 20:03:27 $ + 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 @@ -38,10 +38,10 @@ namespace gdcm class DirList: public std::list { public : - DirList(std::string const & dirName, bool recursive=false); + DirList(std::string const &dirName, bool recursive=false); virtual ~DirList(); - std::string const & GetDirName() const; + std::string const &GetDirName() const; /// Character '\' static const char SEPARATOR_X; @@ -51,7 +51,7 @@ public : static const std::string SEPARATOR; private : - int Explore(std::string const & dirName, bool recursive=false); + int Explore(std::string const &dirName, bool recursive=false); /// name of the root directory to explore std::string name; diff --git a/src/gdcmDocEntry.cxx b/src/gdcmDocEntry.cxx index f954dfc2..8c750d71 100644 --- a/src/gdcmDocEntry.cxx +++ b/src/gdcmDocEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntry.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 13:35:38 $ - Version: $Revision: 1.37 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.38 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -38,7 +38,7 @@ namespace gdcm * \brief Constructor from a given DictEntry * @param in Pointer to existing dictionary entry */ -DocEntry::DocEntry(DictEntry* in) +DocEntry::DocEntry(DictEntry *in) { ImplicitVR = false; DicomDict = in; @@ -57,7 +57,7 @@ DocEntry::DocEntry(DictEntry* in) * \brief Prints the common part of ValEntry, BinEntry, SeqEntry * @param os ostream we want to print in */ -void DocEntry::Print(std::ostream& os) +void DocEntry::Print(std::ostream &os) { size_t o; std::string st; @@ -120,7 +120,7 @@ void DocEntry::Print(std::ostream& os) * @param fp already open file pointer * @param filetype type of the file to be written */ -void DocEntry::WriteContent(std::ofstream* fp, FileType filetype) +void DocEntry::WriteContent(std::ofstream *fp, FileType filetype) { uint32_t ffff = 0xffffffff; uint16_t group = GetGroup(); @@ -244,7 +244,7 @@ uint32_t DocEntry::GetFullLength() * \ingroup DocEntry * \brief Copies all the attributes from an other DocEntry */ -void DocEntry::Copy (DocEntry* e) +void DocEntry::Copy (DocEntry *e) { // DicomDict = e->DicomDict; UsableLength = e->UsableLength; diff --git a/src/gdcmDocEntry.h b/src/gdcmDocEntry.h index 52707ee1..e2798a26 100644 --- a/src/gdcmDocEntry.h +++ b/src/gdcmDocEntry.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntry.h,v $ Language: C++ - Date: $Date: 2004/12/16 13:46:37 $ - Version: $Revision: 1.33 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.34 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -50,19 +50,19 @@ public: uint16_t GetElement() { return DicomDict->GetElement();}; /// Returns the 'key' of the current Dicom Header Entry - void SetKey( TagKey const & key ) { Key = key; } + void SetKey( TagKey const &key ) { Key = key; } /// Returns the 'key' of the current Dicom Header Entry - std::string const & GetKey() const { return Key; } + std::string const &GetKey() const { return Key; } /// \brief Returns the 'Name' '(e.g. "Patient's Name") found in the Dicom /// Dictionnary of the current Dicom Header Entry - std::string const & GetName() const { return DicomDict->GetName(); }; + std::string const &GetName() const { return DicomDict->GetName(); }; /// \brief 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 Header Entry - std::string const & GetVR() const { return DicomDict->GetVR(); }; + std::string const &GetVR() const { return DicomDict->GetVR(); }; /// \brief Returns offset (since the beginning of the file, including /// the File Preamble, if any) of the value of the current Dicom HeaderEntry @@ -81,7 +81,7 @@ public: uint32_t GetReadLength() { return ReadLength; }; /// Sets the 'Value Representation' of the current Dicom Header Entry - void SetVR( TagName const & v) { DicomDict->SetVR(v); }; + void SetVR( TagName const &v) { DicomDict->SetVR(v); }; /// \brief Sets both 'Read Length' and 'Usable Length' of the current /// Dicom Header Entry @@ -130,7 +130,7 @@ public: bool IsItemDelimitor(); bool IsSequenceDelimitor(); - virtual void Print (std::ostream & os = std::cout); + virtual void Print (std::ostream &os = std::cout); private: // FIXME: In fact we should be more specific and use : diff --git a/src/gdcmDocEntrySet.h b/src/gdcmDocEntrySet.h index 2203ac95..f554901a 100644 --- a/src/gdcmDocEntrySet.h +++ b/src/gdcmDocEntrySet.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntrySet.h,v $ Language: C++ - Date: $Date: 2005/01/06 17:20:53 $ - Version: $Revision: 1.32 $ + Date: $Date: 2005/01/06 20:03:27 $ + 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 @@ -70,31 +70,32 @@ public: /// \brief write any type of entry to the entry set virtual void WriteContent (std::ofstream *fp, FileType filetype) = 0;// pure virtual - virtual DocEntry* GetDocEntryByNumber(uint16_t group, + virtual DocEntry *GetDocEntryByNumber(uint16_t group, uint16_t elem) = 0; - DocEntry* GetDocEntryByName(TagName const & name); + DocEntry *GetDocEntryByName(TagName const &name); virtual std::string GetEntryByNumber(uint16_t group, uint16_t elem) = 0; - std::string GetEntryByName(TagName const & name); + std::string GetEntryByName(TagName const &name); - DictEntry* NewVirtualDictEntry(uint16_t group, + DictEntry *NewVirtualDictEntry(uint16_t group, uint16_t element, - TagName const & vr = GDCM_UNKNOWN, - TagName const & fourth = GDCM_UNKNOWN, - TagName const & name = GDCM_UNKNOWN ); + TagName const &vr = GDCM_UNKNOWN, + TagName const &fourth = GDCM_UNKNOWN, + TagName const &name = GDCM_UNKNOWN ); protected: // DocEntry related utilities - ValEntry* NewValEntryByNumber(uint16_t group,uint16_t elem, - TagName const & vr = GDCM_UNKNOWN); - BinEntry* NewBinEntryByNumber(uint16_t group,uint16_t elem, - TagName const & vr = GDCM_UNKNOWN); - SeqEntry* NewSeqEntryByNumber(uint16_t group,uint16_t elem); + + ValEntry *NewValEntryByNumber(uint16_t group,uint16_t elem, + TagName const &vr = GDCM_UNKNOWN); + BinEntry *NewBinEntryByNumber(uint16_t group,uint16_t elem, + TagName const &vr = GDCM_UNKNOWN); + SeqEntry *NewSeqEntryByNumber(uint16_t group,uint16_t elem); // DictEntry related utilities - DictEntry *GetDictEntryByName (TagName const & name); + DictEntry *GetDictEntryByName (TagName const &name); DictEntry *GetDictEntryByNumber(uint16_t group, uint16_t elem); DictEntry *GetDictEntryByNumber(uint16_t group, uint16_t elem, - TagName const & vr); + TagName const &vr); }; } // end namespace gdcm diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 4935b4ca..2c705af2 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 17:16:15 $ - Version: $Revision: 1.160 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.161 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -94,7 +94,7 @@ const unsigned int Document::MAX_SIZE_PRINT_ELEMENT_VALUE = 0x7fffffff; * \brief constructor * @param filename file to be opened for parsing */ -Document::Document( std::string const & filename ) : ElementSet(-1) +Document::Document( std::string const &filename ) : ElementSet(-1) { SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE); Filename = filename; @@ -217,7 +217,7 @@ Document::~Document () * \brief Prints The Dict Entries of THE public Dicom Dictionary * @return */ -void Document::PrintPubDict(std::ostream & os) +void Document::PrintPubDict(std::ostream &os) { RefPubDict->SetPrintLevel(PrintLevel); RefPubDict->Print(os); @@ -227,7 +227,7 @@ void Document::PrintPubDict(std::ostream & os) * \brief Prints The Dict Entries of THE shadow Dicom Dictionary * @return */ -void Document::PrintShaDict(std::ostream & os) +void Document::PrintShaDict(std::ostream &os) { RefShaDict->SetPrintLevel(PrintLevel); RefShaDict->Print(os); @@ -238,7 +238,7 @@ void Document::PrintShaDict(std::ostream & os) /** * \brief Get the public dictionary used */ -Dict* Document::GetPubDict() +Dict *Document::GetPubDict() { return RefPubDict; } @@ -246,14 +246,14 @@ Dict* Document::GetPubDict() /** * \brief Get the shadow dictionary used */ -Dict* Document::GetShaDict() +Dict *Document::GetShaDict() { return RefShaDict; } /** * \brief Set the shadow dictionary used - * \param dict dictionary to use in shadow + * @param dict dictionary to use in shadow */ bool Document::SetShaDict(Dict *dict) { @@ -263,9 +263,9 @@ bool Document::SetShaDict(Dict *dict) /** * \brief Set the shadow dictionary used - * \param dictName name of the dictionary to use in shadow + * @param dictName name of the dictionary to use in shadow */ -bool Document::SetShaDict(DictKey const & dictName) +bool Document::SetShaDict(DictKey const &dictName) { RefShaDict = Global::GetDicts()->GetDict(dictName); return !RefShaDict; @@ -314,7 +314,7 @@ TransferSyntaxType Document::GetTransferSyntax() // The entry might be present but not loaded (parsing and loading // happen at different stages): try loading and proceed with check... LoadDocEntrySafe(entry); - if (ValEntry* valEntry = dynamic_cast< ValEntry* >(entry) ) + if (ValEntry *valEntry = dynamic_cast< ValEntry* >(entry) ) { std::string transfer = valEntry->GetValue(); // The actual transfer (as read from disk) might be padded. We @@ -415,7 +415,7 @@ FileType Document::GetFileType() * checks the preamble when existing. * @return The FILE pointer on success. */ -std::ifstream* Document::OpenFile() +std::ifstream *Document::OpenFile() { if (Filename.length() == 0) { @@ -503,7 +503,7 @@ bool Document::CloseFile() * (ACR-NEMA, ExplicitVR, ImplicitVR) * \return Always true. */ -void Document::WriteContent(std::ofstream* fp, FileType filetype) +void Document::WriteContent(std::ofstream *fp, FileType filetype) { /// \todo move the following lines (and a lot of others, to be written) /// to a future function CheckAndCorrectHeader @@ -544,13 +544,13 @@ void Document::WriteContent(std::ofstream* fp, FileType filetype) * \return pointer to the modified/created Header Entry (NULL when creation * failed). */ -ValEntry* Document::ReplaceOrCreateByNumber(std::string const & value, +ValEntry *Document::ReplaceOrCreateByNumber(std::string const &value, uint16_t group, uint16_t elem, - TagName const & vr ) + TagName const &vr ) { - ValEntry* valEntry = 0; - DocEntry* currentEntry = GetDocEntryByNumber( group, elem); + ValEntry *valEntry = 0; + DocEntry *currentEntry = GetDocEntryByNumber( group, elem); if (currentEntry) { @@ -605,14 +605,14 @@ ValEntry* Document::ReplaceOrCreateByNumber(std::string const & value, * \return pointer to the modified/created Header Entry (NULL when creation * failed). */ -BinEntry* Document::ReplaceOrCreateByNumber(uint8_t* binArea, +BinEntry *Document::ReplaceOrCreateByNumber(uint8_t *binArea, int lgth, uint16_t group, uint16_t elem, - TagName const & vr ) + TagName const &vr ) { - BinEntry* binEntry = 0; - DocEntry* currentEntry = GetDocEntryByNumber( group, elem); + BinEntry *binEntry = 0; + DocEntry *currentEntry = GetDocEntryByNumber( group, elem); // Verify the currentEntry if (currentEntry) @@ -682,10 +682,10 @@ BinEntry* Document::ReplaceOrCreateByNumber(uint8_t* binArea, * \return pointer to the modified/created SeqEntry (NULL when creation * failed). */ -SeqEntry* Document::ReplaceOrCreateByNumber( uint16_t group, uint16_t elem) +SeqEntry *Document::ReplaceOrCreateByNumber( uint16_t group, uint16_t elem) { - SeqEntry* seqEntry = 0; - DocEntry* currentEntry = GetDocEntryByNumber( group, elem); + SeqEntry *seqEntry = 0; + DocEntry *currentEntry = GetDocEntryByNumber( group, elem); // Verify the currentEntry if (currentEntry) @@ -736,7 +736,7 @@ SeqEntry* Document::ReplaceOrCreateByNumber( uint16_t group, uint16_t elem) * @param elem element number of the Entry * \return boolean */ -bool Document::ReplaceIfExistByNumber(std::string const & value, +bool Document::ReplaceIfExistByNumber(std::string const &value, uint16_t group, uint16_t elem ) { SetEntryByNumber(value, group, elem); @@ -773,9 +773,9 @@ bool Document::CheckIfEntryExistByNumber(uint16_t group, uint16_t element ) * @return Corresponding element value when it exists, * and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise. */ -std::string Document::GetEntryByName(TagName const & tagName) +std::string Document::GetEntryByName(TagName const &tagName) { - DictEntry* dictEntry = RefPubDict->GetDictEntryByName(tagName); + DictEntry *dictEntry = RefPubDict->GetDictEntryByName(tagName); if( !dictEntry ) { return GDCM_UNFOUND; @@ -805,7 +805,7 @@ std::string Document::GetEntryVRByName(TagName const& tagName) return GDCM_UNFOUND; } - DocEntry* elem = GetDocEntryByNumber(dictEntry->GetGroup(), + DocEntry *elem = GetDocEntryByNumber(dictEntry->GetGroup(), dictEntry->GetElement()); return elem->GetVR(); } @@ -846,7 +846,7 @@ std::string Document::GetEntryByNumber(uint16_t group, uint16_t element) */ std::string Document::GetEntryVRByNumber(uint16_t group, uint16_t element) { - DocEntry* elem = GetDocEntryByNumber(group, element); + DocEntry *elem = GetDocEntryByNumber(group, element); if ( !elem ) { return GDCM_UNFOUND; @@ -864,7 +864,7 @@ std::string Document::GetEntryVRByNumber(uint16_t group, uint16_t element) */ int Document::GetEntryLengthByNumber(uint16_t group, uint16_t element) { - DocEntry* elem = GetDocEntryByNumber(group, element); + DocEntry *elem = GetDocEntryByNumber(group, element); if ( !elem ) { return -2; //magic number @@ -877,8 +877,8 @@ int Document::GetEntryLengthByNumber(uint16_t group, uint16_t element) * @param tagName name of the searched Dicom Element. * @return true when found */ -bool Document::SetEntryByName( std::string const & content, - TagName const & tagName) +bool Document::SetEntryByName( std::string const &content, + TagName const &tagName) { DictEntry *dictEntry = RefPubDict->GetDictEntryByName(tagName); if( !dictEntry ) @@ -901,7 +901,7 @@ bool Document::SetEntryByName( std::string const & content, bool Document::SetEntryByNumber(std::string const& content, uint16_t group, uint16_t element) { - ValEntry* entry = GetValEntryByNumber(group, element); + ValEntry *entry = GetValEntryByNumber(group, element); if (!entry ) { dbg.Verbose(0, "Document::SetEntryByNumber: no corresponding", @@ -923,7 +923,7 @@ bool Document::SetEntryByNumber(std::string const& content, bool Document::SetEntryByNumber(uint8_t*content, int lgth, uint16_t group, uint16_t element) { - BinEntry* entry = GetBinEntryByNumber(group, element); + BinEntry *entry = GetBinEntryByNumber(group, element); if (!entry ) { dbg.Verbose(0, "Document::SetEntryByNumber: no corresponding", @@ -940,7 +940,7 @@ bool Document::SetEntryByNumber(uint8_t*content, int lgth, * @param content new value (string) to substitute with * @param entry Entry to be modified */ -bool Document::SetEntry(std::string const & content,ValEntry* entry) +bool Document::SetEntry(std::string const &content,ValEntry *entry) { if(entry) { @@ -957,7 +957,7 @@ bool Document::SetEntry(std::string const & content,ValEntry* entry) * @param entry Entry to be modified * @param lgth new value length */ -bool Document::SetEntry(uint8_t* content, int lgth, BinEntry* entry) +bool Document::SetEntry(uint8_t *content, int lgth, BinEntry *entry) { if(entry) { @@ -983,15 +983,15 @@ bool Document::SetEntry(uint8_t* content, int lgth, BinEntry* entry) * @param elem element number of the Entry * @return Pointer to the 'non string' area */ -void* Document::GetEntryBinAreaByNumber(uint16_t group, uint16_t elem) +void *Document::GetEntryBinAreaByNumber(uint16_t group, uint16_t elem) { - DocEntry* entry = GetDocEntryByNumber(group, elem); + DocEntry *entry = GetDocEntryByNumber(group, elem); if (!entry) { dbg.Verbose(1, "Document::GetDocEntryByNumber: no entry"); return 0; } - if ( BinEntry* binEntry = dynamic_cast(entry) ) + if ( BinEntry *binEntry = dynamic_cast(entry) ) { return binEntry->GetBinArea(); } @@ -1024,7 +1024,7 @@ void Document::LoadEntryBinArea(uint16_t group, uint16_t elem) * when a string is not suitable * @param element Entry whose binArea is going to be loaded */ -void Document::LoadEntryBinArea(BinEntry* element) +void Document::LoadEntryBinArea(BinEntry *element) { if(element->GetBinArea()) return; @@ -1037,7 +1037,7 @@ void Document::LoadEntryBinArea(BinEntry* element) Fp->seekg(o, std::ios::beg); size_t l = element->GetLength(); - uint8_t* a = new uint8_t[l]; + uint8_t *a = new uint8_t[l]; if( !a ) { dbg.Verbose(0, "Document::LoadEntryBinArea cannot allocate a"); @@ -1065,16 +1065,16 @@ void Document::LoadEntryBinArea(BinEntry* element) * @param element Element number of the searched Dicom Element * @return */ -/*bool Document::SetEntryBinAreaByNumber(uint8_t* area, +/*bool Document::SetEntryBinAreaByNumber(uint8_t *area, uint16_t group, uint16_t element) { - DocEntry* currentEntry = GetDocEntryByNumber(group, element); + DocEntry *currentEntry = GetDocEntryByNumber(group, element); if ( !currentEntry ) { return false; } - if ( BinEntry* binEntry = dynamic_cast(currentEntry) ) + if ( BinEntry *binEntry = dynamic_cast(currentEntry) ) { binEntry->SetBinArea( area ); return true; @@ -1090,7 +1090,7 @@ void Document::LoadEntryBinArea(BinEntry* element) * @return Corresponding Dicom Element when it exists, and NULL * otherwise. */ -DocEntry* Document::GetDocEntryByName(TagName const & tagName) +DocEntry *Document::GetDocEntryByName(TagName const &tagName) { DictEntry *dictEntry = RefPubDict->GetDictEntryByName(tagName); if( !dictEntry ) @@ -1111,7 +1111,7 @@ DocEntry* Document::GetDocEntryByName(TagName const & tagName) * @param element Element number of the searched Dicom Element * @return */ -DocEntry* Document::GetDocEntryByNumber(uint16_t group, uint16_t element) +DocEntry *Document::GetDocEntryByNumber(uint16_t group, uint16_t element) { TagKey key = DictEntry::TranslateToKey(group, element); if ( !TagHT.count(key)) @@ -1127,14 +1127,14 @@ DocEntry* Document::GetDocEntryByNumber(uint16_t group, uint16_t element) * ValEntry. * @return When present, the corresponding ValEntry. */ -ValEntry* Document::GetValEntryByNumber(uint16_t group, uint16_t element) +ValEntry *Document::GetValEntryByNumber(uint16_t group, uint16_t element) { - DocEntry* currentEntry = GetDocEntryByNumber(group, element); + DocEntry *currentEntry = GetDocEntryByNumber(group, element); if ( !currentEntry ) { return 0; } - if ( ValEntry* entry = dynamic_cast(currentEntry) ) + if ( ValEntry *entry = dynamic_cast(currentEntry) ) { return entry; } @@ -1149,14 +1149,14 @@ ValEntry* Document::GetValEntryByNumber(uint16_t group, uint16_t element) * BinEntry. * @return When present, the corresponding BinEntry. */ -BinEntry* Document::GetBinEntryByNumber(uint16_t group, uint16_t element) +BinEntry *Document::GetBinEntryByNumber(uint16_t group, uint16_t element) { - DocEntry* currentEntry = GetDocEntryByNumber(group, element); + DocEntry *currentEntry = GetDocEntryByNumber(group, element); if ( !currentEntry ) { return 0; } - if ( BinEntry* entry = dynamic_cast(currentEntry) ) + if ( BinEntry *entry = dynamic_cast(currentEntry) ) { return entry; } @@ -1167,12 +1167,12 @@ BinEntry* Document::GetBinEntryByNumber(uint16_t group, uint16_t element) /** * \brief Loads the element while preserving the current - * underlying file position indicator as opposed to + * underlying file position indicator as opposed to * to LoadDocEntry that modifies it. * @param entry Header Entry whose value shall be loaded. * @return */ -void Document::LoadDocEntrySafe(DocEntry * entry) +void Document::LoadDocEntrySafe(DocEntry *entry) { if(Fp) { @@ -1256,9 +1256,9 @@ void Document::ParseDES(DocEntrySet *set, long offset, long l_max, bool delim_mode) { DocEntry *newDocEntry = 0; - ValEntry* newValEntry; - BinEntry* newBinEntry; - SeqEntry* newSeqEntry; + ValEntry *newValEntry; + BinEntry *newBinEntry; + SeqEntry *newSeqEntry; VRKey vr; bool used=false; long offsetEntry,readEntry; @@ -1299,7 +1299,7 @@ void Document::ParseDES(DocEntrySet *set, long offset, //////////////////// BinEntry or UNKOWN VR: // When "this" is a Document the Key is simply of the // form ( group, elem )... - if (Document* dummy = dynamic_cast< Document* > ( set ) ) + if (Document *dummy = dynamic_cast< Document* > ( set ) ) { (void)dummy; newBinEntry->SetKey( newBinEntry->GetKey() ); @@ -1307,7 +1307,7 @@ void Document::ParseDES(DocEntrySet *set, long offset, // but when "this" is a SQItem, we are inserting this new // valEntry in a sequence item, and the kay has the // generalized form (refer to \ref BaseTagKey): - if (SQItem* parentSQItem = dynamic_cast< SQItem* > ( set ) ) + if (SQItem *parentSQItem = dynamic_cast< SQItem* > ( set ) ) { newBinEntry->SetKey( parentSQItem->GetBaseTagKey() + newBinEntry->GetKey() ); @@ -1326,7 +1326,7 @@ void Document::ParseDES(DocEntrySet *set, long offset, /////////////////////// ValEntry // When "set" is a Document, then we are at the top of the // hierarchy and the Key is simply of the form ( group, elem )... - if (Document* dummy = dynamic_cast< Document* > ( set ) ) + if (Document *dummy = dynamic_cast< Document* > ( set ) ) { (void)dummy; newValEntry->SetKey( newValEntry->GetKey() ); @@ -1334,7 +1334,7 @@ void Document::ParseDES(DocEntrySet *set, long offset, // ...but when "set" is a SQItem, we are inserting this new // valEntry in a sequence item. Hence the key has the // generalized form (refer to \ref BaseTagKey): - if (SQItem* parentSQItem = dynamic_cast< SQItem* > ( set ) ) + if (SQItem *parentSQItem = dynamic_cast< SQItem* > ( set ) ) { newValEntry->SetKey( parentSQItem->GetBaseTagKey() + newValEntry->GetKey() ); @@ -1408,7 +1408,7 @@ void Document::ParseDES(DocEntrySet *set, long offset, // is a Document, then we are building the first depth level. // Hence the SeqEntry we are building simply has a depth // level of one: - if (Document* dummy = dynamic_cast< Document* > ( set ) ) + if (Document *dummy = dynamic_cast< Document* > ( set ) ) { (void)dummy; newSeqEntry->SetDepthLevel( 1 ); @@ -1417,7 +1417,7 @@ void Document::ParseDES(DocEntrySet *set, long offset, // But when "set" is allready a SQItem, we are building a nested // sequence, and hence the depth level of the new SeqEntry // we are building, is one level deeper: - if (SQItem* parentSQItem = dynamic_cast< SQItem* > ( set ) ) + if (SQItem *parentSQItem = dynamic_cast< SQItem* > ( set ) ) { newSeqEntry->SetDepthLevel( parentSQItem->GetDepthLevel() + 1 ); newSeqEntry->SetKey( parentSQItem->GetBaseTagKey() @@ -1446,7 +1446,7 @@ void Document::ParseDES(DocEntrySet *set, long offset, * \brief Parses a Sequence ( SeqEntry after SeqEntry) * @return parsed length for this level */ -void Document::ParseSQ( SeqEntry* seqEntry, +void Document::ParseSQ( SeqEntry *seqEntry, long offset, long l_max, bool delim_mode) { int SQItemNumber = 0; @@ -1454,7 +1454,7 @@ void Document::ParseSQ( SeqEntry* seqEntry, while (true) { - DocEntry* newDocEntry = ReadNextDocEntry(); + DocEntry *newDocEntry = ReadNextDocEntry(); if ( !newDocEntry ) { // FIXME Should warn user @@ -1509,7 +1509,7 @@ void Document::ParseSQ( SeqEntry* seqEntry, * the value specified with Document::SetMaxSizeLoadEntry() * @param entry Header Entry (Dicom Element) to be dealt with */ -void Document::LoadDocEntry(DocEntry* entry) +void Document::LoadDocEntry(DocEntry *entry) { uint16_t group = entry->GetGroup(); std::string vr = entry->GetVR(); @@ -1541,7 +1541,7 @@ void Document::LoadDocEntry(DocEntry* entry) std::ostringstream s; if (length > MaxSizeLoadEntry) { - if (BinEntry* binEntryPtr = dynamic_cast< BinEntry* >(entry) ) + if (BinEntry *binEntryPtr = dynamic_cast< BinEntry* >(entry) ) { //s << "gdcm::NotLoaded (BinEntry)"; s << GDCM_NOTLOADED; @@ -1551,7 +1551,7 @@ void Document::LoadDocEntry(DocEntry* entry) binEntryPtr->SetValue(s.str()); } // Be carefull : a BinEntry IS_A ValEntry ... - else if (ValEntry* valEntryPtr = dynamic_cast< ValEntry* >(entry) ) + else if (ValEntry *valEntryPtr = dynamic_cast< ValEntry* >(entry) ) { // s << "gdcm::NotLoaded. (ValEntry)"; s << GDCM_NOTLOADED; @@ -1574,7 +1574,7 @@ void Document::LoadDocEntry(DocEntry* entry) } // When we find a BinEntry not very much can be done : - if (BinEntry* binEntryPtr = dynamic_cast< BinEntry* >(entry) ) + if (BinEntry *binEntryPtr = dynamic_cast< BinEntry* >(entry) ) { s << GDCM_BINLOADED; binEntryPtr->SetValue(s.str()); @@ -1651,7 +1651,7 @@ void Document::LoadDocEntry(DocEntry* entry) } delete[] str; - if ( ValEntry* valEntry = dynamic_cast(entry) ) + if ( ValEntry *valEntry = dynamic_cast(entry) ) { if ( Fp->fail() || Fp->eof())//Fp->gcount() == 1 { @@ -1775,7 +1775,7 @@ void Document::FindDocEntryLength( DocEntry *entry ) // and the dictionary entry depending on them. uint16_t correctGroup = SwapShort( entry->GetGroup() ); uint16_t correctElem = SwapShort( entry->GetElement() ); - DictEntry* newTag = GetDictEntryByNumber( correctGroup, + DictEntry *newTag = GetDictEntryByNumber( correctGroup, correctElem ); if ( !newTag ) { @@ -1942,7 +1942,7 @@ std::string Document::GetDocEntryValue(DocEntry *entry) * @param entry Entry to reverse transform * @return Reverse transformed entry value */ -std::string Document::GetDocEntryUnvalue(DocEntry* entry) +std::string Document::GetDocEntryUnvalue(DocEntry *entry) { if ( IsDocEntryAnInteger(entry) && entry->IsImplicitVR() ) { @@ -2003,7 +2003,9 @@ void Document::SkipDocEntry(DocEntry *entry) /** * \brief Skips to the begining of the next Header Entry * \warning NOT end user intended method ! - * @param entry entry to skip + * @param offset start of skipping + * @param readLgth length to skip + */ void Document::SkipToNextDocEntry(long offset,long readLgth) { @@ -2101,7 +2103,7 @@ bool Document::IsDocEntryAnInteger(DocEntry *entry) { uint16_t element = entry->GetElement(); uint16_t group = entry->GetGroup(); - const std::string & vr = entry->GetVR(); + const std::string &vr = entry->GetVR(); uint32_t length = entry->GetLength(); // When we have some semantics on the element we just read, and if we @@ -2568,7 +2570,7 @@ void Document::HandleBrokenEndian(uint16_t group, uint16_t elem) * gets the VR, gets the length, gets the offset value) * @return On succes the newly created DocEntry, NULL on failure. */ -DocEntry* Document::ReadNextDocEntry() +DocEntry *Document::ReadNextDocEntry() { uint16_t group; uint16_t elem; @@ -2760,7 +2762,7 @@ void Document::ReadAndSkipEncapsulatedBasicOffsetTable() // lengths, but we won't bother with such fuses for the time being. if ( itemLength != 0 ) { - char* basicOffsetTableItemValue = new char[itemLength + 1]; + char *basicOffsetTableItemValue = new char[itemLength + 1]; Fp->read(basicOffsetTableItemValue, itemLength); #ifdef GDCM_DEBUG @@ -2859,7 +2861,7 @@ void Document::ComputeRLEInfo() SkipBytes(rleSegmentLength[nbRleSegments]); // Store the collected info - RLEFrame* newFrameInfo = new RLEFrame; + RLEFrame *newFrameInfo = new RLEFrame; newFrameInfo->NumberFragments = nbRleSegments; for( unsigned int uk = 1; uk <= nbRleSegments; uk++ ) { @@ -2902,7 +2904,7 @@ void Document::ComputeJPEGFragmentInfo() long fragmentOffset = Fp->tellg(); // Store the collected info - JPEGFragment* newFragment = new JPEGFragment; + JPEGFragment *newFragment = new JPEGFragment; newFragment->Offset = fragmentOffset; newFragment->Length = fragmentLength; JPEGInfo->Fragments.push_back( newFragment ); @@ -2928,18 +2930,18 @@ void Document::ComputeJPEGFragmentInfo() * when recursively walking the given set. * @param set The structure to be traversed (recursively). */ -void Document::BuildFlatHashTableRecurse( TagDocEntryHT& builtHT, - DocEntrySet* set ) +void Document::BuildFlatHashTableRecurse( TagDocEntryHT &builtHT, + DocEntrySet *set ) { - if (ElementSet* elementSet = dynamic_cast< ElementSet* > ( set ) ) + if (ElementSet *elementSet = dynamic_cast< ElementSet* > ( set ) ) { - TagDocEntryHT const & currentHT = elementSet->GetTagHT(); + TagDocEntryHT const ¤tHT = elementSet->GetTagHT(); for( TagDocEntryHT::const_iterator i = currentHT.begin(); i != currentHT.end(); ++i) { - DocEntry* entry = i->second; - if ( SeqEntry* seqEntry = dynamic_cast(entry) ) + DocEntry *entry = i->second; + if ( SeqEntry *seqEntry = dynamic_cast(entry) ) { const ListSQItem& items = seqEntry->GetSQItems(); for( ListSQItem::const_iterator item = items.begin(); @@ -2955,15 +2957,15 @@ void Document::BuildFlatHashTableRecurse( TagDocEntryHT& builtHT, return; } - if (SQItem* SQItemSet = dynamic_cast< SQItem* > ( set ) ) + if (SQItem *SQItemSet = dynamic_cast< SQItem* > ( set ) ) { const ListDocEntry& currentList = SQItemSet->GetDocEntries(); for (ListDocEntry::const_iterator i = currentList.begin(); i != currentList.end(); ++i) { - DocEntry* entry = *i; - if ( SeqEntry* seqEntry = dynamic_cast(entry) ) + DocEntry *entry = *i; + if ( SeqEntry *seqEntry = dynamic_cast(entry) ) { const ListSQItem& items = seqEntry->GetSQItems(); for( ListSQItem::const_iterator item = items.begin(); @@ -3003,9 +3005,9 @@ void Document::BuildFlatHashTableRecurse( TagDocEntryHT& builtHT, * \ref BuildFlatHashTable again... * @return The flat std::map<> we juste build. */ -TagDocEntryHT* Document::BuildFlatHashTable() +TagDocEntryHT *Document::BuildFlatHashTable() { - TagDocEntryHT* FlatHT = new TagDocEntryHT; + TagDocEntryHT *FlatHT = new TagDocEntryHT; BuildFlatHashTableRecurse( *FlatHT, this ); return FlatHT; } diff --git a/src/gdcmDocument.h b/src/gdcmDocument.h index 09ba91d8..e7233eb0 100644 --- a/src/gdcmDocument.h +++ b/src/gdcmDocument.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.h,v $ Language: C++ - Date: $Date: 2005/01/06 17:16:16 $ - Version: $Revision: 1.74 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.75 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -74,8 +74,8 @@ public: bool IsEncapsulate(); bool IsDicomV3(); - RLEFramesInfo* GetRLEInfo() { return RLEInfo; } - JPEGFragmentsInfo* GetJPEGInfo() { return JPEGInfo; } + RLEFramesInfo *GetRLEInfo() { return RLEInfo; } + JPEGFragmentsInfo *GetJPEGInfo() { return JPEGInfo; } // Dictionnaries virtual void PrintPubDict (std::ostream &os = std::cout); @@ -84,7 +84,7 @@ public: Dict* GetPubDict(); Dict* GetShaDict(); bool SetShaDict(Dict* dict); - bool SetShaDict(DictKey const & dictName); + bool SetShaDict(DictKey const &dictName); // Swap code /// 'Swap code' accessor (see \ref SwapCode ) @@ -103,51 +103,51 @@ public: /// Accessor to \ref Filename const std::string &GetFileName() const { return Filename; } /// Accessor to \ref Filename - void SetFileName(std::string const & fileName) { Filename = fileName; } + void SetFileName(std::string const &fileName) { Filename = fileName; } - std::ifstream* OpenFile(); + std::ifstream *OpenFile(); bool CloseFile(); - void WriteContent( std::ofstream* fp, FileType type ); + void WriteContent( std::ofstream *fp, FileType type ); // Content entries - virtual bool SetEntryByName (std::string const & content, - TagName const & tagName ); - virtual bool SetEntryByNumber(std::string const & content, + virtual bool SetEntryByName (std::string const &content, + TagName const &tagName ); + virtual bool SetEntryByNumber(std::string const &content, uint16_t group, uint16_t element); - virtual bool SetEntryByNumber(uint8_t* content, int lgth, + virtual bool SetEntryByNumber(uint8_t *content, int lgth, uint16_t group, uint16_t element); - virtual bool SetEntry(std::string const & content,ValEntry* entry); - virtual bool SetEntry(uint8_t* content, int lgth,BinEntry* entry); + virtual bool SetEntry(std::string const &content,ValEntry *entry); + virtual bool SetEntry(uint8_t *content, int lgth,BinEntry *entry); - virtual void* GetEntryBinAreaByNumber(uint16_t group, uint16_t elem); + virtual void *GetEntryBinAreaByNumber(uint16_t group, uint16_t elem); - virtual std::string GetEntryByName (TagName const & tagName); - virtual std::string GetEntryVRByName (TagName const & tagName); + virtual std::string GetEntryByName (TagName const &tagName); + virtual std::string GetEntryVRByName (TagName const &tagName); virtual std::string GetEntryByNumber (uint16_t group, uint16_t elem); virtual std::string GetEntryVRByNumber(uint16_t group, uint16_t elem); virtual int GetEntryLengthByNumber(uint16_t group, uint16_t elem); - DocEntry* GetDocEntryByNumber(uint16_t group, uint16_t element); - DocEntry* GetDocEntryByName (TagName const & tagName); - ValEntry* GetValEntryByNumber(uint16_t group, uint16_t element); - BinEntry* GetBinEntryByNumber(uint16_t group, uint16_t element); + DocEntry *GetDocEntryByNumber(uint16_t group, uint16_t element); + DocEntry *GetDocEntryByName (TagName const &tagName); + ValEntry *GetValEntryByNumber(uint16_t group, uint16_t element); + BinEntry *GetBinEntryByNumber(uint16_t group, uint16_t element); - ValEntry* ReplaceOrCreateByNumber(std::string const & value, + ValEntry *ReplaceOrCreateByNumber(std::string const &value, uint16_t group, uint16_t elem, - TagName const & vr = GDCM_UNKNOWN); - BinEntry* ReplaceOrCreateByNumber(uint8_t* binArea, int lgth, + TagName const &vr = GDCM_UNKNOWN); + BinEntry *ReplaceOrCreateByNumber(uint8_t* binArea, int lgth, uint16_t group, uint16_t elem, - TagName const & vr = GDCM_UNKNOWN); - SeqEntry* ReplaceOrCreateByNumber(uint16_t group, uint16_t elem); + TagName const &vr = GDCM_UNKNOWN); + SeqEntry *ReplaceOrCreateByNumber(uint16_t group, uint16_t elem); - bool ReplaceIfExistByNumber ( std::string const & value, + bool ReplaceIfExistByNumber ( std::string const &value, uint16_t group, uint16_t elem ); virtual void LoadEntryBinArea(uint16_t group, uint16_t elem); - virtual void LoadEntryBinArea(BinEntry* entry); + virtual void LoadEntryBinArea(BinEntry *entry); - void LoadDocEntrySafe(DocEntry* entry); - TagDocEntryHT* BuildFlatHashTable(); + void LoadDocEntrySafe(DocEntry *entry); + TagDocEntryHT *BuildFlatHashTable(); // Divers static std::string GetTransferSyntaxValue(TransferSyntaxType type); @@ -158,7 +158,7 @@ protected: // to instanciate from this class Document (only Header and // DicomDir are meaningfull). Document(); - Document( std::string const & filename ); + Document( std::string const &filename ); virtual ~Document(); void ReadAndSkipEncapsulatedBasicOffsetTable(); @@ -179,7 +179,7 @@ protected: int SwapCode; /// File Pointer, opened during Header parsing. - std::ifstream* Fp; + std::ifstream *Fp; /// ACR, ACR_LIBIDO, ExplicitVR, ImplicitVR, Unknown FileType Filetype; @@ -199,10 +199,10 @@ protected: static const unsigned int MAX_SIZE_PRINT_ELEMENT_VALUE; /// Store the RLE frames info obtained during parsing of pixels. - RLEFramesInfo* RLEInfo; + RLEFramesInfo *RLEInfo; /// Store the JPEG fragments info obtained during parsing of pixels. - JPEGFragmentsInfo* JPEGInfo; + JPEGFragmentsInfo *JPEGInfo; private: // Methods @@ -210,19 +210,20 @@ private: void ParseDES(DocEntrySet *set,long offset, long l_max, bool delim_mode); void ParseSQ (SeqEntry *seq, long offset, long l_max, bool delim_mode); - void LoadDocEntry (DocEntry *); - void FindDocEntryLength (DocEntry *) throw ( FormatError ); + void LoadDocEntry (DocEntry *e); + void FindDocEntryLength (DocEntry *e) throw ( FormatError ); std::string FindDocEntryVR(); - bool CheckDocEntryVR (VRKey); + bool CheckDocEntryVR (VRKey k); - std::string GetDocEntryValue (DocEntry *); - std::string GetDocEntryUnvalue(DocEntry *); + std::string GetDocEntryValue (DocEntry *e); + std::string GetDocEntryUnvalue(DocEntry *e); - void SkipDocEntry (DocEntry *); + + void SkipDocEntry (DocEntry *e); void SkipToNextDocEntry (long offset,long readLgth); - void FixDocEntryFoundLength(DocEntry *, uint32_t); - bool IsDocEntryAnInteger (DocEntry *); + void FixDocEntryFoundLength(DocEntry *e, uint32_t l); + bool IsDocEntryAnInteger (DocEntry *e); uint32_t FindDocEntryLengthOB() throw( FormatUnexpected ); @@ -239,21 +240,21 @@ private: void SetMaxSizePrintEntry(long); // DocEntry related utilities - DocEntry* ReadNextDocEntry(); + DocEntry *ReadNextDocEntry(); uint32_t GenerateFreeTagKeyInGroup(uint16_t group); - void BuildFlatHashTableRecurse( TagDocEntryHT& builtHT, + void BuildFlatHashTableRecurse( TagDocEntryHT &builtHT, DocEntrySet* set ); void HandleBrokenEndian(uint16_t group, uint16_t elem); // Variables /// Public dictionary used to parse this header - Dict* RefPubDict; + Dict *RefPubDict; /// \brief Optional "shadow dictionary" (private elements) used to parse /// this header - Dict* RefShaDict; + Dict *RefShaDict; /// \brief Size threshold above which an element value will NOT be loaded /// in memory (to avoid loading the image/volume itself). By default, diff --git a/src/gdcmElementSet.cxx b/src/gdcmElementSet.cxx index 1f99df65..ef76254b 100644 --- a/src/gdcmElementSet.cxx +++ b/src/gdcmElementSet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmElementSet.cxx,v $ Language: C++ - Date: $Date: 2004/12/16 13:46:37 $ - Version: $Revision: 1.35 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.36 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -61,7 +61,7 @@ ElementSet::~ElementSet() * from the H Table * @return */ -void ElementSet::Print(std::ostream& os) +void ElementSet::Print(std::ostream &os) { for( TagDocEntryHT::const_iterator i = TagHT.begin(); i != TagHT.end(); ++i) { @@ -70,7 +70,7 @@ void ElementSet::Print(std::ostream& os) entry->SetPrintLevel(PrintLevel); entry->Print(os); - if ( SeqEntry* seqEntry = dynamic_cast(entry) ) + if ( SeqEntry *seqEntry = dynamic_cast(entry) ) { (void)seqEntry; // Avoid the newline for a sequence: @@ -87,7 +87,7 @@ void ElementSet::Print(std::ostream& os) * from the H Table * @return */ -void ElementSet::WriteContent(std::ofstream* fp, FileType filetype) +void ElementSet::WriteContent(std::ofstream *fp, FileType filetype) { for (TagDocEntryHT::const_iterator i = TagHT.begin(); i != TagHT.end(); @@ -107,9 +107,9 @@ void ElementSet::WriteContent(std::ofstream* fp, FileType filetype) * \brief add a new Dicom Element pointer to the H Table * @param newEntry entry to add */ -bool ElementSet::AddEntry(DocEntry* newEntry) +bool ElementSet::AddEntry(DocEntry *newEntry) { - const TagKey& key = newEntry->GetKey(); + const TagKey &key = newEntry->GetKey(); if( TagHT.count(key) == 1 ) { @@ -130,9 +130,9 @@ bool ElementSet::AddEntry(DocEntry* newEntry) * \warning Some problems when using under Windows... prefer the use of * Initialize / GetNext methods */ -bool ElementSet::RemoveEntry( DocEntry* entryToRemove) +bool ElementSet::RemoveEntry( DocEntry *entryToRemove) { - const TagKey& key = entryToRemove->GetKey(); + const TagKey &key = entryToRemove->GetKey(); if( TagHT.count(key) == 1 ) { TagHT.erase(key); @@ -149,9 +149,9 @@ bool ElementSet::RemoveEntry( DocEntry* entryToRemove) * \brief Clear the hash table from given entry BUT keep the entry. * @param entryToRemove Entry to remove. */ -bool ElementSet::RemoveEntryNoDestroy(DocEntry* entryToRemove) +bool ElementSet::RemoveEntryNoDestroy(DocEntry *entryToRemove) { - const TagKey& key = entryToRemove->GetKey(); + const TagKey &key = entryToRemove->GetKey(); if( TagHT.count(key) == 1 ) { TagHT.erase(key); diff --git a/src/gdcmElementSet.h b/src/gdcmElementSet.h index 6678c05c..030bbf56 100644 --- a/src/gdcmElementSet.h +++ b/src/gdcmElementSet.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmElementSet.h,v $ Language: C++ - Date: $Date: 2004/12/16 11:37:03 $ - Version: $Revision: 1.27 $ + Date: $Date: 2005/01/06 20:03:27 $ + 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 @@ -52,7 +52,7 @@ public: /// Accessor to \ref TagHT // Do not expose this to user (public API) ! // A test is using it thus put it in public (matt) - TagDocEntryHT const & GetTagHT() const { return TagHT; }; + TagDocEntryHT const &GetTagHT() const { return TagHT; }; void Initialize(); DocEntry *GetNextEntry(); diff --git a/src/gdcmException.cxx b/src/gdcmException.cxx index 3bda375a..21184b78 100644 --- a/src/gdcmException.cxx +++ b/src/gdcmException.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmException.cxx,v $ Language: C++ - Date: $Date: 2004/11/04 18:14:34 $ - Version: $Revision: 1.22 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.23 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -31,7 +31,7 @@ namespace gdcm * @param f * @param msg */ -Exception::Exception(const std::string &f, const std::string& msg) throw() +Exception::Exception(const std::string &f, const std::string &msg) throw() #ifdef __GNUC__ try #endif diff --git a/src/gdcmException.h b/src/gdcmException.h index ff0fa67d..0be44e78 100644 --- a/src/gdcmException.h +++ b/src/gdcmException.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmException.h,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:58 $ - Version: $Revision: 1.19 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.20 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -69,7 +69,7 @@ public: /// returns exception name string operator const char *() const throw(); - friend std::ostream& operator<<(std::ostream &os, const Exception &e); + friend std::ostream &operator<<(std::ostream &os, const Exception &e); protected: /// error message part 1 diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 70da398e..cd6ec36b 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 16:05:06 $ - Version: $Revision: 1.182 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.183 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -180,7 +180,7 @@ size_t File::GetImageDataRawSize() * @return Pointer to newly allocated pixel data. * NULL if alloc fails */ -uint8_t* File::GetImageData() +uint8_t *File::GetImageData() { if ( PixelWriteConverter->GetUserData() ) { @@ -213,7 +213,7 @@ uint8_t* File::GetImageData() * @return Pointer to newly allocated pixel data. * \ NULL if alloc fails */ -uint8_t* File::GetImageDataRaw () +uint8_t *File::GetImageDataRaw () { return GetRaw(); } @@ -243,7 +243,7 @@ uint8_t* File::GetImageDataRaw () * @return On success, the number of bytes actually copied. Zero on * failure e.g. MaxSize is lower than necessary. */ -size_t File::GetImageDataIntoVector (void* destination, size_t maxSize) +size_t File::GetImageDataIntoVector (void *destination, size_t maxSize) { if ( ! GetRaw() ) { @@ -291,7 +291,7 @@ size_t File::GetImageDataIntoVector (void* destination, size_t maxSize) * * @return boolean */ -void File::SetImageData(uint8_t* inData, size_t expectedSize) +void File::SetImageData(uint8_t *inData, size_t expectedSize) { SetUserData(inData,expectedSize); } @@ -300,23 +300,23 @@ void File::SetImageData(uint8_t* inData, size_t expectedSize) * \brief Set the image datas defined by the user * \warning When writting the file, this datas are get as default datas to write */ -void File::SetUserData(uint8_t* data, size_t expectedSize) +void File::SetUserData(uint8_t *data, size_t expectedSize) { PixelWriteConverter->SetUserData(data,expectedSize); } /** * \brief Get the image datas defined by the user - * \warning When writting the file, this datas are get as default datas to write + * \warning When writting the file, this datas are get as default data to write */ -uint8_t* File::GetUserData() +uint8_t *File::GetUserData() { return PixelWriteConverter->GetUserData(); } /** * \brief Get the image data size defined by the user - * \warning When writting the file, this datas are get as default datas to write + * \warning When writting the file, this datas are get as default data to write */ size_t File::GetUserDataSize() { @@ -325,16 +325,16 @@ size_t File::GetUserDataSize() /** * \brief Get the image datas from the file. - * If a LUT is found, the datas are expanded to be RGB + * If a LUT is found, the data are expanded to be RGB */ -uint8_t* File::GetRGBData() +uint8_t *File::GetRGBData() { return PixelReadConverter->GetRGB(); } /** * \brief Get the image data size from the file. - * If a LUT is found, the datas are expanded to be RGB + * If a LUT is found, the data are expanded to be RGB */ size_t File::GetRGBDataSize() { @@ -345,14 +345,14 @@ size_t File::GetRGBDataSize() * \brief Get the image datas from the file. * If a LUT is found, the datas are not expanded ! */ -uint8_t* File::GetRawData() +uint8_t *File::GetRawData() { return PixelReadConverter->GetRaw(); } /** * \brief Get the image data size from the file. - * If a LUT is found, the datas are not expanded ! + * If a LUT is found, the data are not expanded ! */ size_t File::GetRawDataSize() { @@ -368,7 +368,7 @@ size_t File::GetRawDataSize() * @return false if write fails */ -bool File::WriteRawData(std::string const & fileName) +bool File::WriteRawData(std::string const &fileName) { std::ofstream fp1(fileName.c_str(), std::ios::out | std::ios::binary ); if (!fp1) @@ -398,7 +398,7 @@ bool File::WriteRawData(std::string const & fileName) * @return false if write fails */ -bool File::WriteDcmImplVR (std::string const & fileName) +bool File::WriteDcmImplVR (std::string const &fileName) { SetWriteTypeToDcmImplVR(); return Write(fileName); @@ -413,7 +413,7 @@ bool File::WriteDcmImplVR (std::string const & fileName) * @return false if write fails */ -bool File::WriteDcmExplVR (std::string const & fileName) +bool File::WriteDcmExplVR (std::string const &fileName) { SetWriteTypeToDcmExplVR(); return Write(fileName); @@ -433,7 +433,7 @@ bool File::WriteDcmExplVR (std::string const & fileName) * @return false if write fails */ -bool File::WriteAcr (std::string const & fileName) +bool File::WriteAcr (std::string const &fileName) { SetWriteTypeToAcr(); return Write(fileName); @@ -445,7 +445,7 @@ bool File::WriteAcr (std::string const & fileName) * (any already existing file is overwritten) * @return false if write fails */ -bool File::Write(std::string const& fileName) +bool File::Write(std::string const &fileName) { switch(WriteType) { @@ -519,7 +519,7 @@ bool File::Write(std::string const& fileName) * @param group group number of the Dicom Element to modify * @param element element number of the Dicom Element to modify */ -bool File::SetEntryByNumber(std::string const& content, +bool File::SetEntryByNumber(std::string const &content, uint16_t group, uint16_t element) { return HeaderInternal->SetEntryByNumber(content,group,element); @@ -535,7 +535,7 @@ bool File::SetEntryByNumber(std::string const& content, * @param group group number of the Dicom Element to modify * @param element element number of the Dicom Element to modify */ -bool File::SetEntryByNumber(uint8_t* content, int lgth, +bool File::SetEntryByNumber(uint8_t *content, int lgth, uint16_t group, uint16_t element) { return HeaderInternal->SetEntryByNumber(content,lgth,group,element); @@ -550,7 +550,7 @@ bool File::SetEntryByNumber(uint8_t* content, int lgth, * \return pointer to the modified/created Header Entry (NULL when creation * failed). */ -bool File::ReplaceOrCreateByNumber(std::string const& content, +bool File::ReplaceOrCreateByNumber(std::string const &content, uint16_t group, uint16_t element) { return HeaderInternal->ReplaceOrCreateByNumber(content,group,element) != NULL; @@ -566,7 +566,7 @@ bool File::ReplaceOrCreateByNumber(std::string const& content, * \return pointer to the modified/created Header Entry (NULL when creation * failed). */ -bool File::ReplaceOrCreateByNumber(uint8_t* binArea, int lgth, +bool File::ReplaceOrCreateByNumber(uint8_t *binArea, int lgth, uint16_t group, uint16_t element) { return HeaderInternal->ReplaceOrCreateByNumber(binArea,lgth,group,element) != NULL; @@ -644,7 +644,7 @@ void File::SetWriteToRaw() } else { - ValEntry* photInt = CopyValEntry(0x0028,0x0004); + ValEntry *photInt = CopyValEntry(0x0028,0x0004); if(HeaderInternal->HasLUT()) { photInt->SetValue("PALETTE COLOR "); @@ -657,7 +657,7 @@ void File::SetWriteToRaw() PixelWriteConverter->SetReadData(PixelReadConverter->GetRaw(), PixelReadConverter->GetRawSize()); - BinEntry* pixel = CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel()); + BinEntry *pixel = CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel()); pixel->SetValue(GDCM_BINLOADED); pixel->SetBinArea(PixelWriteConverter->GetData(),false); pixel->SetLength(PixelWriteConverter->GetDataSize()); @@ -673,13 +673,13 @@ void File::SetWriteToRGB() { PixelReadConverter->BuildRGBImage(); - ValEntry* spp = CopyValEntry(0x0028,0x0002); + ValEntry *spp = CopyValEntry(0x0028,0x0002); spp->SetValue("3 "); - ValEntry* planConfig = CopyValEntry(0x0028,0x0006); + ValEntry *planConfig = CopyValEntry(0x0028,0x0006); planConfig->SetValue("0 "); - ValEntry* photInt = CopyValEntry(0x0028,0x0004); + ValEntry *photInt = CopyValEntry(0x0028,0x0004); photInt->SetValue("RGB "); if(PixelReadConverter->GetRGB()) @@ -693,7 +693,7 @@ void File::SetWriteToRGB() PixelReadConverter->GetRawSize()); } - BinEntry* pixel = CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel()); + BinEntry *pixel = CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel()); pixel->SetValue(GDCM_BINLOADED); pixel->SetBinArea(PixelWriteConverter->GetData(),false); pixel->SetLength(PixelWriteConverter->GetDataSize()); @@ -716,13 +716,13 @@ void File::SetWriteToRGB() // samples per pixels = 1 (in the read file) if(HeaderInternal->GetBitsAllocated()==24) { - ValEntry* bitsAlloc = CopyValEntry(0x0028,0x0100); + ValEntry *bitsAlloc = CopyValEntry(0x0028,0x0100); bitsAlloc->SetValue("8 "); - ValEntry* bitsStored = CopyValEntry(0x0028,0x0101); + ValEntry *bitsStored = CopyValEntry(0x0028,0x0101); bitsStored->SetValue("8 "); - ValEntry* highBit = CopyValEntry(0x0028,0x0102); + ValEntry *highBit = CopyValEntry(0x0028,0x0102); highBit->SetValue("7 "); Archive->Push(bitsAlloc); @@ -767,7 +767,7 @@ void File::SetWriteFileTypeToExplicitVR() std::string ts = Util::DicomString( Document::GetTransferSyntaxValue(ExplicitVRLittleEndian).c_str() ); - ValEntry* tss = CopyValEntry(0x0002,0x0010); + ValEntry *tss = CopyValEntry(0x0002,0x0010); tss->SetValue(ts); Archive->Push(tss); @@ -778,7 +778,7 @@ void File::SetWriteFileTypeToImplicitVR() std::string ts = Util::DicomString( Document::GetTransferSyntaxValue(ImplicitVRLittleEndian).c_str() ); - ValEntry* tss = CopyValEntry(0x0002,0x0010); + ValEntry *tss = CopyValEntry(0x0002,0x0010); tss->SetValue(ts); Archive->Push(tss); @@ -840,10 +840,10 @@ void File::RestoreWriteOfLibido() Archive->Restore(0x0008,0x0010); } -ValEntry* File::CopyValEntry(uint16_t group,uint16_t element) +ValEntry *File::CopyValEntry(uint16_t group,uint16_t element) { - DocEntry* oldE = HeaderInternal->GetDocEntryByNumber(group, element); - ValEntry* newE; + DocEntry *oldE = HeaderInternal->GetDocEntryByNumber(group, element); + ValEntry *newE; if(oldE) { @@ -858,10 +858,10 @@ ValEntry* File::CopyValEntry(uint16_t group,uint16_t element) return(newE); } -BinEntry* File::CopyBinEntry(uint16_t group,uint16_t element) +BinEntry *File::CopyBinEntry(uint16_t group,uint16_t element) { - DocEntry* oldE = HeaderInternal->GetDocEntryByNumber(group, element); - BinEntry* newE; + DocEntry *oldE = HeaderInternal->GetDocEntryByNumber(group, element); + BinEntry *newE; if(oldE) { @@ -896,13 +896,13 @@ void File::Initialise() } } -uint8_t* File::GetRaw() +uint8_t *File::GetRaw() { - uint8_t* raw = PixelReadConverter->GetRaw(); + uint8_t *raw = PixelReadConverter->GetRaw(); if ( ! raw ) { // The Raw image migth not be loaded yet: - std::ifstream* fp = HeaderInternal->OpenFile(); + std::ifstream *fp = HeaderInternal->OpenFile(); PixelReadConverter->ReadAndDecompressPixelData( fp ); if(fp) HeaderInternal->CloseFile(); diff --git a/src/gdcmFile.h b/src/gdcmFile.h index af9382ef..0f75b016 100644 --- a/src/gdcmFile.h +++ b/src/gdcmFile.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.h,v $ Language: C++ - Date: $Date: 2005/01/06 08:46:21 $ - Version: $Revision: 1.90 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.91 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -47,27 +47,27 @@ public: public: File( ); - File( Header* header ); - File( std::string const& filename ); + File( Header *header ); + File( std::string const &filename ); virtual ~File(); void Print(std::ostream &os = std::cout); /// Accessor to \ref Header - Header* GetHeader() { return HeaderInternal; } + Header *GetHeader() { return HeaderInternal; } size_t GetImageDataSize(); size_t GetImageDataRawSize(); - uint8_t* GetImageData(); - uint8_t* GetImageDataRaw(); - size_t GetImageDataIntoVector(void* destination, size_t maxSize); + uint8_t *GetImageData(); + uint8_t *GetImageDataRaw(); + size_t GetImageDataIntoVector(void *destination, size_t maxSize); - void SetImageData(uint8_t* data, size_t expectedSize); + void SetImageData(uint8_t *data, size_t expectedSize); // User datas - void SetUserData(uint8_t* data, size_t expectedSize); + void SetUserData(uint8_t *data, size_t expectedSize); uint8_t* GetUserData(); size_t GetUserDataSize(); // RBG datas (from file @@ -80,19 +80,19 @@ public: // Write pixels of ONE image on hard drive // No test is made on processor "endianity" // The user must call his reader correctly - bool WriteRawData (std::string const& fileName); - bool WriteDcmImplVR(std::string const& fileName); - bool WriteDcmExplVR(std::string const& fileName); - bool WriteAcr (std::string const& fileName); - bool Write(std::string const& fileName); + bool WriteRawData (std::string const &fileName); + bool WriteDcmImplVR(std::string const &fileName); + bool WriteDcmExplVR(std::string const &fileName); + bool WriteAcr (std::string const &fileName); + bool Write (std::string const &fileName); - bool SetEntryByNumber(std::string const& content, + bool SetEntryByNumber(std::string const &content, uint16_t group, uint16_t element); - bool SetEntryByNumber(uint8_t* content, int lgth, + bool SetEntryByNumber(uint8_t *content, int lgth, uint16_t group, uint16_t element); - bool ReplaceOrCreateByNumber(std::string const& content, + bool ReplaceOrCreateByNumber(std::string const &content, uint16_t group, uint16_t element); - bool ReplaceOrCreateByNumber(uint8_t* binArea, int lgth, + bool ReplaceOrCreateByNumber(uint8_t *binArea, int lgth, uint16_t group, uint16_t element); uint8_t* GetLutRGBA(); @@ -127,13 +127,13 @@ protected: void SetWriteToNoLibido(); void RestoreWriteOfLibido(); - ValEntry* CopyValEntry(uint16_t group,uint16_t element); - BinEntry* CopyBinEntry(uint16_t group,uint16_t element); + ValEntry *CopyValEntry(uint16_t group,uint16_t element); + BinEntry *CopyBinEntry(uint16_t group,uint16_t element); private: void Initialise(); - uint8_t* GetRaw(); + uint8_t *GetRaw(); // members variables: /// Header to use to load the file @@ -148,8 +148,8 @@ private: bool Parsed; /// Utility pixel converter - PixelReadConvert* PixelReadConverter; - PixelWriteConvert* PixelWriteConverter; + PixelReadConvert *PixelReadConverter; + PixelWriteConvert *PixelWriteConverter; // Utility header archive DocEntryArchive *Archive; diff --git a/src/gdcmHeader.cxx b/src/gdcmHeader.cxx index 2c356edd..31263819 100644 --- a/src/gdcmHeader.cxx +++ b/src/gdcmHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmHeader.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 16:05:06 $ - Version: $Revision: 1.221 $ + Date: $Date: 2005/01/06 20:03:28 $ + Version: $Revision: 1.222 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -34,7 +34,7 @@ namespace gdcm * \brief Constructor * @param filename name of the file whose header we want to analyze */ -Header::Header( std::string const & filename ): +Header::Header( std::string const &filename ): Document( filename ) { // for some ACR-NEMA images GrPixel, NumPixel is *not* 7fe0,0010 @@ -81,7 +81,7 @@ Header::Header( std::string const & filename ): // Let's create a VirtualDictEntry to allow a further VR modification // and force VR to match with BitsAllocated. - DocEntry* entry = GetDocEntryByNumber(GrPixel, NumPixel); + DocEntry *entry = GetDocEntryByNumber(GrPixel, NumPixel); if ( entry != 0 ) { @@ -127,7 +127,7 @@ Header::~Header () */ bool Header::Write(std::string fileName, FileType filetype) { - std::ofstream* fp = new std::ofstream(fileName.c_str(), + std::ofstream *fp = new std::ofstream(fileName.c_str(), std::ios::out | std::ios::binary); if (*fp == NULL) { @@ -163,7 +163,7 @@ bool Header::Write(std::string fileName, FileType filetype) // Drop 0028|1101, 0028|1102, 0028|1103 // Drop 0028|1201, 0028|1202, 0028|1203 - DocEntry* e = GetDocEntryByNumber(0x0028,0x01101); + DocEntry *e = GetDocEntryByNumber(0x0028,0x01101); if (e) { RemoveEntryNoDestroy(e); diff --git a/src/gdcmHeader.h b/src/gdcmHeader.h index 4e674763..8c56bdd0 100644 --- a/src/gdcmHeader.h +++ b/src/gdcmHeader.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmHeader.h,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:58 $ - Version: $Revision: 1.96 $ + Date: $Date: 2005/01/06 20:03:28 $ + Version: $Revision: 1.97 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -110,7 +110,7 @@ protected: public: Header(); - Header( std::string const & filename ); + Header( std::string const &filename ); ~Header(); diff --git a/src/gdcmPixelReadConvert.cxx b/src/gdcmPixelReadConvert.cxx index ef4d814e..07c2fd94 100644 --- a/src/gdcmPixelReadConvert.cxx +++ b/src/gdcmPixelReadConvert.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmPixelReadConvert.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 13:35:38 $ - Version: $Revision: 1.13 $ + Date: $Date: 2005/01/06 20:03:28 $ + 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 @@ -41,21 +41,21 @@ bool gdcm_read_JPEG2000_file (std::ifstream* fp, void* image_buffer); #define JOCTET uint8_t // For JPEG 8 Bits, body in file gdcmJpeg8.cxx -bool gdcm_read_JPEG_file8 (std::ifstream* fp, void* image_buffer); -bool gdcm_read_JPEG_memory8 (const JOCTET* buffer, const size_t buflen, - void* image_buffer, +bool gdcm_read_JPEG_file8 (std::ifstream *fp, void *image_buffer); +bool gdcm_read_JPEG_memory8 (const JOCTET *buffer, const size_t buflen, + void *image_buffer, size_t *howManyRead, size_t *howManyWritten); // // For JPEG 12 Bits, body in file gdcmJpeg12.cxx -bool gdcm_read_JPEG_file12 (std::ifstream* fp, void* image_buffer); +bool gdcm_read_JPEG_file12 (std::ifstream *fp, void *image_buffer); bool gdcm_read_JPEG_memory12 (const JOCTET *buffer, const size_t buflen, - void* image_buffer, + void *image_buffer, size_t *howManyRead, size_t *howManyWritten); // For JPEG 16 Bits, body in file gdcmJpeg16.cxx // Beware this is misleading there is no 16bits DCT algorithm, only // jpeg lossless compression exist in 16bits. -bool gdcm_read_JPEG_file16 (std::ifstream* fp, void* image_buffer); +bool gdcm_read_JPEG_file16 (std::ifstream *fp, void *image_buffer); bool gdcm_read_JPEG_memory16 (const JOCTET *buffer, const size_t buflen, void* image_buffer, size_t *howManyRead, size_t *howManyWritten); @@ -121,7 +121,7 @@ void PixelReadConvert::AllocateRaw() * \brief Read from file a 12 bits per pixel image and decompress it * into a 16 bits per pixel image. */ -void PixelReadConvert::ReadAndDecompress12BitsTo16Bits( std::ifstream* fp ) +void PixelReadConvert::ReadAndDecompress12BitsTo16Bits( std::ifstream *fp ) throw ( FormatError ) { int nbPixels = XSize * YSize; @@ -216,10 +216,10 @@ bool PixelReadConvert::DecompressRLE16BitsFromRLE8Bits( int NumberOfFrames ) * @param fp File Pointer: on entry the position should be the one of * the fragment to be decoded. */ -bool PixelReadConvert::ReadAndDecompressRLEFragment( uint8_t* subRaw, +bool PixelReadConvert::ReadAndDecompressRLEFragment( uint8_t *subRaw, long fragmentSize, long RawSegmentSize, - std::ifstream* fp ) + std::ifstream *fp ) { int8_t count; long numberOfOutputBytes = 0; @@ -274,9 +274,9 @@ bool PixelReadConvert::ReadAndDecompressRLEFragment( uint8_t* subRaw, * at which the pixel data should be copied * @return Boolean */ -bool PixelReadConvert::ReadAndDecompressRLEFile( std::ifstream* fp ) +bool PixelReadConvert::ReadAndDecompressRLEFile( std::ifstream *fp ) { - uint8_t* subRaw = Raw; + uint8_t *subRaw = Raw; long RawSegmentSize = XSize * YSize; // Loop on the frame[s] @@ -315,7 +315,7 @@ void PixelReadConvert::ConvertSwapZone() if( BitsAllocated == 16 ) { - uint16_t* im16 = (uint16_t*)Raw; + uint16_t *im16 = (uint16_t*)Raw; switch( SwapCode ) { case 0: @@ -421,9 +421,9 @@ void PixelReadConvert::ConvertReorderEndianity() * @param fp File Pointer * @return Boolean */ -bool PixelReadConvert::ReadAndDecompressJPEGFramesFromFile( std::ifstream* fp ) +bool PixelReadConvert::ReadAndDecompressJPEGFramesFromFile( std::ifstream *fp ) { - uint8_t* localRaw = Raw; + uint8_t *localRaw = Raw; // Loop on the fragment[s] for( JPEGFragmentsInfo::JPEGFragmentsList::iterator it = JPEGInfo->Fragments.begin(); @@ -485,7 +485,7 @@ bool PixelReadConvert::ReadAndDecompressJPEGFramesFromFile( std::ifstream* fp ) * @return Boolean */ bool PixelReadConvert:: -ReadAndDecompressJPEGSingleFrameFragmentsFromFile( std::ifstream* fp ) +ReadAndDecompressJPEGSingleFrameFragmentsFromFile( std::ifstream *fp ) { // Loop on the fragment[s] to get total length size_t totalLength = 0; @@ -577,7 +577,7 @@ ReadAndDecompressJPEGSingleFrameFragmentsFromFile( std::ifstream* fp ) * @return Boolean */ bool PixelReadConvert:: -ReadAndDecompressJPEGFragmentedFramesFromFile( std::ifstream* fp ) +ReadAndDecompressJPEGFragmentedFramesFromFile( std::ifstream *fp ) { // Loop on the fragment[s] to get total length size_t totalLength = 0; @@ -676,7 +676,7 @@ ReadAndDecompressJPEGFragmentedFramesFromFile( std::ifstream* fp ) * @param fp File Pointer * @return Boolean */ -bool PixelReadConvert::ReadAndDecompressJPEGFile( std::ifstream* fp ) +bool PixelReadConvert::ReadAndDecompressJPEGFile( std::ifstream *fp ) { if ( IsJPEG2000 ) { @@ -752,8 +752,8 @@ bool PixelReadConvert::ConvertReArrangeBits() throw ( FormatError ) */ void PixelReadConvert::ConvertYcBcRPlanesToRGBPixels() { - uint8_t* localRaw = Raw; - uint8_t* copyRaw = new uint8_t[ RawSize ]; + uint8_t *localRaw = Raw; + uint8_t *copyRaw = new uint8_t[ RawSize ]; memmove( copyRaw, localRaw, RawSize ); // to see the tricks about YBR_FULL, YBR_FULL_422, @@ -764,9 +764,9 @@ void PixelReadConvert::ConvertYcBcRPlanesToRGBPixels() int l = XSize * YSize; int nbFrames = ZSize; - uint8_t* a = copyRaw; - uint8_t* b = copyRaw + l; - uint8_t* c = copyRaw + l + l; + uint8_t *a = copyRaw; + uint8_t *b = copyRaw + l; + uint8_t *c = copyRaw + l + l; double R, G, B; /// \todo : Replace by the 'well known' integer computation @@ -806,8 +806,8 @@ void PixelReadConvert::ConvertYcBcRPlanesToRGBPixels() */ void PixelReadConvert::ConvertRGBPlanesToRGBPixels() { - uint8_t* localRaw = Raw; - uint8_t* copyRaw = new uint8_t[ RawSize ]; + uint8_t *localRaw = Raw; + uint8_t *copyRaw = new uint8_t[ RawSize ]; memmove( copyRaw, localRaw, RawSize ); int l = XSize * YSize * ZSize; @@ -825,7 +825,7 @@ void PixelReadConvert::ConvertRGBPlanesToRGBPixels() delete[] copyRaw; } -bool PixelReadConvert::ReadAndDecompressPixelData( std::ifstream* fp ) +bool PixelReadConvert::ReadAndDecompressPixelData( std::ifstream *fp ) { // ComputeRawAndRGBSizes is already made by // ::GrabInformationsFromHeader. So, the structure sizes are @@ -1022,7 +1022,7 @@ void PixelReadConvert::ComputeRawAndRGBSizes() } } -void PixelReadConvert::GrabInformationsFromHeader( Header* header ) +void PixelReadConvert::GrabInformationsFromHeader( Header *header ) { // Number of Bits Allocated for storing a Pixel is defaulted to 16 // when absent from the header. diff --git a/src/gdcmPixelReadConvert.h b/src/gdcmPixelReadConvert.h index 79d882a6..4c0b5846 100644 --- a/src/gdcmPixelReadConvert.h +++ b/src/gdcmPixelReadConvert.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmPixelReadConvert.h,v $ Language: C++ - Date: $Date: 2005/01/06 16:07:34 $ - Version: $Revision: 1.8 $ + Date: $Date: 2005/01/06 20:03:28 $ + 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 @@ -53,27 +53,27 @@ public: void Print( std::string indent = "", std::ostream &os = std::cout ); // In progress - void GrabInformationsFromHeader( Header* header ); - bool ReadAndDecompressPixelData( std::ifstream* fp ); + void GrabInformationsFromHeader( Header *header ); + bool ReadAndDecompressPixelData( std::ifstream *fp ); void Squeeze(); bool BuildRGBImage(); private: // Use the fp: bool ReadAndDecompressRLEFragment( - uint8_t* subDecompressed, + uint8_t *subDecompressed, long fragmentSize, long decompressedSegmentSize, - std::ifstream* fp ); - void ReadAndDecompress12BitsTo16Bits( std::ifstream* fp ) throw ( FormatError ); - bool ReadAndDecompressRLEFile( std::ifstream* fp ); - bool ReadAndDecompressJPEGFile( std::ifstream* fp ); - bool ReadAndDecompressJPEGFramesFromFile( std::ifstream* fp ); - bool ReadAndDecompressJPEGSingleFrameFragmentsFromFile( std::ifstream* fp ); - bool ReadAndDecompressJPEGFragmentedFramesFromFile( std::ifstream* fp ); + std::ifstream *fp ); + void ReadAndDecompress12BitsTo16Bits( std::ifstream *fp ) throw ( FormatError ); + bool ReadAndDecompressRLEFile( std::ifstream *fp ); + bool ReadAndDecompressJPEGFile( std::ifstream *fp ); + bool ReadAndDecompressJPEGFramesFromFile( std::ifstream *fp ); + bool ReadAndDecompressJPEGSingleFrameFragmentsFromFile( std::ifstream *fp ); + bool ReadAndDecompressJPEGFragmentedFramesFromFile( std::ifstream *fp ); - void BuildLUTRGBA( std::ifstream* fp ); + void BuildLUTRGBA( std::ifstream *fp ); // In place (within Decompressed and with no fp access) decompression // or convertion: @@ -92,16 +92,16 @@ private: // Variables /// Pixel data represented as RGB after LUT color interpretation. - uint8_t* RGB; + uint8_t *RGB; /// Size of RGB image. size_t RGBSize; /// Pixel data after decompression and bit/byte rearrangement. - uint8_t* Raw; + uint8_t *Raw; /// Size of Decompressed image. size_t RawSize; /// \brief Red/Green/Blue/Alpha LookUpTable build out of the /// Red/Green/Blue LUT descriptors (see \ref BuildLUTRGBA ). - uint8_t* LutRGBA; + uint8_t *LutRGBA; size_t PixelOffset; size_t PixelDataLength; @@ -121,8 +121,8 @@ private: bool IsJPEGLossless; bool IsRLELossless; - RLEFramesInfo* RLEInfo; - JPEGFragmentsInfo* JPEGInfo; + RLEFramesInfo *RLEInfo; + JPEGFragmentsInfo *JPEGInfo; // For handling color stage int PlanarConfiguration; @@ -134,9 +134,9 @@ private: std::string LutRedDescriptor; std::string LutGreenDescriptor; std::string LutBlueDescriptor; - uint8_t* LutRedData; - uint8_t* LutGreenData; - uint8_t* LutBlueData; + uint8_t *LutRedData; + uint8_t *LutGreenData; + uint8_t *LutBlueData; }; } // end namespace gdcm diff --git a/src/gdcmPixelWriteConvert.cxx b/src/gdcmPixelWriteConvert.cxx index d0f9e243..8e74c339 100644 --- a/src/gdcmPixelWriteConvert.cxx +++ b/src/gdcmPixelWriteConvert.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmPixelWriteConvert.cxx,v $ Language: C++ - Date: $Date: 2004/12/07 09:32:24 $ - Version: $Revision: 1.2 $ + Date: $Date: 2005/01/06 20:03:28 $ + 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 @@ -45,19 +45,19 @@ PixelWriteConvert::~PixelWriteConvert() //----------------------------------------------------------------------------- // Public -void PixelWriteConvert::SetReadData(uint8_t* data,size_t size) +void PixelWriteConvert::SetReadData(uint8_t *data,size_t size) { ReadData = data; ReadDataSize = size; } -void PixelWriteConvert::SetUserData(uint8_t* data,size_t size) +void PixelWriteConvert::SetUserData(uint8_t *data,size_t size) { UserData = data; UserDataSize = size; } -uint8_t* PixelWriteConvert::GetData() +uint8_t *PixelWriteConvert::GetData() { if(UserData) { diff --git a/src/gdcmPixelWriteConvert.h b/src/gdcmPixelWriteConvert.h index 597966f1..4f3b5b39 100644 --- a/src/gdcmPixelWriteConvert.h +++ b/src/gdcmPixelWriteConvert.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmPixelWriteConvert.h,v $ Language: C++ - Date: $Date: 2005/01/06 16:07:34 $ - Version: $Revision: 1.4 $ + Date: $Date: 2005/01/06 20:03:28 $ + Version: $Revision: 1.5 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -36,27 +36,27 @@ public: virtual ~PixelWriteConvert(); // Set/Get of images and their size - void SetReadData(uint8_t* data,size_t size); - uint8_t* GetReadData() { return ReadData; } + void SetReadData(uint8_t *data,size_t size); + uint8_t *GetReadData() { return ReadData; } size_t GetReadDataSize() { return ReadDataSize; } - void SetUserData(uint8_t* data,size_t size); - uint8_t* GetUserData() { return UserData; } + void SetUserData(uint8_t *data,size_t size); + uint8_t *GetUserData() { return UserData; } size_t GetUserDataSize() { return UserDataSize; } // Get the used image and its size - uint8_t* GetData(); + uint8_t *GetData(); size_t GetDataSize(); private: // Variables /// Pixel data represented as RGB after LUT color interpretation. - uint8_t* ReadData; + uint8_t *ReadData; /// Size of RGB image. size_t ReadDataSize; /// User pixel data - uint8_t* UserData; + uint8_t *UserData; /// Size of User image. size_t UserDataSize; }; diff --git a/src/gdcmSQItem.cxx b/src/gdcmSQItem.cxx index c2481956..9babd77f 100644 --- a/src/gdcmSQItem.cxx +++ b/src/gdcmSQItem.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSQItem.cxx,v $ Language: C++ - Date: $Date: 2005/01/05 15:38:28 $ - Version: $Revision: 1.44 $ + Date: $Date: 2005/01/06 20:03:28 $ + Version: $Revision: 1.45 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -60,7 +60,7 @@ SQItem::~SQItem() /* * \brief canonical Printer */ -void SQItem::Print(std::ostream& os) +void SQItem::Print(std::ostream &os) { std::ostringstream s; @@ -76,13 +76,13 @@ void SQItem::Print(std::ostream& os) i != DocEntries.end(); ++i) { - DocEntry* Entry = *i; + DocEntry *Entry = *i; bool PrintEndLine = true; os << s.str(); Entry->SetPrintLevel(PrintLevel); Entry->Print(os); - if ( SeqEntry* seqEntry = dynamic_cast(Entry) ) + if ( SeqEntry *seqEntry = dynamic_cast(Entry) ) { (void)seqEntry; //not used PrintEndLine = false; @@ -98,7 +98,7 @@ void SQItem::Print(std::ostream& os) * \ingroup SQItem * \brief canonical Writer */ -void SQItem::WriteContent(std::ofstream* fp, FileType filetype) +void SQItem::WriteContent(std::ofstream *fp, FileType filetype) { int j; uint16_t item[4] = { 0xfffe, 0xe000, 0xffff, 0xffff }; @@ -147,7 +147,7 @@ void SQItem::WriteContent(std::ofstream* fp, FileType filetype) /** * \brief adds any Entry (Dicom Element) to the Sequence Item */ -bool SQItem::AddEntry(DocEntry* entry) +bool SQItem::AddEntry(DocEntry *entry) { DocEntries.push_back(entry); //TODO : check if it worked @@ -167,7 +167,7 @@ bool SQItem::AddEntry(DocEntry* entry) * @return true if element was found or created successfully */ -bool SQItem::SetEntryByNumber(std::string const & val, uint16_t group, +bool SQItem::SetEntryByNumber(std::string const &val, uint16_t group, uint16_t element) { for(ListDocEntry::iterator i = DocEntries.begin(); diff --git a/src/gdcmSQItem.h b/src/gdcmSQItem.h index f519d7af..9bce85dd 100644 --- a/src/gdcmSQItem.h +++ b/src/gdcmSQItem.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSQItem.h,v $ Language: C++ - Date: $Date: 2004/12/16 11:37:03 $ - Version: $Revision: 1.27 $ + Date: $Date: 2005/01/06 20:03:28 $ + 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 @@ -41,7 +41,7 @@ public: void WriteContent(std::ofstream *fp, FileType filetype); /// \brief returns the DocEntry chained List for this SQ Item. - ListDocEntry const & GetDocEntries() const { return DocEntries; }; + ListDocEntry const &GetDocEntries() const { return DocEntries; }; /// \brief adds the passed DocEntry to the DocEntry chained List for /// this SQ Item. @@ -51,10 +51,10 @@ public: DocEntry *GetDocEntryByNumber(uint16_t group, uint16_t element); // FIXME method to write - //DocEntry *GetDocEntryByName (std::string Name); + //DocEntry *GetDocEntryByName(std::string Name); - bool SetEntryByNumber(std::string const & val, uint16_t group, - uint16_t element); + bool SetEntryByNumber(std::string const &val, uint16_t group, + uint16_t element); std::string GetEntryByNumber(uint16_t group, uint16_t element); @@ -71,10 +71,10 @@ public: void SetDepthLevel(int depth) { SQDepthLevel = depth; } /// Accessor on \ref BaseTagKey. - void SetBaseTagKey( BaseTagKey const & key ) { BaseTagKeyNested = key; } + void SetBaseTagKey( BaseTagKey const &key ) { BaseTagKeyNested = key; } /// Accessor on \ref BaseTagKey. - BaseTagKey const & GetBaseTagKey() const { return BaseTagKeyNested; } + BaseTagKey const &GetBaseTagKey() const { return BaseTagKeyNested; } void Initialize(); DocEntry *GetNextEntry(); diff --git a/src/gdcmSeqEntry.cxx b/src/gdcmSeqEntry.cxx index 25a2c267..1962d89f 100644 --- a/src/gdcmSeqEntry.cxx +++ b/src/gdcmSeqEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSeqEntry.cxx,v $ Language: C++ - Date: $Date: 2004/12/16 13:46:37 $ - Version: $Revision: 1.40 $ + Date: $Date: 2005/01/06 20:03:28 $ + 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 @@ -35,7 +35,7 @@ namespace gdcm * \ingroup SeqEntry * \brief Constructor from a given SeqEntry */ -SeqEntry::SeqEntry( DictEntry* e ) +SeqEntry::SeqEntry( DictEntry *e ) : DocEntry(e) { UsableLength = 0; @@ -51,7 +51,7 @@ SeqEntry::SeqEntry( DictEntry* e ) * @param e Pointer to existing Doc entry * @param depth depth level of the current Seq entry */ -SeqEntry::SeqEntry( DocEntry* e, int depth ) +SeqEntry::SeqEntry( DocEntry *e, int depth ) : DocEntry( e->GetDictEntry() ) { UsableLength = 0; @@ -122,7 +122,7 @@ void SeqEntry::Print( std::ostream &os ) /* * \brief canonical Writer */ -void SeqEntry::WriteContent(std::ofstream* fp, FileType filetype) +void SeqEntry::WriteContent(std::ofstream *fp, FileType filetype) { uint16_t seq_term_gr = 0xfffe; uint16_t seq_term_el = 0xe0dd; @@ -162,7 +162,7 @@ void SeqEntry::AddEntry(SQItem *sqItem, int itemNumber) * Returns the last item when argument is bigget than the total * item number. */ -SQItem* SeqEntry::GetSQItemByOrdinalNumber(int nb) +SQItem *SeqEntry::GetSQItemByOrdinalNumber(int nb) { if (nb<0) { diff --git a/src/gdcmSeqEntry.h b/src/gdcmSeqEntry.h index 4f22ff2f..2388523f 100644 --- a/src/gdcmSeqEntry.h +++ b/src/gdcmSeqEntry.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSeqEntry.h,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:58 $ - Version: $Revision: 1.25 $ + Date: $Date: 2005/01/06 20:03:28 $ + Version: $Revision: 1.26 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -33,21 +33,21 @@ typedef std::list ListSQItem; class GDCM_EXPORT SeqEntry : public DocEntry { public: - SeqEntry( DictEntry* ); - SeqEntry( DocEntry* d, int depth ); + SeqEntry( DictEntry *e); + SeqEntry( DocEntry *d, int depth ); ~SeqEntry(); void Print(std::ostream &os = std::cout); void WriteContent(std::ofstream *fp, FileType filetype); /// returns the SQITEM chained List for this SeQuence. - ListSQItem const & GetSQItems() const { return Items; } + ListSQItem const &GetSQItems() const { return Items; } /// Sets the delimitor mode void SetDelimitorMode(bool dm) { DelimitorMode = dm; } /// Sets the Sequence Delimitation Item - void SetSequenceDelimitationItem(DocEntry * e) { SeqTerm = e;} + void SetSequenceDelimitationItem(DocEntry *e) { SeqTerm = e;} void AddEntry(SQItem *it, int itemNumber); SQItem *GetSQItemByOrdinalNumber(int itemNumber); diff --git a/src/gdcmSerieHeader.cxx b/src/gdcmSerieHeader.cxx index ff773d8b..51198d24 100644 --- a/src/gdcmSerieHeader.cxx +++ b/src/gdcmSerieHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSerieHeader.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:58 $ - Version: $Revision: 1.2 $ + Date: $Date: 2005/01/06 20:03:28 $ + 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 @@ -55,7 +55,7 @@ SerieHeader::~SerieHeader() * \brief add a File to the list based on file name * @param filename Name of the file to deal with */ -void SerieHeader::AddFileName(std::string const & filename) +void SerieHeader::AddFileName(std::string const &filename) { Header *header = new Header( filename ); CoherentGdcmFileList.push_back( header ); @@ -74,7 +74,7 @@ void SerieHeader::AddGdcmFile(Header *file) * \brief Sets the Directory * @param dir Name of the directory to deal with */ -void SerieHeader::SetDirectory(std::string const & dir) +void SerieHeader::SetDirectory(std::string const &dir) { DirList filenames_list(dir); //OS specific diff --git a/src/gdcmSerieHeader.h b/src/gdcmSerieHeader.h index fe95a31b..1a94d7cd 100644 --- a/src/gdcmSerieHeader.h +++ b/src/gdcmSerieHeader.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSerieHeader.h,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:58 $ - Version: $Revision: 1.2 $ + Date: $Date: 2005/01/06 20:03:28 $ + 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 @@ -40,20 +40,20 @@ public: ~SerieHeader(); /// \todo should return bool or throw error ? - void AddFileName(std::string const & filename); + void AddFileName(std::string const &filename); void AddGdcmFile(Header *file); - void SetDirectory(std::string const & dir); + void SetDirectory(std::string const &dir); void OrderGdcmFileList(); /// \warning Assumes all elements in the list have the same global infos. /// Assumes the list is not empty. - Header* GetGdcmHeader() { return CoherentGdcmFileList.front(); } + Header *GetGdcmHeader() { return CoherentGdcmFileList.front(); } typedef std::list GdcmHeaderList; /// \brief Gets the *coherent* File List /// @return the *coherent* File List - const GdcmHeaderList& GetGdcmFileList() { return CoherentGdcmFileList; } + const GdcmHeaderList &GetGdcmFileList() { return CoherentGdcmFileList; } private: bool ImagePositionPatientOrdering(); diff --git a/src/gdcmTS.cxx b/src/gdcmTS.cxx index d489f6f1..4d335126 100644 --- a/src/gdcmTS.cxx +++ b/src/gdcmTS.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmTS.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 15:41:28 $ - Version: $Revision: 1.29 $ + Date: $Date: 2005/01/06 20:03:28 $ + 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 @@ -33,7 +33,7 @@ namespace gdcm { -void FillDefaultTSDict(TSHT & ts); +void FillDefaultTSDict(TSHT &ts); //----------------------------------------------------------------------------- // Constructor / Destructor TS::TS() @@ -91,12 +91,12 @@ void TS::Print(std::ostream &os) //----------------------------------------------------------------------------- // Public -int TS::Count(TSKey const & key) +int TS::Count(TSKey const &key) { return TsMap.count(key); } -TSAtr const & TS::GetValue(TSKey const & key) +TSAtr const & TS::GetValue(TSKey const &key) { TSHT::const_iterator it = TsMap.find(key); if (it == TsMap.end()) diff --git a/src/gdcmTS.h b/src/gdcmTS.h index 76ecc90a..94336b51 100644 --- a/src/gdcmTS.h +++ b/src/gdcmTS.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmTS.h,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:58 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/01/06 20:03:28 $ + 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 @@ -45,8 +45,8 @@ public: void Print(std::ostream &os = std::cout); - int Count(TSKey const & key); - TSAtr const & GetValue(TSKey const & key); + int Count(TSKey const &key); + TSAtr const &GetValue(TSKey const &key); private: TSHT TsMap; diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index ad20827e..bf583caf 100644 --- a/src/gdcmUtil.cxx +++ b/src/gdcmUtil.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmUtil.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 19:39:24 $ - Version: $Revision: 1.76 $ + Date: $Date: 2005/01/06 20:03:28 $ + Version: $Revision: 1.77 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -53,7 +53,7 @@ namespace gdcm * buf.str(); */ -std::string Util::Format(const char* format, ...) +std::string Util::Format(const char *format, ...) { char buffer[2048]; va_list args; @@ -70,8 +70,8 @@ std::string Util::Format(const char* format, ...) * \ingroup Globals * \brief Because not available in C++ (?) */ -void Util::Tokenize (const std::string& str, - std::vector& tokens, +void Util::Tokenize (const std::string &str, + std::vector &tokens, const std::string& delimiters) { std::string::size_type lastPos = str.find_first_not_of(delimiters,0); @@ -90,8 +90,8 @@ void Util::Tokenize (const std::string& str, * Counts the number of occurences of a substring within a string */ -int Util::CountSubstring (const std::string& str, - const std::string& subStr) +int Util::CountSubstring (const std::string &str, + const std::string &subStr) { int count = 0; // counts how many times it appears std::string::size_type x = 0; // The index position in the string @@ -116,7 +116,7 @@ int Util::CountSubstring (const std::string& str, * to avoid corrupting the terminal of invocation when printing) * @param s string to remove non printable characters from */ -std::string Util::CreateCleanString(std::string const & s) +std::string Util::CreateCleanString(std::string const &s) { std::string str = s; @@ -147,7 +147,7 @@ std::string Util::CreateCleanString(std::string const & s) * \brief Add a SEPARATOR to the end of the name is necessary * @param pathname file/directory name to normalize */ -std::string Util::NormalizePath(std::string const & pathname) +std::string Util::NormalizePath(std::string const &pathname) { const char SEPARATOR_X = '/'; const char SEPARATOR_WIN = '\\'; @@ -167,7 +167,7 @@ std::string Util::NormalizePath(std::string const & pathname) * \brief Get the (directory) path from a full path file name * @param fullName file/directory name to extract Path from */ -std::string Util::GetPath(std::string const & fullName) +std::string Util::GetPath(std::string const &fullName) { std::string res = fullName; int pos1 = res.rfind("/"); @@ -189,7 +189,7 @@ std::string Util::GetPath(std::string const & fullName) * \brief Get the (last) name of a full path file name * @param fullName file/directory name to extract end name from */ -std::string Util::GetName(std::string const & fullName) +std::string Util::GetName(std::string const &fullName) { std::string filename = fullName; @@ -240,7 +240,7 @@ std::string Util::GetCurrentTime() * that needed to be escaped with an extra backslash for doxygen) \\0 * as you want. */ -std::string Util::DicomString(const char* s, size_t l) +std::string Util::DicomString(const char *s, size_t l) { std::string r(s, s+l); assert( !(r.size() % 2) ); // == basically 'l' is even @@ -259,7 +259,7 @@ std::string Util::DicomString(const char* s, size_t l) * except it doesn't take a lenght. * It only pad with a null character if length is odd */ -std::string Util::DicomString(const char* s) +std::string Util::DicomString(const char *s) { size_t l = strlen(s); if( l%2 ) @@ -278,7 +278,7 @@ std::string Util::DicomString(const char* s) * - We allow padding of even lenght string by either a null * character of a space */ -bool Util::DicomStringEqual(const std::string& s1, const char *s2) +bool Util::DicomStringEqual(const std::string &s1, const char *s2) { // s2 is the string from the DICOM reference: 'MONOCHROME1' std::string s1_even = s1; //Never change input parameter @@ -702,7 +702,7 @@ std::string Util::GetIPAddress() if( r == 0 ) { // Get host adresses - struct hostent * pHost = gethostbyname(szHostName); + struct hostent *pHost = gethostbyname(szHostName); for( int i = 0; pHost!= NULL && pHost->h_addr_list[i]!= NULL; i++ ) { @@ -732,7 +732,7 @@ std::string Util::GetIPAddress() * each time a DICOM image is create it should have * a unique identifier (URI) */ -std::string Util::CreateUniqueUID(const std::string& root) +std::string Util::CreateUniqueUID(const std::string &root) { // The code works as follow: // echo "gdcm" | od -b @@ -758,12 +758,12 @@ std::string Util::CreateUniqueUID(const std::string& root) } template -std::ostream& binary_write(std::ostream& os, const T& val) +std::ostream &binary_write(std::ostream &os, const T &val) { return os.write(reinterpret_cast(&val), sizeof val); } -std::ostream& binary_write(std::ostream& os, const uint16_t& val) +std::ostream &binary_write(std::ostream &os, const uint16_t &val) { #ifdef GDCM_WORDS_BIGENDIAN uint16_t swap; @@ -774,7 +774,7 @@ std::ostream& binary_write(std::ostream& os, const uint16_t& val) #endif //GDCM_WORDS_BIGENDIAN } -std::ostream& binary_write(std::ostream& os, const uint32_t& val) +std::ostream &binary_write(std::ostream &os, const uint32_t &val) { #ifdef GDCM_WORDS_BIGENDIAN uint32_t swap; @@ -786,12 +786,12 @@ std::ostream& binary_write(std::ostream& os, const uint32_t& val) #endif //GDCM_WORDS_BIGENDIAN } -std::ostream& binary_write(std::ostream& os, const char* val) +std::ostream &binary_write(std::ostream &os, const char *val) { return os.write(val, strlen(val)); } -std::ostream& binary_write(std::ostream& os, std::string const & val) +std::ostream &binary_write(std::ostream &os, std::string const &val) { return os.write(val.c_str(), val.size()); } diff --git a/src/gdcmUtil.h b/src/gdcmUtil.h index 4d44df60..e4490b62 100644 --- a/src/gdcmUtil.h +++ b/src/gdcmUtil.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmUtil.h,v $ Language: C++ - Date: $Date: 2005/01/06 19:10:07 $ - Version: $Revision: 1.47 $ + Date: $Date: 2005/01/06 20:03:28 $ + Version: $Revision: 1.48 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -37,24 +37,24 @@ namespace gdcm class GDCM_EXPORT Util { public: - static std::string Format(const char* format, ...); - static void Tokenize (const std::string& str, - std::vector& tokens, - const std::string& delimiters = " "); - static int CountSubstring (const std::string& str, - const std::string& subStr); + static std::string Format(const char *format, ...); + static void Tokenize (const std::string &str, + std::vector &tokens, + const std::string &delimiters = " "); + static int CountSubstring (const std::string &str, + const std::string &subStr); - static std::string CreateCleanString(std::string const & s); - static std::string NormalizePath(std::string const & name); + static std::string CreateCleanString(std::string const &s); + static std::string NormalizePath(std::string const &name); static std::string GetPath(std::string const &fullName); static std::string GetName(std::string const &fullName); static std::string GetCurrentDate(); static std::string GetCurrentTime(); - static std::string DicomString(const char* s, size_t l); - static std::string DicomString(const char* s); - static bool DicomStringEqual(const std::string& s1, const char *s2); - static std::string CreateUniqueUID(const std::string& root = ""); + static std::string DicomString(const char *s, size_t l); + static std::string DicomString(const char *s); + static bool DicomStringEqual(const std::string &s1, const char *s2); + static std::string CreateUniqueUID(const std::string &root = ""); static bool IsCurrentProcessorBigEndian(); static std::string GetMACAddress(); @@ -64,11 +64,11 @@ private: }; template - GDCM_EXPORT std::ostream& binary_write(std::ostream& os, const T& val); - GDCM_EXPORT std::ostream& binary_write(std::ostream& os, const uint16_t& val); - GDCM_EXPORT std::ostream& binary_write(std::ostream& os, const uint32_t& val); - GDCM_EXPORT std::ostream& binary_write(std::ostream& os, const char* val); - GDCM_EXPORT std::ostream& binary_write(std::ostream& os, std::string const & val); + GDCM_EXPORT std::ostream &binary_write(std::ostream &os, const T &val); + GDCM_EXPORT std::ostream &binary_write(std::ostream &os, const uint16_t &val); + GDCM_EXPORT std::ostream &binary_write(std::ostream &os, const uint32_t &val); + GDCM_EXPORT std::ostream &binary_write(std::ostream &os, const char *val); + GDCM_EXPORT std::ostream &binary_write(std::ostream &os, std::string const & val); } // end namespace gdcm //----------------------------------------------------------------------------- #endif diff --git a/src/gdcmVR.cxx b/src/gdcmVR.cxx index 9e032195..8a716da7 100644 --- a/src/gdcmVR.cxx +++ b/src/gdcmVR.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmVR.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 17:16:16 $ - Version: $Revision: 1.26 $ + Date: $Date: 2005/01/06 20:03:28 $ + Version: $Revision: 1.27 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -26,7 +26,7 @@ namespace gdcm { -void FillDefaultVRDict(VRHT & vr); +void FillDefaultVRDict(VRHT &vr); //----------------------------------------------------------------------------- /** * \brief Constructor @@ -99,7 +99,7 @@ void VR::Print(std::ostream &os) * \brief Get the count for an element * @param key key to count */ -int VR::Count(VRKey const & key) +int VR::Count(VRKey const &key) { return vr.count(key); } @@ -108,11 +108,9 @@ int VR::Count(VRKey const & key) /** * \brief Simple predicate that checks wether the given argument * corresponds to the Value Representation of a \ref BinEntry . - * This predicate is the negation of - * \ref VR::IsVROfGdcmStringRepresentable . * @param tested value representation to check for. */ -bool VR::IsVROfBinaryRepresentable(VRKey const & tested) +bool VR::IsVROfBinaryRepresentable(VRKey const &tested) { //std::cout << "VR::IsVROfGdcmBinaryRepresentable====================" // << tested << std::endl; @@ -135,7 +133,7 @@ bool VR::IsVROfBinaryRepresentable(VRKey const & tested) * but NOT a \ref BinEntry. * @param tested value representation to check for. */ -bool VR::IsVROfStringRepresentable(VRKey const & tested) +bool VR::IsVROfStringRepresentable(VRKey const &tested) { return tested == "AE" || tested == "AS" || @@ -162,12 +160,12 @@ bool VR::IsVROfStringRepresentable(VRKey const & tested) * corresponds to the Value Representation of a \ref SeqEntry * @param tested value representation to check for. */ -bool VR::IsVROfSequence(VRKey const & tested) +bool VR::IsVROfSequence(VRKey const &tested) { return tested == "SQ"; } -bool VR::IsValidVR(VRKey const & key) +bool VR::IsValidVR(VRKey const &key) { return(vr.find(key)!=vr.end()); } diff --git a/src/gdcmVR.h b/src/gdcmVR.h index 0c658b64..8071f48e 100644 --- a/src/gdcmVR.h +++ b/src/gdcmVR.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmVR.h,v $ Language: C++ - Date: $Date: 2005/01/06 17:16:16 $ - Version: $Revision: 1.16 $ + Date: $Date: 2005/01/06 20:03:28 $ + 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 @@ -45,12 +45,13 @@ public: ~VR(); void Print(std::ostream &os = std::cout); - int Count(VRKey const & key); - bool IsVROfBinaryRepresentable(VRKey const & tested); - bool IsVROfStringRepresentable(VRKey const & tested); - bool IsVROfSequence(VRKey const & tested); - bool IsValidVR(VRKey const & key); + int Count(VRKey const &key); + bool IsVROfBinaryRepresentable(VRKey const &tested); + bool IsVROfStringRepresentable(VRKey const &tested); + bool IsVROfSequence(VRKey const &tested); + + bool IsValidVR(VRKey const &key); private: VRHT vr; diff --git a/src/gdcmValEntry.cxx b/src/gdcmValEntry.cxx index 6c10af84..6b81bad9 100644 --- a/src/gdcmValEntry.cxx +++ b/src/gdcmValEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmValEntry.cxx,v $ Language: C++ - Date: $Date: 2004/12/16 13:46:38 $ - Version: $Revision: 1.41 $ + Date: $Date: 2005/01/06 20:03:28 $ + 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 @@ -36,7 +36,7 @@ namespace gdcm * \brief Constructor from a given DictEntry * @param e Pointer to existing dictionary entry */ -ValEntry::ValEntry(DictEntry* e) : DocEntry(e) +ValEntry::ValEntry(DictEntry *e) : DocEntry(e) { } @@ -44,7 +44,7 @@ ValEntry::ValEntry(DictEntry* e) : DocEntry(e) * \brief Constructor from a given DocEntry * @param e Pointer to existing Doc entry */ -ValEntry::ValEntry(DocEntry* e) +ValEntry::ValEntry(DocEntry *e) : DocEntry(e->GetDictEntry()) { UsableLength = e->GetLength(); @@ -66,7 +66,7 @@ ValEntry::~ValEntry () /** * \brief canonical Printer */ -void ValEntry::Print(std::ostream & os) +void ValEntry::Print(std::ostream &os) { uint16_t g = GetGroup(); uint16_t e = GetElement(); @@ -176,7 +176,7 @@ void ValEntry::Print(std::ostream & os) //----------------------------------------------------------------------------- // Public -void ValEntry::SetValue(std::string const & val) +void ValEntry::SetValue(std::string const &val) { // Integers have a special treatement for their length: int l = val.length(); @@ -219,7 +219,7 @@ void ValEntry::SetValue(std::string const & val) /* * \brief canonical Writer */ -void ValEntry::WriteContent(std::ofstream* fp, FileType filetype) +void ValEntry::WriteContent(std::ofstream *fp, FileType filetype) { DocEntry::WriteContent(fp, filetype); diff --git a/src/gdcmValEntry.h b/src/gdcmValEntry.h index d83a18c1..fa2aec8f 100644 --- a/src/gdcmValEntry.h +++ b/src/gdcmValEntry.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmValEntry.h,v $ Language: C++ - Date: $Date: 2004/12/07 13:39:33 $ - Version: $Revision: 1.33 $ + Date: $Date: 2005/01/06 20:03:28 $ + Version: $Revision: 1.34 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -34,18 +34,18 @@ namespace gdcm class GDCM_EXPORT ValEntry : public DocEntry { public: - ValEntry(DictEntry* e); - ValEntry(DocEntry* d); + ValEntry(DictEntry *e); + ValEntry(DocEntry *d); ~ValEntry(); /// \brief Returns the 'Value' (e.g. "Dupond Marcel") converted into a /// 'string', event if it's stored as an integer in the header of the /// current Dicom Document Entry - std::string const & GetValue() const { return Value; }; + std::string const &GetValue() const { return Value; }; /// Sets the value (string) of the current Dicom Document Entry. /// The size is updated - virtual void SetValue(std::string const & val); + virtual void SetValue(std::string const &val); virtual void Print(std::ostream &os = std::cout); @@ -53,7 +53,7 @@ public: protected: /// Sets the value (string) of the current Dicom Document Entry - void SetValueOnly(std::string const & val) { Value = val; }; + void SetValueOnly(std::string const &val) { Value = val; }; private: // Members : -- 2.45.1