From: jpr Date: Fri, 7 Jan 2005 12:29:17 +0000 (+0000) Subject: Removal out of the Dicom Dictionary of non dicom 'fourth' field X-Git-Tag: Version1.0.bp~449 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=1fecdc6dcc36f951de19246bd14ef282b3dec13a;p=gdcm.git Removal out of the Dicom Dictionary of non dicom 'fourth' field Add to the Dicom Dictionaty of Dicom 'Value Multiplicity' field Commenting out of probabely useless methods : Dict::GetDictEntryNames() Dict::GetDictEntryNamesByCategory() DictSet::GetPubDictEntryNames() DictSet::GetPubDictEntryNamesByCategory() --- diff --git a/src/gdcmDefaultDicts.cxx.in b/src/gdcmDefaultDicts.cxx.in index fb0aab06..6c3c53d5 100644 --- a/src/gdcmDefaultDicts.cxx.in +++ b/src/gdcmDefaultDicts.cxx.in @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDefaultDicts.cxx.in,v $ Language: C++ - Date: $Date: 2004/11/04 15:20:35 $ - Version: $Revision: 1.4 $ + Date: $Date: 2005/01/07 12:29:17 $ + 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 @@ -33,7 +33,7 @@ typedef struct uint16_t group; uint16_t element; const char *vr; - const char *fourth; + const char *vm; const char *name; } DICT_ENTRY; @@ -47,7 +47,7 @@ void FillDefaultDataDict(Dict *d) DICT_ENTRY n = datadir[i]; while( n.name != 0 ) { - const DictEntry e( n.group, n.element, n.vr, n.fourth, n.name); + const DictEntry e( n.group, n.element, n.vr, n.vm, n.name); d->AddNewEntry( e ); n = datadir[++i]; } diff --git a/src/gdcmDict.cxx b/src/gdcmDict.cxx index 722de054..d45b0b26 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/07 09:03:52 $ - Version: $Revision: 1.55 $ + Date: $Date: 2005/01/07 12:29:17 $ + Version: $Revision: 1.56 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -38,7 +38,7 @@ Dict::Dict(std::string const &filename) uint16_t group; uint16_t element; TagName vr; - TagName fourth; + TagName vm; TagName name; std::ifstream from( filename.c_str() ); @@ -56,11 +56,11 @@ Dict::Dict(std::string const &filename) from >> group; from >> element; from >> vr; - from >> fourth; + from >> vm; from >> std::ws; //remove white space std::getline(from, name); - const DictEntry newEntry(group, element, vr, fourth, name); + const DictEntry newEntry(group, element, vr, vm, name); AddNewEntry(newEntry); } @@ -108,7 +108,7 @@ void Dict::PrintByKey(std::ostream &os) s << std::hex << std::setw(4) << tag->second.GetElement() << ") = " << std::dec; s << tag->second.GetVR() << ", "; - s << tag->second.GetFourth() << ", "; + s << tag->second.GetVM() << ", "; s << tag->second.GetName() << "." << std::endl; } os << s.str(); @@ -193,12 +193,12 @@ bool Dict::RemoveEntry (uint16_t group, uint16_t elem) /** * \brief Get the dictionnary entry identified by a given tag (group,element) * @param group group of the entry to be found - * @param element element of the entry to be found + * @param elem element of the entry to be found * @return the corresponding dictionnary entry when existing, NULL otherwise */ -DictEntry *Dict::GetDictEntryByNumber(uint16_t group, uint16_t element) +DictEntry *Dict::GetDictEntryByNumber(uint16_t group, uint16_t elem) { - TagKey key = DictEntry::TranslateToKey(group, element); + TagKey key = DictEntry::TranslateToKey(group, elem); TagKeyHT::iterator it = KeyHt.find(key); if ( it == KeyHt.end() ) { @@ -213,15 +213,20 @@ DictEntry *Dict::GetDictEntryByNumber(uint16_t group, uint16_t element) * \sa DictSet::GetPubDictTagNamesByCategory * @return A list of all entries of the public dicom dictionnary. */ -EntryNamesList *Dict::GetDictEntryNames() -{ - EntryNamesList *result = new EntryNamesList; - for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag) - { - result->push_back( tag->second.GetName() ); - } - return result; -} + + + // Probabely useless + + +//EntryNamesList *Dict::GetDictEntryNames() +//{ +// EntryNamesList *result = new EntryNamesList; +// for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag) +// { +// result->push_back( tag->second.GetName() ); +// } +// return result; +//} /** * \ingroup Dict @@ -247,17 +252,20 @@ EntryNamesList *Dict::GetDictEntryNames() * corresponding values are lists of all the dictionnary entries * among that group. */ -EntryNamesByCatMap *Dict::GetDictEntryNamesByCategory() -{ - EntryNamesByCatMap *result = new EntryNamesByCatMap; - - for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag) - { - (*result)[tag->second.GetFourth()].push_back(tag->second.GetName()); - } - - return result; -} + + // Probabely useless + +//EntryNamesByCatMap *Dict::GetDictEntryNamesByCategory() +//{ +// EntryNamesByCatMap *result = new EntryNamesByCatMap; +// +// for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag) +// { +// (*result)[tag->second.GetFourth()].push_back(tag->second.GetName()); +// } +// +// return result; +//} //----------------------------------------------------------------------------- // Protected diff --git a/src/gdcmDictEntry.cxx b/src/gdcmDictEntry.cxx index f56e73ac..457c76c4 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/06 20:03:27 $ - Version: $Revision: 1.30 $ + Date: $Date: 2005/01/07 12:29:17 $ + Version: $Revision: 1.31 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -29,20 +29,20 @@ namespace gdcm * \brief Constructor * @param group DICOM-Group Number * @param element DICOM-Element Number - * @param vr Value Representatiion - * @param fourth // DO NOT use any longer; - * NOT part of the Dicom Standard + * @param vr Value Representation + * @param vm Value Mutlplicity * @param name description of the element */ DictEntry::DictEntry(uint16_t group, uint16_t element, - TagName const &vr, TagName const &fourth, + TagName const &vr, + TagName const &vm, TagName const &name) { Group = group; Element = element; VR = vr; - Fourth = fourth; + VM = vm; Name = name; Key = TranslateToKey(group, element); } diff --git a/src/gdcmDictEntry.h b/src/gdcmDictEntry.h index ab4b95f4..1d8c8a8d 100644 --- a/src/gdcmDictEntry.h +++ b/src/gdcmDictEntry.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDictEntry.h,v $ Language: C++ - Date: $Date: 2005/01/06 20:03:27 $ - Version: $Revision: 1.24 $ + Date: $Date: 2005/01/07 12:29:17 $ + Version: $Revision: 1.25 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -41,7 +41,7 @@ public: DictEntry(uint16_t group, uint16_t element, TagName const &vr = GDCM_UNKNOWN, - TagName const &fourth = GDCM_UNKNOWN, + TagName const &vm = GDCM_UNKNOWN, TagName const &name = GDCM_UNKNOWN); static TagKey TranslateToKey(uint16_t group, uint16_t element); @@ -69,11 +69,9 @@ public: /// @param k New key to be set. void SetKey(TagName const &k) { Key = k; } - /// \brief returns the Fourth field of the current DictEntry - /// \warning NOT part of the Dicom Standard. - /// May be REMOVED an any time. NEVER use it. - /// @return The Fourth field - const TagName &GetFourth() const { return Fourth; } + /// \brief returns the VM field of the current DictEntry + /// @return The 'Value Multiplicity' field + const TagName &GetVM() const { return VM; } /// \brief Returns the Dicom Name of the current DictEntry /// e.g. "Patient Name" for Dicom Tag (0x0010, 0x0010) @@ -104,18 +102,9 @@ private: /// "Floating Point Double" (see \ref VR) TagName VR; - /** - * \brief AVOID using the following fourth field at all costs. - * - * They are at least two good reasons for NOT using fourth: - * - the main reason is that it is NOT part of the 'official' - * Dicom Dictionnary. - * - a second reason is that it is not defined for all the groups. + /* * . - * Still it provides some semantics as group name abbreviation that - * can prove of some help when organizing things in an interface. - * For the time being we keep it in gdcm but it migth be removed in - * future releases it proves to be source of confusion. + * Formerly 'Group name abbreviations' * Here is a small dictionary we encountered in "nature": * - CMD Command * - META Meta Information @@ -161,7 +150,8 @@ private: * - LLO = Left Lateral Oblique * . */ - TagName Fourth; + /// \brief Value Multiplicity (e.g. "1", "1-n", "6") + TagName VM; /// e.g. "Patient's Name" TagName Name; diff --git a/src/gdcmDictSet.cxx b/src/gdcmDictSet.cxx index 25a848e9..2e18040c 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/06 20:03:27 $ - Version: $Revision: 1.45 $ + Date: $Date: 2005/01/07 12:29:17 $ + Version: $Revision: 1.46 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -87,10 +87,13 @@ void DictSet::Print(std::ostream &os) * \sa DictSet::GetPubDictTagNamesByCategory * @return A list of all entries of the public dicom dictionnary. */ -EntryNamesList *DictSet::GetPubDictEntryNames() -{ - return GetDefaultPubDict()->GetDictEntryNames(); -} + +// Probabely useless! + +//EntryNamesList *DictSet::GetPubDictEntryNames() +//{ +// return GetDefaultPubDict()->GetDictEntryNames(); +//} /** * \ingroup DictSet @@ -101,6 +104,8 @@ EntryNamesList *DictSet::GetPubDictEntryNames() * values are lists of all the dictionnary 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. @@ -118,10 +123,14 @@ EntryNamesList *DictSet::GetPubDictEntryNames() * corresponding values are lists of all the dictionnary entries * among that group. */ -EntryNamesByCatMap *DictSet::GetPubDictEntryNamesByCategory() -{ - return GetDefaultPubDict()->GetDictEntryNamesByCategory(); -} + + +// Probabely useless! + +//EntryNamesByCatMap *DictSet::GetPubDictEntryNamesByCategory() +//{ +// return GetDefaultPubDict()->GetDictEntryNamesByCategory(); +//} /** * \ingroup DictSet @@ -166,12 +175,12 @@ Dict *DictSet::GetDict(DictKey const &dictName) DictEntry *DictSet::NewVirtualDictEntry( uint16_t group, uint16_t element, TagName vr, - TagName fourth, + TagName vm, TagName name) { DictEntry *entry; const std::string tag = DictEntry::TranslateToKey(group,element) - + "#" + vr + "#" + fourth + "#" + name; + + "#" + vr + "#" + vm + "#" + name; TagKeyHT::iterator it; it = VirtualEntry.find(tag); @@ -181,7 +190,7 @@ DictEntry *DictSet::NewVirtualDictEntry( uint16_t group, } else { - DictEntry ent(group, element, vr, fourth, name); + DictEntry ent(group, element, vr, vm, name); VirtualEntry.insert( std::map::value_type (tag, ent)); diff --git a/src/gdcmDictSet.h b/src/gdcmDictSet.h index abf1a0f6..f725074d 100644 --- a/src/gdcmDictSet.h +++ b/src/gdcmDictSet.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDictSet.h,v $ Language: C++ - Date: $Date: 2005/01/06 20:03:27 $ - Version: $Revision: 1.32 $ + Date: $Date: 2005/01/07 12:29:17 $ + 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 @@ -46,8 +46,9 @@ public: void Print(std::ostream &os); - EntryNamesList *GetPubDictEntryNames(); - EntryNamesByCatMap* GetPubDictEntryNamesByCategory(); + // Probabely useless ! + //EntryNamesList *GetPubDictEntryNames(); + //EntryNamesByCatMap* GetPubDictEntryNamesByCategory(); Dict *LoadDictFromFile( std::string const &fileName, DictKey const &name ); @@ -63,7 +64,7 @@ public: DictEntry *NewVirtualDictEntry(uint16_t group, uint16_t element, TagName vr = GDCM_UNKNOWN, - TagName fourth = GDCM_UNKNOWN, + TagName vm = GDCM_UNKNOWN, TagName name = GDCM_UNKNOWN); static std::string BuildDictPath(); diff --git a/src/gdcmDocEntrySet.cxx b/src/gdcmDocEntrySet.cxx index 395491db..0c751dd2 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/07 08:50:13 $ - Version: $Revision: 1.33 $ + Date: $Date: 2005/01/07 12:29:17 $ + 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 @@ -38,18 +38,18 @@ namespace gdcm /** * \brief Request a new virtual dict entry to the dict set - * @param group group number of the underlying DictEntry + * @param group group number of the underlying DictEntry * @param elem element number of the underlying DictEntry - * @param vr VR of the underlying DictEntry - * @param fourth owner group + * @param vr VR (Value Representation) of the underlying DictEntry + * @param vm VM (Value Multiplicity) of the underlying DictEntry * @param name english name */ DictEntry* DocEntrySet::NewVirtualDictEntry( uint16_t group,uint16_t elem, TagName const & vr, - TagName const & fourth, + TagName const & vm, TagName const & name ) { - return Global::GetDicts()->NewVirtualDictEntry(group,elem,vr,fourth,name); + return Global::GetDicts()->NewVirtualDictEntry(group,elem,vr,vm,name); } //----------------------------------------------------------------------------- diff --git a/src/gdcmDocEntrySet.h b/src/gdcmDocEntrySet.h index 173d514d..108eec2e 100644 --- a/src/gdcmDocEntrySet.h +++ b/src/gdcmDocEntrySet.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntrySet.h,v $ Language: C++ - Date: $Date: 2005/01/07 08:50:13 $ - Version: $Revision: 1.34 $ + Date: $Date: 2005/01/07 12:29:17 $ + 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 @@ -77,7 +77,7 @@ public: DictEntry *NewVirtualDictEntry(uint16_t group, uint16_t element, TagName const &vr = GDCM_UNKNOWN, - TagName const &fourth = GDCM_UNKNOWN, + TagName const &vm = GDCM_UNKNOWN, TagName const &name = GDCM_UNKNOWN ); protected: