From: regrain Date: Tue, 1 Feb 2005 10:29:54 +0000 (+0000) Subject: * src/*.cxx : first parss to normalize file organisation X-Git-Tag: Version1.0.bp~139 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=d1c68c2c2ae9fadf927053150f7fbc625a7c7366;p=gdcm.git * src/*.cxx : first parss to normalize file organisation -- BeNours --- diff --git a/ChangeLog b/ChangeLog index eadc05b3..423712f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2005-01-31 Benoit Regrain + * src/*.cxx : first parss to normalize file organisation + 2005-01-31 Benoit Regrain * src/gdcmDirList.[h|cxx] : add method to find a directory * Test/TestAllReadCompareDicom.cxx : bug fix under Windows diff --git a/src/gdcmBase.cxx b/src/gdcmBase.cxx index dcba3c95..3a94b08b 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/23 10:12:32 $ - Version: $Revision: 1.8 $ + Date: $Date: 2005/02/01 10:29:54 $ + 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 @@ -39,6 +39,15 @@ Base::~Base() { } +//----------------------------------------------------------------------------- +// Public + +//----------------------------------------------------------------------------- +// Protected + +//----------------------------------------------------------------------------- +// Private + //----------------------------------------------------------------------------- // Print /** @@ -50,15 +59,6 @@ void Base::Print(std::ostream &, std::string const & ) { } -//----------------------------------------------------------------------------- -// Public - -//----------------------------------------------------------------------------- -// Protected - -//----------------------------------------------------------------------------- -// Private - //----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmBinEntry.cxx b/src/gdcmBinEntry.cxx index 037db638..37e9267f 100644 --- a/src/gdcmBinEntry.cxx +++ b/src/gdcmBinEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmBinEntry.cxx,v $ Language: C++ - Date: $Date: 2005/01/30 17:30:57 $ - Version: $Revision: 1.59 $ + Date: $Date: 2005/02/01 10:29:54 $ + Version: $Revision: 1.60 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -27,10 +27,8 @@ namespace gdcm { - //----------------------------------------------------------------------------- // Constructor / Destructor - /** * \brief Constructor from a given BinEntry */ @@ -64,40 +62,6 @@ BinEntry::~BinEntry() } } -//----------------------------------------------------------------------------- -// Print -/** - * \brief Prints a BinEntry (Dicom entry) - * @param os ostream we want to print in - * @param indent Indentation string to be prepended during printing - */ -void BinEntry::Print(std::ostream &os, std::string const & ) -{ - os << "B "; - DocEntry::Print(os); - std::ostringstream s; - void* binArea = GetBinArea(); - if (binArea) - { - //s << " [" << GDCM_BINLOADED - s << " [" << GetValue() - << "; length = " << GetLength() << "]"; - } - else - { - if ( GetLength() == 0 ) - { - s << " []"; - } - else - { - //s << " [gdcm::Binary data NOT loaded]"; - s << " [" <SetPrintLevel(PrintLevel); - MetaElems->Print(os); - } - for(ListDicomDirPatient::iterator cc = Patients.begin(); - cc != Patients.end(); - ++cc) - { - (*cc)->SetPrintLevel(PrintLevel); - (*cc)->Print(os); - } -} - //----------------------------------------------------------------------------- // Public /** @@ -398,7 +374,6 @@ bool DicomDir::WriteDicomDir(std::string const &fileName) //----------------------------------------------------------------------------- // Protected - /** * \brief create a Document-like chained list from a root Directory * @param path entry point of the tree-like structure @@ -658,7 +633,6 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type, } } -//----------------------------------------------------------------------------- /** * \brief CallStartMethod */ @@ -672,7 +646,6 @@ void DicomDir::CallStartMethod() } } -//----------------------------------------------------------------------------- /** * \brief CallProgressMethod */ @@ -684,7 +657,6 @@ void DicomDir::CallProgressMethod() } } -//----------------------------------------------------------------------------- /** * \brief CallEndMethod */ @@ -991,3 +963,26 @@ bool DicomDir::HeaderLessThan(Document *header1, Document *header2) } // end namespace gdcm //----------------------------------------------------------------------------- +// Print +/** + * \brief Canonical Printer + * @param os ostream we want to print in + * @param indent Indentation string to be prepended during printing + */ +void DicomDir::Print(std::ostream &os, std::string const & ) +{ + if( MetaElems ) + { + MetaElems->SetPrintLevel(PrintLevel); + MetaElems->Print(os); + } + for(ListDicomDirPatient::iterator cc = Patients.begin(); + cc != Patients.end(); + ++cc) + { + (*cc)->SetPrintLevel(PrintLevel); + (*cc)->Print(os); + } +} + +//----------------------------------------------------------------------------- diff --git a/src/gdcmDicomDir.h b/src/gdcmDicomDir.h index 39c703b8..b54a54d1 100644 --- a/src/gdcmDicomDir.h +++ b/src/gdcmDicomDir.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.h,v $ Language: C++ - Date: $Date: 2005/01/25 11:11:58 $ - Version: $Revision: 1.50 $ + Date: $Date: 2005/02/01 10:29:54 $ + Version: $Revision: 1.51 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -39,7 +39,6 @@ typedef std::list ListDicomDirPatient; typedef std::vector VectDocument; //----------------------------------------------------------------------------- - /** * \ingroup DicomDir * \brief DicomDir defines an object representing a DICOMDIR in memory diff --git a/src/gdcmDicomDirElement.cxx b/src/gdcmDicomDirElement.cxx index 9d0bd878..66665db6 100644 --- a/src/gdcmDicomDirElement.cxx +++ b/src/gdcmDicomDirElement.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirElement.cxx,v $ Language: C++ - Date: $Date: 2005/01/28 17:01:29 $ - Version: $Revision: 1.32 $ + Date: $Date: 2005/02/01 10:29:54 $ + 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 @@ -26,10 +26,11 @@ namespace gdcm { +//----------------------------------------------------------------------------- void FillDefaultDIRDict(DicomDirElement *dde); + //----------------------------------------------------------------------------- // Constructor / Destructor - /** * \brief constructor : populates the chained lists * from the file 'Dicts/DicomDir.dic' @@ -104,6 +105,44 @@ DicomDirElement::~DicomDirElement() DicomDirImageList.clear(); } +//----------------------------------------------------------------------------- +// Public +/** + * \brief Add an entry + * @param type type + * @param elem elem + */ +bool DicomDirElement::AddEntry(DicomDirType type, Element const &elem) +{ + switch( type ) + { + case DD_META : + DicomDirMetaList.push_back(elem); + break; + case DD_PATIENT : + DicomDirPatientList.push_back(elem); + break; + case DD_STUDY : + DicomDirStudyList.push_back(elem); + break; + case DD_SERIE : + DicomDirSerieList.push_back(elem); + break; + case DD_IMAGE : + DicomDirImageList.push_back(elem); + break; + default : + return false; + } + return true; +} + +//----------------------------------------------------------------------------- +// Protected + +//----------------------------------------------------------------------------- +// Private + //----------------------------------------------------------------------------- // Print /** @@ -156,42 +195,4 @@ void DicomDirElement::Print(std::ostream &os) } //----------------------------------------------------------------------------- -// Public -/** - * \brief Add an entry - * @param type type - * @param elem elem - */ -bool DicomDirElement::AddEntry(DicomDirType type, Element const &elem) -{ - switch( type ) - { - case DD_META : - DicomDirMetaList.push_back(elem); - break; - case DD_PATIENT : - DicomDirPatientList.push_back(elem); - break; - case DD_STUDY : - DicomDirStudyList.push_back(elem); - break; - case DD_SERIE : - DicomDirSerieList.push_back(elem); - break; - case DD_IMAGE : - DicomDirImageList.push_back(elem); - break; - default : - return false; - } - return true; -} -//----------------------------------------------------------------------------- -// Protected - -//----------------------------------------------------------------------------- -// Private - -//----------------------------------------------------------------------------- - } // end namespace gdcm diff --git a/src/gdcmDicomDirImage.cxx b/src/gdcmDicomDirImage.cxx index a7024f1f..8950538c 100644 --- a/src/gdcmDicomDirImage.cxx +++ b/src/gdcmDicomDirImage.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirImage.cxx,v $ Language: C++ - Date: $Date: 2005/01/28 17:01:29 $ - Version: $Revision: 1.21 $ + Date: $Date: 2005/02/01 10:29:55 $ + 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 @@ -46,6 +46,15 @@ DicomDirImage::~DicomDirImage() { } +//----------------------------------------------------------------------------- +// Public + +//----------------------------------------------------------------------------- +// Protected + +//----------------------------------------------------------------------------- +// Private + //----------------------------------------------------------------------------- // Print /** @@ -71,15 +80,6 @@ void DicomDirImage::Print(std::ostream &os, std::string const & ) DicomDirObject::Print(os); } -//----------------------------------------------------------------------------- -// Public - -//----------------------------------------------------------------------------- -// Protected - -//----------------------------------------------------------------------------- -// Private - //----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmDicomDirMeta.cxx b/src/gdcmDicomDirMeta.cxx index 11602a66..ec3d35b4 100644 --- a/src/gdcmDicomDirMeta.cxx +++ b/src/gdcmDicomDirMeta.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirMeta.cxx,v $ Language: C++ - Date: $Date: 2005/01/24 16:10:52 $ - Version: $Revision: 1.26 $ + Date: $Date: 2005/02/01 10:29:55 $ + 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 @@ -23,10 +23,8 @@ namespace gdcm { - //----------------------------------------------------------------------------- // Constructor / Destructor - /** * \brief Constructor */ @@ -48,32 +46,8 @@ DicomDirMeta::~DicomDirMeta() { } -//----------------------------------------------------------------------------- -// Print -/** - * \brief Prints the Meta Elements - * @param os ostream to write to - * @param indent Indentation string to be prepended during printing - */ -void DicomDirMeta::Print(std::ostream &os, std::string const & ) -{ - os << "META" << std::endl; - // warning : META doesn't behave exactly like a Objet - for (ListDocEntry::iterator i = DocEntries.begin(); - i != DocEntries.end(); - ++i) - { - (*i)->SetPrintLevel(PrintLevel); - (*i)->Print(); - os << std::endl; - } -} - - //----------------------------------------------------------------------------- // Public - - /** * \brief Writes the Meta Elements * @param fp ofstream to write to @@ -96,5 +70,26 @@ void DicomDirMeta::WriteContent(std::ofstream *fp, FileType filetype) //----------------------------------------------------------------------------- // Private +//----------------------------------------------------------------------------- +// Print +/** + * \brief Prints the Meta Elements + * @param os ostream to write to + * @param indent Indentation string to be prepended during printing + */ +void DicomDirMeta::Print(std::ostream &os, std::string const & ) +{ + os << "META" << std::endl; + // warning : META doesn't behave exactly like a Objet + for (ListDocEntry::iterator i = DocEntries.begin(); + i != DocEntries.end(); + ++i) + { + (*i)->SetPrintLevel(PrintLevel); + (*i)->Print(); + os << std::endl; + } +} + //----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmDicomDirObject.cxx b/src/gdcmDicomDirObject.cxx index 2495ac01..e81d6b77 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/24 14:14:11 $ - Version: $Revision: 1.18 $ + Date: $Date: 2005/02/01 10:29:55 $ + Version: $Revision: 1.19 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -24,7 +24,6 @@ namespace gdcm { - //----------------------------------------------------------------------------- /** * \brief Constructor @@ -79,5 +78,8 @@ void DicomDirObject::FillObject(ListDicomDirMetaElem const &elemList) //----------------------------------------------------------------------------- // Private +//----------------------------------------------------------------------------- +// Print + //----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmDicomDirPatient.cxx b/src/gdcmDicomDirPatient.cxx index ea7d00fc..c35b2f10 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/31 12:19:33 $ - Version: $Revision: 1.35 $ + Date: $Date: 2005/02/01 10:29:55 $ + 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 @@ -25,7 +25,6 @@ namespace gdcm { - //----------------------------------------------------------------------------- // Constructor / Destructor /** @@ -51,27 +50,6 @@ DicomDirPatient::~DicomDirPatient() ClearStudy(); } -//----------------------------------------------------------------------------- -// Print -/** - * \brief Prints the Object - * @param os ostream to write to - * @param indent Indentation string to be prepended during printing - */ -void DicomDirPatient::Print(std::ostream &os, std::string const & ) -{ - os << "PATIENT" << std::endl; - DicomDirObject::Print(os); - - for(ListDicomDirStudy::const_iterator cc = Studies.begin(); - cc != Studies.end(); - ++cc ) - { - (*cc)->SetPrintLevel(PrintLevel); - (*cc)->Print(os); - } -} - //----------------------------------------------------------------------------- // Public /** @@ -164,5 +142,26 @@ DicomDirStudy *DicomDirPatient::GetLastStudy() //----------------------------------------------------------------------------- // Private +//----------------------------------------------------------------------------- +// Print +/** + * \brief Prints the Object + * @param os ostream to write to + * @param indent Indentation string to be prepended during printing + */ +void DicomDirPatient::Print(std::ostream &os, std::string const & ) +{ + os << "PATIENT" << std::endl; + DicomDirObject::Print(os); + + for(ListDicomDirStudy::const_iterator cc = Studies.begin(); + cc != Studies.end(); + ++cc ) + { + (*cc)->SetPrintLevel(PrintLevel); + (*cc)->Print(os); + } +} + //----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmDicomDirSerie.cxx b/src/gdcmDicomDirSerie.cxx index 7dfcfdfd..16e7e4f2 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/28 17:01:29 $ - Version: $Revision: 1.36 $ + Date: $Date: 2005/02/01 10:29:55 $ + Version: $Revision: 1.37 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -24,7 +24,6 @@ namespace gdcm { - //----------------------------------------------------------------------------- // Constructor / Destructor /** @@ -50,27 +49,6 @@ DicomDirSerie::~DicomDirSerie() ClearImage(); } -//----------------------------------------------------------------------------- -// Print -/** - * \brief Prints the Object - * @param os ostream to write to - * @param indent Indentation string to be prepended during printing - */ -void DicomDirSerie::Print(std::ostream &os, std::string const &) -{ - os << "SERIE" << std::endl; - DicomDirObject::Print(os); - - for(ListDicomDirImage::iterator cc = Images.begin(); - cc != Images.end(); - ++cc) - { - (*cc)->SetPrintLevel(PrintLevel); - (*cc)->Print(os); - } -} - //----------------------------------------------------------------------------- // Public /** @@ -149,6 +127,25 @@ DicomDirImage *DicomDirSerie::GetNextImage() // Private //----------------------------------------------------------------------------- -} // end namespace gdcm +// Print +/** + * \brief Prints the Object + * @param os ostream to write to + * @param indent Indentation string to be prepended during printing + */ +void DicomDirSerie::Print(std::ostream &os, std::string const &) +{ + os << "SERIE" << std::endl; + DicomDirObject::Print(os); + for(ListDicomDirImage::iterator cc = Images.begin(); + cc != Images.end(); + ++cc) + { + (*cc)->SetPrintLevel(PrintLevel); + (*cc)->Print(os); + } +} +//----------------------------------------------------------------------------- +} // end namespace gdcm diff --git a/src/gdcmDicomDirStudy.cxx b/src/gdcmDicomDirStudy.cxx index 6cac6beb..0c6fab78 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/31 12:19:33 $ - Version: $Revision: 1.34 $ + Date: $Date: 2005/02/01 10:29:55 $ + Version: $Revision: 1.35 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -49,28 +49,6 @@ DicomDirStudy::~DicomDirStudy() ClearSerie(); } -//----------------------------------------------------------------------------- -// Print -/** - * \brief Prints the Object - * @param os ostream to write to - * @param indent Indentation string to be prepended during printing - * @return - */ -void DicomDirStudy::Print(std::ostream &os, std::string const & ) -{ - os << "STUDY" << std::endl; - DicomDirObject::Print(os); - - for(ListDicomDirSerie::iterator cc = Series.begin(); - cc != Series.end(); - ++cc) - { - (*cc)->SetPrintLevel(PrintLevel); - (*cc)->Print(os); - } -} - //----------------------------------------------------------------------------- // Public /** @@ -165,5 +143,26 @@ DicomDirSerie *DicomDirStudy::GetLastSerie() // Private //----------------------------------------------------------------------------- -} // end namespace gdcm +// Print +/** + * \brief Prints the Object + * @param os ostream to write to + * @param indent Indentation string to be prepended during printing + * @return + */ +void DicomDirStudy::Print(std::ostream &os, std::string const & ) +{ + os << "STUDY" << std::endl; + DicomDirObject::Print(os); + for(ListDicomDirSerie::iterator cc = Series.begin(); + cc != Series.end(); + ++cc) + { + (*cc)->SetPrintLevel(PrintLevel); + (*cc)->Print(os); + } +} + +//----------------------------------------------------------------------------- +} // end namespace gdcm diff --git a/src/gdcmDict.cxx b/src/gdcmDict.cxx index 6287e9aa..d867b3da 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/24 14:14:11 $ - Version: $Revision: 1.70 $ + Date: $Date: 2005/02/01 10:29:55 $ + Version: $Revision: 1.71 $ 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,9 @@ namespace gdcm { +//----------------------------------------------------------------------------- void FillDefaultDataDict(Dict *d); + //----------------------------------------------------------------------------- // Constructor / Destructor /** @@ -85,33 +87,6 @@ Dict::~Dict() ClearEntry(); } -//----------------------------------------------------------------------------- -// Print -/** - * \brief Print all the dictionary entries contained in this dictionary. - * Entries will be sorted by tag i.e. the couple (group, element). - * @param os The output stream to be written to. - * @param indent Indentation string to be prepended during printing - */ -void Dict::Print(std::ostream &os, std::string const & ) -{ - os << "Dict file name : " << Filename << std::endl; - std::ostringstream s; - - for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag) - { - s << "Entry : "; - s << "(" << std::hex << std::setw(4) << tag->second.GetGroup() << ','; - s << std::hex << std::setw(4) << tag->second.GetElement() << ") = " - << std::dec; - s << tag->second.GetVR() << ", "; - s << tag->second.GetVM() << ", "; - s << tag->second.GetName() << "." << std::endl; - } - os << s.str(); -} - - //----------------------------------------------------------------------------- // Public /** @@ -247,5 +222,30 @@ DictEntry *Dict::GetNextEntry() // Private //----------------------------------------------------------------------------- +// Print +/** + * \brief Print all the dictionary entries contained in this dictionary. + * Entries will be sorted by tag i.e. the couple (group, element). + * @param os The output stream to be written to. + * @param indent Indentation string to be prepended during printing + */ +void Dict::Print(std::ostream &os, std::string const & ) +{ + os << "Dict file name : " << Filename << std::endl; + std::ostringstream s; + for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag) + { + s << "Entry : "; + s << "(" << std::hex << std::setw(4) << tag->second.GetGroup() << ','; + s << std::hex << std::setw(4) << tag->second.GetElement() << ") = " + << std::dec; + s << tag->second.GetVR() << ", "; + s << tag->second.GetVM() << ", "; + s << tag->second.GetName() << "." << std::endl; + } + os << s.str(); +} + +//----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmDictEntry.cxx b/src/gdcmDictEntry.cxx index 7c64268a..1d0c7a5a 100644 --- a/src/gdcmDictEntry.cxx +++ b/src/gdcmDictEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDictEntry.cxx,v $ Language: C++ - Date: $Date: 2005/01/23 10:12:33 $ - Version: $Revision: 1.43 $ + Date: $Date: 2005/02/01 10:29:55 $ + 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 @@ -25,7 +25,6 @@ namespace gdcm { - //----------------------------------------------------------------------------- // Constructor / Destructor /** @@ -50,35 +49,6 @@ DictEntry::DictEntry(uint16_t group, uint16_t elem, Key = TranslateToKey(group, elem); } -//----------------------------------------------------------------------------- -// Print -/** - * \brief Prints an entry of the Dicom DictionaryEntry - * @param os ostream we want to print in - * @param indent Indentation string to be prepended during printing - */ -void DictEntry::Print(std::ostream &os, std::string const & ) -{ - std::string vr; - std::ostringstream s; - - vr = GetVR(); - if(vr==GDCM_UNKNOWN) - vr=" "; - - s << DictEntry::TranslateToKey(GetGroup(),GetElement()); - s << " [" << vr << "] "; - - if (PrintLevel >= 1) - { - s.setf(std::ios::left); - s << std::setw(66-GetName().length()) << " "; - } - - s << "[" << GetName()<< "]"; - os << s.str() << std::endl; -} - //----------------------------------------------------------------------------- // Public /** @@ -93,7 +63,6 @@ TagKey DictEntry::TranslateToKey(uint16_t group, uint16_t elem) return Util::Format("%04x|%04x", group, elem); } -//----------------------------------------------------------------------------- /** * \brief If-and only if-the V(alue) R(epresentation) * \ is unset then overwrite it. @@ -111,7 +80,6 @@ void DictEntry::SetVR(TagName const &vr) } } -//----------------------------------------------------------------------------- /** * \brief If-and only if-the V(alue) M(ultiplicity) * \ is unset then overwrite it. @@ -134,6 +102,35 @@ void DictEntry::SetVM(TagName const &vm) //----------------------------------------------------------------------------- // Private +//----------------------------------------------------------------------------- +// Print +/** + * \brief Prints an entry of the Dicom DictionaryEntry + * @param os ostream we want to print in + * @param indent Indentation string to be prepended during printing + */ +void DictEntry::Print(std::ostream &os, std::string const & ) +{ + std::string vr; + std::ostringstream s; + + vr = GetVR(); + if(vr==GDCM_UNKNOWN) + vr=" "; + + s << DictEntry::TranslateToKey(GetGroup(),GetElement()); + s << " [" << vr << "] "; + + if (PrintLevel >= 1) + { + s.setf(std::ios::left); + s << std::setw(66-GetName().length()) << " "; + } + + s << "[" << GetName()<< "]"; + os << s.str() << std::endl; +} + //----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmDictSet.cxx b/src/gdcmDictSet.cxx index c9cdfbcf..02063318 100644 --- a/src/gdcmDictSet.cxx +++ b/src/gdcmDictSet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDictSet.cxx,v $ Language: C++ - Date: $Date: 2005/01/23 10:12:33 $ - Version: $Revision: 1.56 $ + Date: $Date: 2005/02/01 10:29:55 $ + Version: $Revision: 1.57 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -59,75 +59,8 @@ DictSet::~DictSet() VirtualEntry.clear(); } -//----------------------------------------------------------------------------- -// Print -/** - * \brief Print, in an informal fashion, the list of all the dictionaries - * contained is this DictSet, along with their respective content. - * @param os Output stream used for printing. - * @param indent Indentation string to be prepended during printing - */ -void DictSet::Print(std::ostream &os, std::string const & ) -{ - for (DictSetHT::iterator dict = Dicts.begin(); dict != Dicts.end(); ++dict) - { - os << "Printing dictionary " << dict->first << std::endl; - dict->second->Print(os); - } -} - //----------------------------------------------------------------------------- // Public -/** - * \brief Consider all the entries of the public dicom dictionary. - * Build all list of all the tag names of all those entries. - * \sa DictSet::GetPubDictTagNamesByCategory - * @return A list of all entries of the public dicom dictionary. - */ - -// Probabely useless! - -//EntryNamesList *DictSet::GetPubDictEntryNames() -//{ -// return GetDefaultPubDict()->GetDictEntryNames(); -//} - -/** - * \brief - * - Consider all the entries of the public dicom dictionary. - * - Build an hashtable whose keys are the names of the groups - * (fourth field in each line of dictionary) and whose corresponding - * values are lists of all the dictionary entries among that - * group. Note that apparently the Dicom standard doesn't explicitely - * define a name (as a string) for each group. - * NO ! Dicom Standard explicitely doesn't define - * any name, for any group ! - * - A typical usage of this method would be to enable a dynamic - * configuration of a Dicom file browser: the admin/user can - * select in the interface which Dicom tags should be displayed. - * \warning - * - Dicom *doesn't* define any name for any 'categorie' - * (the dictionary fourth field was formerly NIH defined - * -and no longer he is- - * and will be removed when Dicom provides us a text file - * with the 'official' Dictionary, that would be more friendly - * than asking us to perform a line by line check of the dictionary - * at the beginning of each year to -try to- guess the changes) - * - Therefore : please NEVER use that fourth field :-( - * * - * @return An hashtable: whose keys are the names of the groups and whose - * corresponding values are lists of all the dictionary entries - * among that group. - */ - - -// Probabely useless! - -//EntryNamesByCatMap *DictSet::GetPubDictEntryNamesByCategory() -//{ -// return GetDefaultPubDict()->GetDictEntryNamesByCategory(); -//} - /** * \brief Loads a dictionary from a specified file, and add it * to already the existing ones contained in this DictSet. @@ -224,7 +157,6 @@ std::string DictSet::BuildDictPath() return resultPath; } - /** * \brief Get the first entry while visiting the DictSet * \return The first Dict if found, otherwhise NULL @@ -254,7 +186,6 @@ Dict *DictSet::GetNextEntry() //----------------------------------------------------------------------------- // Protected - /** * \brief Adds a Dictionary to a DictSet * \return always true @@ -270,5 +201,21 @@ bool DictSet::AppendDict(Dict *newDict, DictKey const &name) // Private //----------------------------------------------------------------------------- +// Print +/** + * \brief Print, in an informal fashion, the list of all the dictionaries + * contained is this DictSet, along with their respective content. + * @param os Output stream used for printing. + * @param indent Indentation string to be prepended during printing + */ +void DictSet::Print(std::ostream &os, std::string const & ) +{ + for (DictSetHT::iterator dict = Dicts.begin(); dict != Dicts.end(); ++dict) + { + os << "Printing dictionary " << dict->first << std::endl; + dict->second->Print(os); + } +} +//----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmDirList.cxx b/src/gdcmDirList.cxx index 4656a2c1..0600fd16 100644 --- a/src/gdcmDirList.cxx +++ b/src/gdcmDirList.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDirList.cxx,v $ Language: C++ - Date: $Date: 2005/02/01 10:00:34 $ - Version: $Revision: 1.41 $ + Date: $Date: 2005/02/01 10:29:55 $ + 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 @@ -32,6 +32,7 @@ namespace gdcm { +//----------------------------------------------------------------------------- // Constructor / Destructor /** * \brief Constructor @@ -53,7 +54,6 @@ DirList::~DirList() //----------------------------------------------------------------------------- // Public - /** * \brief Print method * @param os ostream to write to @@ -69,7 +69,6 @@ void DirList::Print(std::ostream &os) //----------------------------------------------------------------------------- // Private - /** * \brief Explore a directory with possibility of recursion * return number of files read @@ -161,6 +160,8 @@ bool DirList::IsDirectory(std::string const &dirName) #endif } -} // end namespace gdcm +//----------------------------------------------------------------------------- +// Print //----------------------------------------------------------------------------- +} // end namespace gdcm diff --git a/src/gdcmDocEntry.cxx b/src/gdcmDocEntry.cxx index a1f5882e..d90383c0 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/30 17:30:57 $ - Version: $Revision: 1.49 $ + Date: $Date: 2005/02/01 10:29:55 $ + Version: $Revision: 1.50 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -28,6 +28,7 @@ namespace gdcm { +//----------------------------------------------------------------------------- #define MAX_SIZE_PRINT_ELEMENT_VALUE 64 //----------------------------------------------------------------------------- @@ -48,70 +49,6 @@ DocEntry::DocEntry(DictEntry *in) Length = 0; } -//----------------------------------------------------------------------------- -// Print -/** - * \brief Prints the common part of ValEntry, BinEntry, SeqEntry - * @param os ostream we want to print in - * @param indent Indentation string to be prepended during printing - */ -void DocEntry::Print(std::ostream &os, std::string const & ) -{ - size_t o; - std::string st; - TSKey v; - std::string d2, vr; - std::ostringstream s; - uint32_t lgth; - - o = GetOffset(); - vr = GetVR(); - if(vr==GDCM_UNKNOWN) - vr=" "; - - s << DictEntry::TranslateToKey(GetGroup(),GetElement()); - - if (PrintLevel >= 2) - { - s << " lg : "; - lgth = GetReadLength(); // ReadLength, as opposed to Length - if (lgth == 0xffffffff) - { - st = Util::Format("x(ffff)"); // I said : "x(ffff)" ! - s.setf(std::ios::left); - s << std::setw(10-st.size()) << " "; - s << st << " "; - s.setf(std::ios::left); - s << std::setw(8) << "-1"; - } - else - { - st = Util::Format("x(%x)",lgth); - s.setf(std::ios::left); - s << std::setw(10-st.size()) << " "; - s << st << " "; - s.setf(std::ios::left); - s << std::setw(8) << lgth; - } - s << " Off.: "; - st = Util::Format("x(%x)",o); - s << std::setw(10-st.size()) << " "; - s << st << " "; - s << std::setw(8) << o; - } - - s << "[" << vr << "] "; - - if (PrintLevel >= 1) - { - s.setf(std::ios::left); - s << std::setw(66-GetName().length()) << " "; - } - - s << "[" << GetName()<< "]"; - os << s.str(); -} - //----------------------------------------------------------------------------- // Public /** @@ -267,5 +204,69 @@ bool DocEntry::IsSequenceDelimitor() //----------------------------------------------------------------------------- // Private +//----------------------------------------------------------------------------- +// Print +/** + * \brief Prints the common part of ValEntry, BinEntry, SeqEntry + * @param os ostream we want to print in + * @param indent Indentation string to be prepended during printing + */ +void DocEntry::Print(std::ostream &os, std::string const & ) +{ + size_t o; + std::string st; + TSKey v; + std::string d2, vr; + std::ostringstream s; + uint32_t lgth; + + o = GetOffset(); + vr = GetVR(); + if(vr==GDCM_UNKNOWN) + vr=" "; + + s << DictEntry::TranslateToKey(GetGroup(),GetElement()); + + if (PrintLevel >= 2) + { + s << " lg : "; + lgth = GetReadLength(); // ReadLength, as opposed to Length + if (lgth == 0xffffffff) + { + st = Util::Format("x(ffff)"); // I said : "x(ffff)" ! + s.setf(std::ios::left); + s << std::setw(10-st.size()) << " "; + s << st << " "; + s.setf(std::ios::left); + s << std::setw(8) << "-1"; + } + else + { + st = Util::Format("x(%x)",lgth); + s.setf(std::ios::left); + s << std::setw(10-st.size()) << " "; + s << st << " "; + s.setf(std::ios::left); + s << std::setw(8) << lgth; + } + s << " Off.: "; + st = Util::Format("x(%x)",o); + s << std::setw(10-st.size()) << " "; + s << st << " "; + s << std::setw(8) << o; + } + + s << "[" << vr << "] "; + + if (PrintLevel >= 1) + { + s.setf(std::ios::left); + s << std::setw(66-GetName().length()) << " "; + } + + s << "[" << GetName()<< "]"; + os << s.str(); +} + //----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmDocEntryArchive.cxx b/src/gdcmDocEntryArchive.cxx index eb27dff0..ee4f5bf5 100644 --- a/src/gdcmDocEntryArchive.cxx +++ b/src/gdcmDocEntryArchive.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntryArchive.cxx,v $ Language: C++ - Date: $Date: 2005/01/26 11:42:02 $ - Version: $Revision: 1.10 $ + Date: $Date: 2005/02/01 10:29:55 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -25,6 +25,7 @@ namespace gdcm { //----------------------------------------------------------------------------- +// Constructor / Destructor /** * \brief Constructor */ @@ -33,7 +34,6 @@ DocEntryArchive::DocEntryArchive(File *file) ArchFile = file; } -//----------------------------------------------------------------------------- /** * \brief Destructor */ @@ -42,24 +42,6 @@ DocEntryArchive::~DocEntryArchive() ClearArchive(); } -//----------------------------------------------------------------------------- -// Print -/** - * \brief Print all - * @param os The output stream to be written to. - */ -void DocEntryArchive::Print(std::ostream &os) -{ - os << "Elements in archives :" << std::endl; - for(TagDocEntryHT::iterator it = Archive.begin(); - it!=Archive.end(); - ++it) - { - if(it->second) - it->second->Print(os); - } -} - //----------------------------------------------------------------------------- // Public /** @@ -89,20 +71,6 @@ bool DocEntryArchive::Push(DocEntry *newEntry) // Set the new DocEntry ArchFile->AddEntry(newEntry); -/* // Save the old DocEntry if any - TagDocEntryHT::iterator it = HeaderHT.find(key); - if( it!=HeaderHT.end() ) - { - Archive[key] = it->second; - } - else - { - Archive[key] = NULL; - } - - // Set the new DocEntry - HeaderHT[key] = newEntry;*/ - return true; } return false; @@ -128,14 +96,6 @@ bool DocEntryArchive::Push(uint16_t group,uint16_t elem) if( old ) ArchFile->RemoveEntryNoDestroy(old); -/* // Save the old DocEntry if any - TagDocEntryHT::iterator it = HeaderHT.find(key); - if( it!=HeaderHT.end() ) - { - Archive[key] = it->second; - HeaderHT.erase(it); - }*/ - return true; } return false; @@ -165,23 +125,6 @@ bool DocEntryArchive::Restore(uint16_t group,uint16_t elem) if( Archive[key] ) ArchFile->AddEntry(Archive[key]); -/* // Delete the new value - TagDocEntryHT::iterator restorePos = HeaderHT.find(key); - if( restorePos!=HeaderHT.end() ) - { - delete restorePos->second; - } - - // Restore the old value - if( Archive[key] ) - { - HeaderHT[key] = Archive[key]; - } - else - { - HeaderHT.erase(restorePos); - }*/ - Archive.erase(restoreIt); return true; @@ -211,5 +154,22 @@ void DocEntryArchive::ClearArchive( ) // Private //----------------------------------------------------------------------------- +// Print +/** + * \brief Print all + * @param os The output stream to be written to. + */ +void DocEntryArchive::Print(std::ostream &os) +{ + os << "Elements in archives :" << std::endl; + for(TagDocEntryHT::iterator it = Archive.begin(); + it!=Archive.end(); + ++it) + { + if(it->second) + it->second->Print(os); + } +} +//----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmDocEntrySet.cxx b/src/gdcmDocEntrySet.cxx index 9be0a71f..e2370812 100644 --- a/src/gdcmDocEntrySet.cxx +++ b/src/gdcmDocEntrySet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntrySet.cxx,v $ Language: C++ - Date: $Date: 2005/01/26 11:42:02 $ - Version: $Revision: 1.49 $ + Date: $Date: 2005/02/01 10:29:55 $ + Version: $Revision: 1.50 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -28,6 +28,8 @@ namespace gdcm { +//----------------------------------------------------------------------------- +// Constructor / Destructor //----------------------------------------------------------------------------- // Public @@ -585,5 +587,8 @@ DictEntry *DocEntrySet::GetDictEntry(uint16_t group, uint16_t elem, //----------------------------------------------------------------------------- // Private +//----------------------------------------------------------------------------- +// Print + //----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 5dd5ef26..afd0e6ef 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/31 12:19:34 $ - Version: $Revision: 1.217 $ + Date: $Date: 2005/02/01 10:29:55 $ + Version: $Revision: 1.218 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -42,7 +42,6 @@ namespace gdcm { - //----------------------------------------------------------------------------- // Refer to Document::CheckSwap() //const unsigned int Document::HEADER_LENGTH_TO_READ = 256; @@ -53,7 +52,7 @@ const unsigned int Document::MAX_SIZE_PRINT_ELEMENT_VALUE = 0x7fffffff; //----------------------------------------------------------------------------- // Constructor / Destructor - +// Constructors and destructors are protected to avoid user to invoke directly /** * \brief constructor * @param filename 'Document' (File or DicomDir) to be opened for parsing @@ -174,31 +173,6 @@ Document::~Document () RefShaDict = NULL; } -//----------------------------------------------------------------------------- -// Print - -/** - * \brief Prints The Dict Entries of THE public Dicom Dictionary - * @param os ostream to print to - * @return - */ -void Document::PrintPubDict(std::ostream &os) -{ - RefPubDict->SetPrintLevel(PrintLevel); - RefPubDict->Print(os); -} - -/** - * \brief Prints The Dict Entries of THE shadow Dicom Dictionary - * @param os ostream to print to - * @return - */ -void Document::PrintShaDict(std::ostream &os) -{ - RefShaDict->SetPrintLevel(PrintLevel); - RefShaDict->Print(os); -} - //----------------------------------------------------------------------------- // Public /** @@ -537,7 +511,6 @@ void Document::WriteContent(std::ofstream *fp, FileType filetype) // ----------------------------------------- // Content entries - /** * \brief Loads (from disk) the element content * when a string is not suitable @@ -616,9 +589,6 @@ void Document::LoadDocEntrySafe(DocEntry *entry) //----------------------------------------------------------------------------- // Protected - -// Constructors and destructors are protected to avoid user to invoke directly - /** * \brief Reads a supposed to be 16 Bits integer * (swaps it depending on processor endianity) @@ -721,7 +691,6 @@ int Document::ComputeGroup0002Length( FileType filetype ) //----------------------------------------------------------------------------- // Private - /** * \brief Parses a DocEntrySet (Zero-level DocEntries or SQ Item DocEntries) * @return length of the parsed set. @@ -2081,27 +2050,6 @@ void Document::HandleOutOfGroup0002(uint16_t &group, uint16_t &elem) } } -// GenerateFreeTagKeyInGroup? -// --> What was it designed for ?!? -/** - * \brief Generate a free TagKey i.e. a TagKey that is not present - * in the TagHt dictionary. - * @param group The generated tag must belong to this group. - * @return The element of tag with given group which is fee. - */ -//uint32_t Document::GenerateFreeTagKeyInGroup(uint16_t group) -//{ -// for (uint32_t elem = 0; elem < UINT32_MAX; elem++) -// { -// TagKey key = DictEntry::TranslateToKey(group, elem); -// if (TagHT.count(key) == 0) -// { -// return elem; -// } -// } -// return UINT32_MAX; -//} - /** * \brief Compares two documents, according to \ref DicomDir rules * \warning Does NOT work with ACR-NEMA files @@ -2167,97 +2115,29 @@ bool Document::operator<(Document &document) return false; } -/* - * \brief Walk recursively the given \ref DocEntrySet, and feed - * the given hash table (\ref TagDocEntryHT) with all the - * \ref DocEntry (Dicom entries) encountered. - * This method does the job for \ref BuildFlatHashTable. - * @param builtHT Where to collect all the \ref DocEntry encountered - * when recursively walking the given set. - * @param set The structure to be traversed (recursively). - */ -/*void Document::BuildFlatHashTableRecurse( TagDocEntryHT &builtHT, - DocEntrySet *set ) -{ - if (ElementSet *elementSet = dynamic_cast< ElementSet* > ( set ) ) - { - 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) ) - { - const ListSQItem& items = seqEntry->GetSQItems(); - for( ListSQItem::const_iterator item = items.begin(); - item != items.end(); - ++item) - { - BuildFlatHashTableRecurse( builtHT, *item ); - } - continue; - } - builtHT[entry->GetKey()] = entry; - } - return; - } - - 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) ) - { - const ListSQItem& items = seqEntry->GetSQItems(); - for( ListSQItem::const_iterator item = items.begin(); - item != items.end(); - ++item) - { - BuildFlatHashTableRecurse( builtHT, *item ); - } - continue; - } - builtHT[entry->GetKey()] = entry; - } - - } -}*/ - -/* - * \brief Build a \ref TagDocEntryHT (i.e. a std::map<>) from the current - * Document. - * - * The structure used by a Document (through \ref ElementSet), - * in order to hold the parsed entries of a Dicom header, is a recursive - * one. This is due to the fact that the sequences (when present) - * can be nested. Additionaly, the sequence items (represented in - * gdcm as \ref SQItem) add an extra complexity to the data - * structure. Hence, a gdcm user whishing to visit all the entries of - * a Dicom header will need to dig in the gdcm internals (which - * implies exposing all the internal data structures to the API). - * In order to avoid this burden to the user, \ref BuildFlatHashTable - * recursively builds a temporary hash table, which holds all the - * Dicom entries in a flat structure (a \ref TagDocEntryHT i.e. a - * std::map<>). - * \warning Of course there is NO integrity constrain between the - * returned \ref TagDocEntryHT and the \ref ElementSet used - * to build it. Hence if the underlying \ref ElementSet is - * altered, then it is the caller responsability to invoke - * \ref BuildFlatHashTable again... - * @return The flat std::map<> we juste build. - */ -/*TagDocEntryHT *Document::BuildFlatHashTable() +//----------------------------------------------------------------------------- +// Print +/** + * \brief Prints The Dict Entries of THE public Dicom Dictionary + * @param os ostream to print to + * @return + */ +void Document::PrintPubDict(std::ostream &os) { - TagDocEntryHT *FlatHT = new TagDocEntryHT; - BuildFlatHashTableRecurse( *FlatHT, this ); - return FlatHT; -}*/ + RefPubDict->SetPrintLevel(PrintLevel); + RefPubDict->Print(os); +} -} // end namespace gdcm +/** + * \brief Prints The Dict Entries of THE shadow Dicom Dictionary + * @param os ostream to print to + * @return + */ +void Document::PrintShaDict(std::ostream &os) +{ + RefShaDict->SetPrintLevel(PrintLevel); + RefShaDict->Print(os); +} //----------------------------------------------------------------------------- +} // end namespace gdcm diff --git a/src/gdcmElementSet.cxx b/src/gdcmElementSet.cxx index dbf05c60..510ac747 100644 --- a/src/gdcmElementSet.cxx +++ b/src/gdcmElementSet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmElementSet.cxx,v $ Language: C++ - Date: $Date: 2005/01/25 15:44:24 $ - Version: $Revision: 1.51 $ + Date: $Date: 2005/02/01 10:29:55 $ + Version: $Revision: 1.52 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -24,7 +24,6 @@ namespace gdcm { - //----------------------------------------------------------------------------- // Constructor / Destructor /** @@ -45,31 +44,6 @@ ElementSet::~ElementSet() ClearEntry(); } -//----------------------------------------------------------------------------- -// Print -/** - * \brief Prints the Header Entries (Dicom Elements) from the H Table - * @param os ostream to write to - * @param indent Indentation string to be prepended during printing - */ -void ElementSet::Print(std::ostream &os, std::string const & ) -{ - for( TagDocEntryHT::const_iterator i = TagHT.begin(); i != TagHT.end(); ++i) - { - DocEntry* entry = i->second; - - entry->SetPrintLevel(PrintLevel); - entry->Print(os); - - if ( dynamic_cast(entry) ) - { - // Avoid the newline for a sequence: - continue; - } - os << std::endl; - } -} - //----------------------------------------------------------------------------- // Public /** @@ -209,5 +183,30 @@ DocEntry *ElementSet::GetDocEntry(uint16_t group, uint16_t elem) //----------------------------------------------------------------------------- // Private +//----------------------------------------------------------------------------- +// Print +/** + * \brief Prints the Header Entries (Dicom Elements) from the H Table + * @param os ostream to write to + * @param indent Indentation string to be prepended during printing + */ +void ElementSet::Print(std::ostream &os, std::string const & ) +{ + for( TagDocEntryHT::const_iterator i = TagHT.begin(); i != TagHT.end(); ++i) + { + DocEntry* entry = i->second; + + entry->SetPrintLevel(PrintLevel); + entry->Print(os); + + if ( dynamic_cast(entry) ) + { + // Avoid the newline for a sequence: + continue; + } + os << std::endl; + } +} + //----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmException.cxx b/src/gdcmException.cxx index bea47bb1..698b7a60 100644 --- a/src/gdcmException.cxx +++ b/src/gdcmException.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmException.cxx,v $ Language: C++ - Date: $Date: 2005/01/18 14:28:32 $ - Version: $Revision: 1.25 $ + Date: $Date: 2005/02/01 10:29:55 $ + 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 @@ -21,10 +21,8 @@ #include namespace gdcm { - //----------------------------------------------------------------------------- // Exception - /** * \brief constructor * @param f f @@ -32,22 +30,24 @@ namespace gdcm */ Exception::Exception(const std::string &f, const std::string &msg) throw() #ifdef __GNUC__ - try + try #endif - : From(f), Error(msg) { - } + : From(f), Error(msg) + { + } #ifdef __GNUC__ -catch(...) { - fatal("Exception::Exception(const std::string&, const std::string&, const std::string&)"); -} + catch(...) + { + fatal("Exception::Exception(const std::string&, const std::string&, const std::string&)"); + } #endif - /** * \brief fatal * @param from from */ -void Exception::fatal(const char *from) throw() { +void Exception::fatal(const char *from) throw() +{ try { std::cerr << "Fatal: exception received in " << from @@ -102,18 +102,20 @@ std::string Exception::getName() const throw() std::string name = typeid(*this).name(); return name; #endif - } - catch(...) { - fatal("Exception::getName(std::string &)"); - return ""; - } + } + catch(...) + { + fatal("Exception::getName(std::string &)"); + return ""; + } } /** * \brief Exception */ - Exception::operator const char *() const throw() { - return getName().c_str(); +Exception::operator const char *() const throw() +{ + return getName().c_str(); } //----------------------------------------------------------------------------- @@ -122,14 +124,18 @@ std::string Exception::getName() const throw() * @param os ostream to write to * @param e exception to raise */ - std::ostream& operator<<(std::ostream &os, const Exception &e) { - try { - os << "Exception " << e.getName() << " thrown: " << e.getError() << std::endl; - } - catch(...) { - Exception::fatal("operator<<(std::ostream &, const Exception&)"); - } - return os; +std::ostream& operator<<(std::ostream &os, const Exception &e) +{ + try + { + os << "Exception " << e.getName() << " thrown: " << e.getError() << std::endl; + } + catch(...) + { + Exception::fatal("operator<<(std::ostream &, const Exception&)"); + } + return os; } + } // end namespace gdcm //----------------------------------------------------------------------------- diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index ffa7ae08..cf11b665 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/28 15:10:56 $ - Version: $Revision: 1.205 $ + Date: $Date: 2005/02/01 10:29:55 $ + Version: $Revision: 1.206 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -155,6 +155,8 @@ File::~File () delete JPEGInfo; } +//----------------------------------------------------------------------------- +// Public /** * \brief Performs some consistency checking on various 'File related' * (as opposed to 'DicomDir related') entries @@ -279,13 +281,6 @@ bool File::Write(std::string fileName, FileType filetype) return true; } -//----------------------------------------------------------------------------- -// Print - - -//----------------------------------------------------------------------------- -// Public - /** * \brief This predicate, based on hopefully reasonable heuristics, * decides whether or not the current File was properly parsed @@ -1680,5 +1675,7 @@ void File::ReadAndSkipEncapsulatedBasicOffsetTable() } //----------------------------------------------------------------------------- +// Print +//----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index a1cfd210..33d9f0f8 100644 --- a/src/gdcmFileHelper.cxx +++ b/src/gdcmFileHelper.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFileHelper.cxx,v $ Language: C++ - Date: $Date: 2005/01/26 16:28:58 $ - Version: $Revision: 1.8 $ + Date: $Date: 2005/02/01 10:29:55 $ + 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 @@ -34,8 +34,6 @@ namespace gdcm { -typedef std::pair IterHT; - //------------------------------------------------------------------------- // Constructor / Destructor /** @@ -124,17 +122,6 @@ FileHelper::~FileHelper() FileInternal = 0; } -//----------------------------------------------------------------------------- -// Print -void FileHelper::Print(std::ostream &os, std::string const &) -{ - FileInternal->SetPrintLevel(PrintLevel); - FileInternal->Print(os); - - PixelReadConverter->SetPrintLevel(PrintLevel); - PixelReadConverter->Print(os); -} - //----------------------------------------------------------------------------- // Public /** @@ -609,7 +596,6 @@ uint8_t* FileHelper::GetLutRGBA() //----------------------------------------------------------------------------- // Protected - /** * \brief Check the write integrity * @@ -943,7 +929,7 @@ BinEntry *FileHelper::CopyBinEntry(uint16_t group,uint16_t elem) } //----------------------------------------------------------------------------- -// Protected +// Private /** * \brief Factorization for various forms of constructors. */ @@ -988,8 +974,15 @@ uint8_t *FileHelper::GetRaw() } //----------------------------------------------------------------------------- -// Private +// Print +void FileHelper::Print(std::ostream &os, std::string const &) +{ + FileInternal->SetPrintLevel(PrintLevel); + FileInternal->Print(os); + + PixelReadConverter->SetPrintLevel(PrintLevel); + PixelReadConverter->Print(os); +} //----------------------------------------------------------------------------- } // end namespace gdcm - diff --git a/src/gdcmGlobal.cxx b/src/gdcmGlobal.cxx index 5d8c4e71..5f455db3 100644 --- a/src/gdcmGlobal.cxx +++ b/src/gdcmGlobal.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmGlobal.cxx,v $ Language: C++ - Date: $Date: 2005/01/23 10:12:34 $ - Version: $Revision: 1.16 $ + Date: $Date: 2005/02/01 10:29:55 $ + 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 @@ -26,6 +26,7 @@ namespace gdcm { +//----------------------------------------------------------------------------- // Those global string that are return by reference everywhere in gdcm code // used to be in gdcmCommon.h but due to a 'bug' in gcc/MacOSX // you cannot have static initialization in a multithreaded environment @@ -38,33 +39,20 @@ const std::string GDCM_BINLOADED = "gdcm::Binary data loaded"; const std::string GDCM_NOTLOADED = "gdcm::NotLoaded"; const std::string GDCM_UNREAD = "gdcm::UnRead"; -/** - * \brief Pointer to a container, holding _all_ the Dicom Dictionaries. - */ +//----------------------------------------------------------------------------- DictSet *Global::Dicts = (DictSet *)0; - -/** - * \brief Pointer to a hash table containing the 'Value Representations'. - */ VR *Global::ValRes = (VR *)0; - -/** - * \brief Pointer to a hash table containing the Transfer Syntax codes - * and their english description - */ TS *Global::TranSyn = (TS *)0; - -/** - * \brief Pointer to the hash table containing the Dicom Elements - * necessary to describe each part of a DICOMDIR - */ DicomDirElement *Global::ddElem = (DicomDirElement *)0; +//----------------------------------------------------------------------------- /** * \brief Global container */ Global Glob; +//------------------------------------------------------------------------- +// Constructor / Destructor /** * \brief constructor : populates the various H Tables */ @@ -91,6 +79,9 @@ Global::~Global() delete TranSyn; delete ddElem; } + +//----------------------------------------------------------------------------- +// Public /** * \brief returns a pointer to the 'Value Representation Table' */ @@ -119,4 +110,15 @@ DicomDirElement *Global::GetDicomDirElements() { return ddElem; } + +//----------------------------------------------------------------------------- +// Protected + +//----------------------------------------------------------------------------- +// Private + +//----------------------------------------------------------------------------- +// Print + +//----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmGlobal.h b/src/gdcmGlobal.h index c32be006..7be8db87 100644 --- a/src/gdcmGlobal.h +++ b/src/gdcmGlobal.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmGlobal.h,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:58 $ - Version: $Revision: 1.5 $ + Date: $Date: 2005/02/01 10:29:55 $ + Version: $Revision: 1.6 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -44,9 +44,15 @@ public: static DicomDirElement *GetDicomDirElements(); private: - static DictSet *Dicts; + /// Pointer to a container, holding _all_ the Dicom Dictionaries. + static DictSet *Dicts; + /// Pointer to a hash table containing the 'Value Representations'. static VR *ValRes; + /// Pointer to a hash table containing the Transfer Syntax codes and their + /// english description static TS *TranSyn; + /// Pointer to the hash table containing the Dicom Elements necessary + /// to describe each part of a DICOMDIR static DicomDirElement *ddElem; }; } // end namespace gdcm diff --git a/src/gdcmJPEGFragment.cxx b/src/gdcmJPEGFragment.cxx index b16e4bf1..fa8f86d6 100644 --- a/src/gdcmJPEGFragment.cxx +++ b/src/gdcmJPEGFragment.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmJPEGFragment.cxx,v $ Language: C++ - Date: $Date: 2005/01/31 04:15:33 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/02/01 10:29:55 $ + 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 @@ -21,7 +21,7 @@ namespace gdcm { - +//------------------------------------------------------------------------- // For JPEG 2000, body in file gdcmJpeg2000.cxx // Not yet made bool gdcm_read_JPEG2000_file (std::ifstream* fp, void* image_buffer); @@ -30,6 +30,8 @@ bool gdcm_read_JPEG2000_file (std::ifstream* fp, void* image_buffer); // Not yet made bool gdcm_read_JPEGLS_file (std::ifstream* fp, void* image_buffer); +//------------------------------------------------------------------------- +// Constructor / Destructor /** * \brief Default constructor. */ @@ -42,19 +44,8 @@ JPEGFragment::JPEGFragment() } -/** - * \brief Print self. - * @param os Stream to print to. - * @param indent Indentation string to be prepended during printing. - */ -void JPEGFragment::Print( std::ostream &os, std::string indent ) -{ - os << indent - << "JPEG fragment: offset : " << Offset - << " length : " << Length - << std::endl; -} - +//----------------------------------------------------------------------------- +// Public /** * \brief Decompress 8bits JPEG Fragment * @param fp ifstream to write to @@ -95,5 +86,27 @@ void JPEGFragment::DecompressJPEGFramesFromFile(std::ifstream *fp, } } +//----------------------------------------------------------------------------- +// Protected + +//----------------------------------------------------------------------------- +// Private + +//----------------------------------------------------------------------------- +// Print +/** + * \brief Print self. + * @param os Stream to print to. + * @param indent Indentation string to be prepended during printing. + */ +void JPEGFragment::Print( std::ostream &os, std::string indent ) +{ + os << indent + << "JPEG fragment: offset : " << Offset + << " length : " << Length + << std::endl; +} + +//----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmJPEGFragmentsInfo.cxx b/src/gdcmJPEGFragmentsInfo.cxx index 6fcd14ef..4660612c 100644 --- a/src/gdcmJPEGFragmentsInfo.cxx +++ b/src/gdcmJPEGFragmentsInfo.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmJPEGFragmentsInfo.cxx,v $ Language: C++ - Date: $Date: 2005/01/31 05:24:21 $ - Version: $Revision: 1.17 $ + Date: $Date: 2005/02/01 10:29:55 $ + 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 @@ -23,7 +23,8 @@ namespace gdcm { - +//------------------------------------------------------------------------- +// Constructor / Destructor JPEGFragmentsInfo::JPEGFragmentsInfo() { StateSuspension = 0; @@ -43,32 +44,8 @@ JPEGFragmentsInfo::~JPEGFragmentsInfo() Fragments.clear(); } -/** - * \brief Print self. - * @param os Stream to print to. - * @param indent Indentation string to be prepended during printing. - */ -void JPEGFragmentsInfo::Print( std::ostream &os, std::string const &indent ) -{ - os << std::endl; - os << indent - << "----------------- JPEG fragments --------------------------------" - << std::endl << std::endl; - os << indent - << "Total number of fragments : " << Fragments.size() - << std::endl; - int fragmentNumber = 0; - for(JPEGFragmentsList::iterator it = Fragments.begin(); - it != Fragments.end(); - ++it) - { - os << indent - << " fragment number :" << fragmentNumber++; - (*it)->Print( os, indent + " "); - } - os << std::endl; -} - +//----------------------------------------------------------------------------- +// Public void JPEGFragmentsInfo::DecompressFromFile(std::ifstream *fp, uint8_t *buffer, int nBits, int , int ) { // Pointer to the Raw image @@ -114,5 +91,39 @@ unsigned int JPEGFragmentsInfo::GetFragmentCount() return Fragments.size(); } -} // end namespace gdcm +//----------------------------------------------------------------------------- +// Protected +//----------------------------------------------------------------------------- +// Private + +//----------------------------------------------------------------------------- +// Print +/** + * \brief Print self. + * @param os Stream to print to. + * @param indent Indentation string to be prepended during printing. + */ +void JPEGFragmentsInfo::Print( std::ostream &os, std::string const &indent ) +{ + os << std::endl; + os << indent + << "----------------- JPEG fragments --------------------------------" + << std::endl << std::endl; + os << indent + << "Total number of fragments : " << Fragments.size() + << std::endl; + int fragmentNumber = 0; + for(JPEGFragmentsList::iterator it = Fragments.begin(); + it != Fragments.end(); + ++it) + { + os << indent + << " fragment number :" << fragmentNumber++; + (*it)->Print( os, indent + " "); + } + os << std::endl; +} + +//----------------------------------------------------------------------------- +} // end namespace gdcm diff --git a/src/gdcmJpeg2000.cxx b/src/gdcmJpeg2000.cxx index d2862fa9..4ab11d6e 100644 --- a/src/gdcmJpeg2000.cxx +++ b/src/gdcmJpeg2000.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmJpeg2000.cxx,v $ Language: C++ - Date: $Date: 2005/01/20 17:17:12 $ - Version: $Revision: 1.16 $ + Date: $Date: 2005/02/01 10:29:55 $ + 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 @@ -23,7 +23,6 @@ namespace gdcm { - //----------------------------------------------------------------------------- /** * \brief routine for JPEG decompression @@ -40,7 +39,7 @@ bool gdcm_read_JPEG2000_file (std::ifstream* fp,void* image_buffer) { std::cout << "Sorry JPEG 2000 File not yet taken into account" << std::endl; return false; } -} // end namespace gdcm //----------------------------------------------------------------------------- +} // end namespace gdcm diff --git a/src/gdcmPixelReadConvert.cxx b/src/gdcmPixelReadConvert.cxx index 56f941b7..27ff8e2b 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/31 06:17:22 $ - Version: $Revision: 1.42 $ + Date: $Date: 2005/02/01 10:29:55 $ + 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,9 +30,9 @@ namespace gdcm { +//----------------------------------------------------------------------------- #define str2num(str, typeNum) *((typeNum *)(str)) - //----------------------------------------------------------------------------- // Constructor / Destructor PixelReadConvert::PixelReadConvert() @@ -47,6 +47,13 @@ PixelReadConvert::PixelReadConvert() LutBlueData =0; } +PixelReadConvert::~PixelReadConvert() +{ + Squeeze(); +} + +//----------------------------------------------------------------------------- +// Public void PixelReadConvert::Squeeze() { if ( RGB ) @@ -62,11 +69,6 @@ void PixelReadConvert::Squeeze() LutRGBA = 0; } -PixelReadConvert::~PixelReadConvert() -{ - Squeeze(); -} - void PixelReadConvert::AllocateRGB() { if ( RGB ) @@ -854,6 +856,14 @@ bool PixelReadConvert::BuildRGBImage() return true; } +//----------------------------------------------------------------------------- +// Protected + +//----------------------------------------------------------------------------- +// Private + +//----------------------------------------------------------------------------- +// Print /** * \brief Print self. * @param indent Indentation string to be prepended during printing. @@ -896,6 +906,7 @@ void PixelReadConvert::Print( std::ostream &os, std::string const & indent ) } } +//----------------------------------------------------------------------------- } // end namespace gdcm // NOTES on File internal calls diff --git a/src/gdcmPixelWriteConvert.cxx b/src/gdcmPixelWriteConvert.cxx index 899f816f..645d03ab 100644 --- a/src/gdcmPixelWriteConvert.cxx +++ b/src/gdcmPixelWriteConvert.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmPixelWriteConvert.cxx,v $ Language: C++ - Date: $Date: 2005/01/23 10:12:34 $ - Version: $Revision: 1.5 $ + Date: $Date: 2005/02/01 10:29:56 $ + Version: $Revision: 1.6 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -23,8 +23,9 @@ namespace gdcm { //----------------------------------------------------------------------------- // Constructor / Destructor - -/// \brief Construcror +/** + * \brief Construcror + */ PixelWriteConvert::PixelWriteConvert() { ReadData = 0; @@ -34,14 +35,15 @@ PixelWriteConvert::PixelWriteConvert() UserDataSize = 0; } -/// \brief Destructor +/** + * \brief Destructor + */ PixelWriteConvert::~PixelWriteConvert() { } //----------------------------------------------------------------------------- // Public - /** * \brief SetReadData * @param data data @@ -96,5 +98,14 @@ size_t PixelWriteConvert::GetDataSize() } } +//----------------------------------------------------------------------------- +// Protected + +//----------------------------------------------------------------------------- +// Private + +//----------------------------------------------------------------------------- +// Print + //----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmRLEFrame.cxx b/src/gdcmRLEFrame.cxx index 62da1c6c..0b17ce09 100644 --- a/src/gdcmRLEFrame.cxx +++ b/src/gdcmRLEFrame.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmRLEFrame.cxx,v $ Language: C++ - Date: $Date: 2005/01/31 06:17:22 $ - Version: $Revision: 1.4 $ + Date: $Date: 2005/02/01 10:29:56 $ + 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 @@ -21,26 +21,11 @@ namespace gdcm { +//------------------------------------------------------------------------- +// Constructor / Destructor -/** - * \brief Print self. - * @param indent Indentation string to be prepended during printing. - * @param os Stream to print to. - */ -void RLEFrame::Print( std::ostream &os, std::string indent ) -{ - os << indent - << "--- fragments" - << std::endl; - for ( unsigned int i = 0; i < NumberOfFragments; i++ ) - { - os << indent - << " offset : " << Offset[i] - << " length : " << Length[i] - << std::endl; - } -} - +//----------------------------------------------------------------------------- +// Public void RLEFrame::SetOffset(unsigned int id,long offset) { gdcmAssertMacro(id<15); @@ -144,6 +129,33 @@ bool RLEFrame::ReadAndDecompressRLEFragment( uint8_t *subRaw, return true; } +//----------------------------------------------------------------------------- +// Protected + +//----------------------------------------------------------------------------- +// Private + +//----------------------------------------------------------------------------- +// Print +/** + * \brief Print self. + * @param indent Indentation string to be prepended during printing. + * @param os Stream to print to. + */ +void RLEFrame::Print( std::ostream &os, std::string indent ) +{ + os << indent + << "--- fragments" + << std::endl; + for ( unsigned int i = 0; i < NumberOfFragments; i++ ) + { + os << indent + << " offset : " << Offset[i] + << " length : " << Length[i] + << std::endl; + } +} +//----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmRLEFramesInfo.cxx b/src/gdcmRLEFramesInfo.cxx index cc7a5ca9..d95e93a5 100644 --- a/src/gdcmRLEFramesInfo.cxx +++ b/src/gdcmRLEFramesInfo.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmRLEFramesInfo.cxx,v $ Language: C++ - Date: $Date: 2005/01/31 06:17:22 $ - Version: $Revision: 1.10 $ + Date: $Date: 2005/02/01 10:29:56 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -21,7 +21,8 @@ namespace gdcm { - +//------------------------------------------------------------------------- +// Constructor / Destructor RLEFramesInfo::~RLEFramesInfo() { for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it) @@ -31,30 +32,8 @@ RLEFramesInfo::~RLEFramesInfo() Frames.clear(); } -/** - * \brief Print self. - * @param indent Indentation string to be prepended during printing. - * @param os Stream to print to. - */ -void RLEFramesInfo::Print( std::ostream &os, std::string indent ) -{ - os << std::endl; - os << indent - << "----------------- RLE frames --------------------------------" - << std::endl; - os << indent - << "Total number of Frames : " << Frames.size() - << std::endl; - int frameNumber = 0; - for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it) - { - os << indent - << " frame number :" << frameNumber++ - << std::endl; - (*it)->Print( os, indent + " " ); - } -} - +//----------------------------------------------------------------------------- +// Public void RLEFramesInfo::AddFrame(RLEFrame *frame) { Frames.push_back(frame); @@ -146,5 +125,37 @@ bool RLEFramesInfo::ConvertRLE16BitsFromRLE8Bits( uint8_t* raw, int xSize, return true; } +//----------------------------------------------------------------------------- +// Protected + +//----------------------------------------------------------------------------- +// Private + +//----------------------------------------------------------------------------- +// Print +/** + * \brief Print self. + * @param indent Indentation string to be prepended during printing. + * @param os Stream to print to. + */ +void RLEFramesInfo::Print( std::ostream &os, std::string indent ) +{ + os << std::endl; + os << indent + << "----------------- RLE frames --------------------------------" + << std::endl; + os << indent + << "Total number of Frames : " << Frames.size() + << std::endl; + int frameNumber = 0; + for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it) + { + os << indent + << " frame number :" << frameNumber++ + << std::endl; + (*it)->Print( os, indent + " " ); + } +} +//----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmSQItem.cxx b/src/gdcmSQItem.cxx index d4ee46f9..3180df8a 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/31 12:19:34 $ - Version: $Revision: 1.63 $ + Date: $Date: 2005/02/01 10:29:56 $ + Version: $Revision: 1.64 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -50,45 +50,7 @@ SQItem::~SQItem() } //----------------------------------------------------------------------------- -// Print -/* - * \brief canonical Printer - * @param os Stream to print to. - * @param indent Indentation string to be prepended during printing. - */ -void SQItem::Print(std::ostream &os, std::string const &) -{ - std::ostringstream s; - - if (SQDepthLevel > 0) - { - for (int i = 0; i < SQDepthLevel; ++i) - { - s << " | " ; - } - } - os << s.str() << " --- SQItem number " << SQItemNumber << std::endl; - for (ListDocEntry::iterator i = DocEntries.begin(); - i != DocEntries.end(); - ++i) - { - DocEntry *Entry = *i; - bool PrintEndLine = true; - - os << s.str(); - Entry->SetPrintLevel(PrintLevel); - Entry->Print(os); - if ( dynamic_cast(Entry) ) - { - PrintEndLine = false; - } - if (PrintEndLine) - { - os << std::endl; - } - } -} - +// Public /* * \brief canonical Writer * @param fp file pointer to an already open file. @@ -138,8 +100,6 @@ void SQItem::WriteContent(std::ofstream *fp, FileType filetype) } -//----------------------------------------------------------------------------- -// Public /** * \brief Remove all entry in the Sequence Item */ @@ -258,7 +218,45 @@ DocEntry *SQItem::GetDocEntry(uint16_t group, uint16_t elem) //----------------------------------------------------------------------------- // Private - //----------------------------------------------------------------------------- +// Print +/* + * \brief canonical Printer + * @param os Stream to print to. + * @param indent Indentation string to be prepended during printing. + */ +void SQItem::Print(std::ostream &os, std::string const &) +{ + std::ostringstream s; + if (SQDepthLevel > 0) + { + for (int i = 0; i < SQDepthLevel; ++i) + { + s << " | " ; + } + } + os << s.str() << " --- SQItem number " << SQItemNumber << std::endl; + for (ListDocEntry::iterator i = DocEntries.begin(); + i != DocEntries.end(); + ++i) + { + DocEntry *Entry = *i; + bool PrintEndLine = true; + + os << s.str(); + Entry->SetPrintLevel(PrintLevel); + Entry->Print(os); + if ( dynamic_cast(Entry) ) + { + PrintEndLine = false; + } + if (PrintEndLine) + { + os << std::endl; + } + } +} + +//----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmSeqEntry.cxx b/src/gdcmSeqEntry.cxx index feadac76..9e510814 100644 --- a/src/gdcmSeqEntry.cxx +++ b/src/gdcmSeqEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSeqEntry.cxx,v $ Language: C++ - Date: $Date: 2005/01/31 12:19:34 $ - Version: $Revision: 1.51 $ + Date: $Date: 2005/02/01 10:29:56 $ + Version: $Revision: 1.52 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -29,7 +29,6 @@ namespace gdcm { - //----------------------------------------------------------------------------- // Constructor / Destructor /** @@ -78,49 +77,6 @@ SeqEntry::~SeqEntry() } } -//----------------------------------------------------------------------------- -// Print -/** - * \brief canonical Printer - */ -void SeqEntry::Print( std::ostream &os, std::string const & ) -{ - // First, Print the Dicom Element itself. - os << "S "; - DocEntry::Print(os); - os << std::endl; - - if (GetReadLength() == 0) - return; - - // Then, Print each SQ Item - for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc) - { - (*cc)->SetPrintLevel(PrintLevel); - (*cc)->Print(os); - } - - // at end, print the sequence terminator item, if any - if (DelimitorMode) - { - for ( int i = 0; i < SQDepthLevel; i++ ) - { - os << " | " ; - } - if (SeqTerm != NULL) - { - SeqTerm->SetPrintLevel(PrintLevel); - SeqTerm->Print(os); - os << std::endl; - } - else - { - // fuse - gdcmVerboseMacro(" -------- should have a sequence terminator item"); - } - } -} - //----------------------------------------------------------------------------- // Public /* @@ -206,16 +162,20 @@ SQItem *SeqEntry::GetSQItem(int nb) return *(Items.end()); } -/// \brief returns the number of SQItems within the current Sequence +/** + * \brief returns the number of SQItems within the current Sequence + */ unsigned int SeqEntry::GetNumberOfSQItems() { return Items.size(); } -/// \brief adds the passed ITEM to the ITEM chained List for this SeQuence. -/// @param sqItem SQItem to be pushed back in the SeqEntry -/// @param itemNumber ordinal number of the SQItem -/// \note NOT end-user intendend method ! +/** + * \brief adds the passed ITEM to the ITEM chained List for this SeQuence. + * @param sqItem SQItem to be pushed back in the SeqEntry + * @param itemNumber ordinal number of the SQItem + * \note NOT end-user intendend method ! + */ void SeqEntry::AddSQItem(SQItem *sqItem, int itemNumber) { // FIXME : SQItemNumber is supposed to be the ordinal number of the SQItem @@ -235,5 +195,47 @@ void SeqEntry::AddSQItem(SQItem *sqItem, int itemNumber) // Private //----------------------------------------------------------------------------- -} // end namespace gdcm +// Print +/** + * \brief canonical Printer + */ +void SeqEntry::Print( std::ostream &os, std::string const & ) +{ + // First, Print the Dicom Element itself. + os << "S "; + DocEntry::Print(os); + os << std::endl; + if (GetReadLength() == 0) + return; + + // Then, Print each SQ Item + for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc) + { + (*cc)->SetPrintLevel(PrintLevel); + (*cc)->Print(os); + } + + // at end, print the sequence terminator item, if any + if (DelimitorMode) + { + for ( int i = 0; i < SQDepthLevel; i++ ) + { + os << " | " ; + } + if (SeqTerm != NULL) + { + SeqTerm->SetPrintLevel(PrintLevel); + SeqTerm->Print(os); + os << std::endl; + } + else + { + // fuse + gdcmVerboseMacro(" -------- should have a sequence terminator item"); + } + } +} + +//----------------------------------------------------------------------------- +} // end namespace gdcm diff --git a/src/gdcmSerieHeader.cxx b/src/gdcmSerieHeader.cxx index 93402bf1..627adec0 100644 --- a/src/gdcmSerieHeader.cxx +++ b/src/gdcmSerieHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSerieHeader.cxx,v $ Language: C++ - Date: $Date: 2005/01/31 12:19:34 $ - Version: $Revision: 1.17 $ + Date: $Date: 2005/02/01 10:29:56 $ + 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 @@ -62,36 +62,6 @@ SerieHeader::~SerieHeader() } } -//----------------------------------------------------------------------------- -// Print - -/** - * \brief Canonical printer. - */ -void SerieHeader::Print() -{ - // For all the Coherent File lists of the gdcm::Serie - CoherentFileListmap::iterator itl = CoherentGdcmFileListHT.begin(); - if ( itl == CoherentGdcmFileListHT.end() ) - { - gdcmVerboseMacro( "No Coherent File list found" ); - return; - } - while (itl != CoherentGdcmFileListHT.end()) - { - std::cout << "Serie UID :[" << itl->first << "]" << std::endl; - - // For all the files of a Coherent File list - for (GdcmFileList::iterator it = (itl->second)->begin(); - it != (itl->second)->end(); - ++it) - { - std::cout << " --- " << (*it)->GetFileName() << std::endl; - } - ++itl; - } -} - //----------------------------------------------------------------------------- // Public /** @@ -414,5 +384,34 @@ bool SerieHeader::FileNameOrdering(GdcmFileList *) return true; } -} // end namespace gdcm //----------------------------------------------------------------------------- +// Print +/** + * \brief Canonical printer. + */ +void SerieHeader::Print() +{ + // For all the Coherent File lists of the gdcm::Serie + CoherentFileListmap::iterator itl = CoherentGdcmFileListHT.begin(); + if ( itl == CoherentGdcmFileListHT.end() ) + { + gdcmVerboseMacro( "No Coherent File list found" ); + return; + } + while (itl != CoherentGdcmFileListHT.end()) + { + std::cout << "Serie UID :[" << itl->first << "]" << std::endl; + + // For all the files of a Coherent File list + for (GdcmFileList::iterator it = (itl->second)->begin(); + it != (itl->second)->end(); + ++it) + { + std::cout << " --- " << (*it)->GetFileName() << std::endl; + } + ++itl; + } +} + +//----------------------------------------------------------------------------- +} // end namespace gdcm diff --git a/src/gdcmTS.cxx b/src/gdcmTS.cxx index 348f7e00..3b951c32 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/23 10:12:34 $ - Version: $Revision: 1.38 $ + Date: $Date: 2005/02/01 10:29:56 $ + Version: $Revision: 1.39 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -73,7 +73,9 @@ static const char *SpecialStrings[] = { "Unknown Transfer Syntax" }; +//----------------------------------------------------------------------------- void FillDefaultTSDict(TSHT &ts); + //----------------------------------------------------------------------------- // Constructor / Destructor TS::TS() @@ -105,29 +107,11 @@ TS::TS() } } -//----------------------------------------------------------------------------- TS::~TS() { TsMap.clear(); } -//----------------------------------------------------------------------------- -// Print -/** - * \brief Print all - * @param os The output stream to be written to. - */ -void TS::Print(std::ostream &os) -{ - std::ostringstream s; - - for (TSHT::const_iterator it = TsMap.begin(); it != TsMap.end(); ++it) - { - s << "TS : " << it->first << " = " << it->second << std::endl; - } - os << s.str(); -} - //----------------------------------------------------------------------------- // Public int TS::Count(TSKey const &key) @@ -314,5 +298,21 @@ const char* TS::GetSpecialTransferSyntax(SpecialType t) // Private //----------------------------------------------------------------------------- +// Print +/** + * \brief Print all + * @param os The output stream to be written to. + */ +void TS::Print(std::ostream &os) +{ + std::ostringstream s; + for (TSHT::const_iterator it = TsMap.begin(); it != TsMap.end(); ++it) + { + s << "TS : " << it->first << " = " << it->second << std::endl; + } + os << s.str(); +} + +//----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index 8fa6d9b1..552b5840 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/28 17:29:59 $ - Version: $Revision: 1.127 $ + Date: $Date: 2005/02/01 10:29:56 $ + Version: $Revision: 1.128 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -80,18 +80,20 @@ // For GetCurrentThreadID() #ifdef __linux__ -#include -#include + #include + #include #endif #ifdef __sun -#include + #include #endif namespace gdcm { +//------------------------------------------------------------------------- const std::string Util::GDCM_UID = "1.2.826.0.1.3680043.2.1143"; std::string Util::RootUID = GDCM_UID; +//------------------------------------------------------------------------- /** * \brief Provide a better 'c++' approach for sprintf * For example c code is: @@ -107,7 +109,6 @@ std::string Util::RootUID = GDCM_UID; * gdcm style code is * Format("%04x|%04x", group , elem); */ - std::string Util::Format(const char *format, ...) { char buffer[2048]; @@ -382,29 +383,27 @@ bool Util::IsCurrentProcessorBigEndian() #endif } - - #ifdef _WIN32 -typedef BOOL(WINAPI * pSnmpExtensionInit) ( - IN DWORD dwTimeZeroReference, - OUT HANDLE * hPollForTrapEvent, - OUT AsnObjectIdentifier * supportedView); - -typedef BOOL(WINAPI * pSnmpExtensionTrap) ( - OUT AsnObjectIdentifier * enterprise, - OUT AsnInteger * genericTrap, - OUT AsnInteger * specificTrap, - OUT AsnTimeticks * timeStamp, - OUT RFC1157VarBindList * variableBindings); - -typedef BOOL(WINAPI * pSnmpExtensionQuery) ( - IN BYTE requestType, - IN OUT RFC1157VarBindList * variableBindings, - OUT AsnInteger * errorStatus, - OUT AsnInteger * errorIndex); - -typedef BOOL(WINAPI * pSnmpExtensionInitEx) ( - OUT AsnObjectIdentifier * supportedView); + typedef BOOL(WINAPI * pSnmpExtensionInit) ( + IN DWORD dwTimeZeroReference, + OUT HANDLE * hPollForTrapEvent, + OUT AsnObjectIdentifier * supportedView); + + typedef BOOL(WINAPI * pSnmpExtensionTrap) ( + OUT AsnObjectIdentifier * enterprise, + OUT AsnInteger * genericTrap, + OUT AsnInteger * specificTrap, + OUT AsnTimeticks * timeStamp, + OUT RFC1157VarBindList * variableBindings); + + typedef BOOL(WINAPI * pSnmpExtensionQuery) ( + IN BYTE requestType, + IN OUT RFC1157VarBindList * variableBindings, + OUT AsnInteger * errorStatus, + OUT AsnInteger * errorIndex); + + typedef BOOL(WINAPI * pSnmpExtensionInitEx) ( + OUT AsnObjectIdentifier * supportedView); #endif //_WIN32 @@ -597,13 +596,13 @@ int GetMacAddrSys ( unsigned char *addr ) // We should investiage the use of SIZEOF_ADDR_IFREQ // #ifdef HAVE_SA_LEN -#ifndef max -#define max(a,b) ((a) > (b) ? (a) : (b)) -#endif -#define ifreq_size(i) max(sizeof(struct ifreq),\ - sizeof((i).ifr_name)+(i).ifr_addr.sa_len) + #ifndef max + #define max(a,b) ((a) > (b) ? (a) : (b)) + #endif + #define ifreq_size(i) max(sizeof(struct ifreq),\ + sizeof((i).ifr_name)+(i).ifr_addr.sa_len) #else -#define ifreq_size(i) sizeof(struct ifreq) + #define ifreq_size(i) sizeof(struct ifreq) #endif // HAVE_SA_LEN if( (sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP)) < 0 ) @@ -734,7 +733,7 @@ std::string Util::GetIPAddress() // SUSv2 guarantees that `Host names are limited to 255 bytes'. // POSIX 1003.1-2001 guarantees that `Host names (not including the // terminating NUL) are limited to HOST_NAME_MAX bytes'. -# define HOST_NAME_MAX 255 +#define HOST_NAME_MAX 255 // In this case we should maybe check the string was not truncated. // But I don't known how to check that... #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__) @@ -812,7 +811,6 @@ unsigned int Util::GetCurrentProcessID() // get process identification, POSIX return (unsigned int)getpid(); #endif - } /** @@ -870,6 +868,7 @@ const std::string &Util::GetRootUID() return RootUID; } +//------------------------------------------------------------------------- /** * \brief * @param os ostream to write to @@ -934,5 +933,6 @@ std::ostream &binary_write(std::ostream &os, std::string const &val) return os.write(val.c_str(), val.size()); } +//------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmVR.cxx b/src/gdcmVR.cxx index e50ccc1b..bd179cf8 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/28 17:01:30 $ - Version: $Revision: 1.33 $ + Date: $Date: 2005/02/01 10:29:56 $ + 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 @@ -26,12 +26,14 @@ namespace gdcm { +//----------------------------------------------------------------------------- void FillDefaultVRDict(VRHT &vr); + //----------------------------------------------------------------------------- +// Constructor / Destructor /** * \brief Constructor */ - VR::VR() { std::string filename = DictSet::BuildDictPath() + DICT_VR; @@ -68,7 +70,6 @@ VR::VR() } } -//----------------------------------------------------------------------------- /** * \brief Destructor */ @@ -77,23 +78,6 @@ VR::~VR() vr.clear(); } -//----------------------------------------------------------------------------- -// Print -/** - * \brief Print all - * @param os The output stream to be written to. - */ -void VR::Print(std::ostream &os) -{ - std::ostringstream s; - - for (VRHT::iterator it = vr.begin(); it != vr.end(); ++it) - { - s << "VR : " << it->first << " = " << it->second << std::endl; - } - os << s.str(); -} - //----------------------------------------------------------------------------- // Public /** @@ -105,7 +89,6 @@ int VR::Count(VRKey const &key) return vr.count(key); } -//----------------------------------------------------------------------------- /** * \brief Simple predicate that checks whether the given argument * corresponds to the Value Representation of a \ref BinEntry . @@ -175,5 +158,21 @@ bool VR::IsValidVR(VRKey const &key) // Private //----------------------------------------------------------------------------- +// Print +/** + * \brief Print all + * @param os The output stream to be written to. + */ +void VR::Print(std::ostream &os) +{ + std::ostringstream s; + for (VRHT::iterator it = vr.begin(); it != vr.end(); ++it) + { + s << "VR : " << it->first << " = " << it->second << std::endl; + } + os << s.str(); +} + +//----------------------------------------------------------------------------- } // end namespace gdcm diff --git a/src/gdcmValEntry.cxx b/src/gdcmValEntry.cxx index e2dad4e6..cc1f3638 100644 --- a/src/gdcmValEntry.cxx +++ b/src/gdcmValEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmValEntry.cxx,v $ Language: C++ - Date: $Date: 2005/01/30 17:30:57 $ - Version: $Revision: 1.53 $ + Date: $Date: 2005/02/01 10:29:56 $ + 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 @@ -27,8 +27,7 @@ namespace gdcm { - -// CLEAN ME +//----------------------------------------------------------------------------- #define MAX_SIZE_PRINT_ELEMENT_VALUE 128 //----------------------------------------------------------------------------- @@ -58,6 +57,112 @@ ValEntry::~ValEntry () { } +//----------------------------------------------------------------------------- +// Public +/** + * \brief Sets the std::string representable' value of a ValEntry + * @param val value to set + */ +void ValEntry::SetValue(std::string const &val) +{ + // Integers have a special treatement for their length: + int l = val.length(); + if ( l != 0) // To avoid to be cheated by 'zero length' integers + { + const VRKey &vr = GetVR(); + if( vr == "US" || vr == "SS" ) + { + // for multivaluated items + l = (Util::CountSubstring(val, "\\") + 1) * 2; + ContentEntry::SetValue(val); + } + else if( vr == "UL" || vr == "SL" ) + { + // for multivaluated items + l = (Util::CountSubstring(val, "\\") + 1) * 4;; + ContentEntry::SetValue(val); + } + else + { + std::string finalVal = Util::DicomString( val.c_str() ); + gdcmAssertMacro( !(finalVal.size() % 2) ); + + l = finalVal.length(); + ContentEntry::SetValue(finalVal); + } + } + else + { + std::string finalVal = Util::DicomString( val.c_str() ); + gdcmAssertMacro( !(finalVal.size() % 2) ); + + l = finalVal.length(); + ContentEntry::SetValue(finalVal); + } + + SetLength(l); +} + +/** + * \brief Writes the std::string representable' value of a ValEntry + * @param fp already open ofstream pointer + * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...) + */ +void ValEntry::WriteContent(std::ofstream *fp, FileType filetype) +{ + DocEntry::WriteContent(fp, filetype); + + if ( GetGroup() == 0xfffe ) + { + return; //delimitors have NO value + } + + const VRKey &vr = GetVR(); + unsigned int lgr = GetLength(); + if (vr == "US" || vr == "SS") + { + // some 'Short integer' fields may be multivaluated + // each single value is separated from the next one by '\' + // we split the string and write each value as a short int + std::vector tokens; + tokens.erase(tokens.begin(),tokens.end()); // clean any previous value + Util::Tokenize (GetValue(), tokens, "\\"); + for (unsigned int i=0; i tokens; + tokens.erase(tokens.begin(),tokens.end()); // clean any previous value + Util::Tokenize (GetValue(), tokens, "\\"); + for (unsigned int i=0; i tokens; - tokens.erase(tokens.begin(),tokens.end()); // clean any previous value - Util::Tokenize (GetValue(), tokens, "\\"); - for (unsigned int i=0; i tokens; - tokens.erase(tokens.begin(),tokens.end()); // clean any previous value - Util::Tokenize (GetValue(), tokens, "\\"); - for (unsigned int i=0; i