Program: gdcm
Module: $RCSfile: gdcmDictSet.cxx,v $
Language: C++
- Date: $Date: 2005/11/28 15:20:33 $
- Version: $Revision: 1.73 $
+ Date: $Date: 2006/03/22 13:19:25 $
+ Version: $Revision: 1.74 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmDictSet.h"
#include "gdcmDebug.h"
+#include "gdcmGlobal.h"
#include <fstream>
#include <stdlib.h> // For getenv
#include <stdio.h> // For sprintf
std::string pubDictFile(DictPath);
pubDictFile += PUB_DICT_FILENAME;
Dicts[PUB_DICT_NAME] = Dict::New(pubDictFile);
+ // Stored redundantly to avoid at access HTable DictSet every time.
+ Global::DefaultPubDict = Dicts[PUB_DICT_NAME];
}
/**
Program: gdcm
Module: $RCSfile: gdcmDictSet.h,v $
Language: C++
- Date: $Date: 2005/11/28 16:31:23 $
- Version: $Revision: 1.52 $
+ Date: $Date: 2006/03/22 13:19:25 $
+ Version: $Revision: 1.53 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmRefCounter.h"
#include "gdcmDict.h"
+#include "gdcmGlobal.h"
#include <map>
#include <list>
Dict *GetDict( DictKey const &DictName );
/// \brief Returns the default reference DICOM V3 public dictionary.
- Dict* GetDefaultPubDict() { return GetDict(PUB_DICT_NAME); }
-
+ //Dict* GetDefaultPubDict() { return GetDict(PUB_DICT_NAME); }
+ Dict* GetDefaultPubDict() { return Global::DefaultPubDict; }
+
// \ brief Returns the virtual references DICOM dictionary.
// \ warning : not end user intended
// Dict *GetVirtualDict() { return &VirtualEntries; }
Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2006/02/16 20:06:14 $
- Version: $Revision: 1.81 $
+ Date: $Date: 2006/03/22 13:19:25 $
+ Version: $Revision: 1.82 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
gdcmAssertMacro(DicomDict);
DicomDict->Register();
+
+ VR = in->GetVR();
+ Key = in->GetKey();
}
/**
Program: gdcm
Module: $RCSfile: gdcmDocEntry.h,v $
Language: C++
- Date: $Date: 2006/02/16 20:06:14 $
- Version: $Revision: 1.60 $
+ Date: $Date: 2006/03/22 13:19:25 $
+ Version: $Revision: 1.61 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
DictEntry * GetDictEntry() { return DicomDict; }
/// Returns the Dicom Group number of the current Dicom entry
- const uint16_t &GetGroup() const { return DicomDict->GetGroup(); }
+ const uint16_t GetGroup() const { return Key.GetGroup(); }
+ //const uint16_t &GetGroup() const { return DicomDict->GetGroup(); }
/// Returns the Dicom Element number of the current Dicom entry
- const uint16_t &GetElement() const { return DicomDict->GetElement();}
+ const uint16_t GetElement() const { return Key.GetElement();}
+ //const uint16_t &GetElement() const { return DicomDict->GetElement();}
/// Returns the 'key' of the current Dicom entry
- TagKey GetKey() const { return DicomDict->GetKey(); }
+ TagKey GetKey() const { return Key; }
+ //TagKey GetKey() const { return DicomDict->GetKey(); }
/// \brief Returns the 'Name' '(e.g. "Patient's Name") found in the Dicom
/// Dictionnary of the current Dicom Header Entry
/// \brief Returns the 'Value Representation' (e.g. "PN" : Person Name,
/// "SL" : Signed Long), found in the Dicom header or in the Dicom
/// Dictionnary, of the current Dicom entry
- VRKey const &GetVR() const { return DicomDict->GetVR(); }
+ VRKey const &GetVR() const { return VR; }
+ //VRKey const &GetVR() const { return DicomDict->GetVR(); }
/// \brief Returns the 'Value Multiplicity' (e.g. "1", "6", "1-n", "3-n"),
/// found in the Dicom entry or in the Dicom Dictionnary
void SetReadLength(uint32_t l) { ReadLength = l; }
/// \brief Returns the 'read length' of the current Dicom entry
/// \warning this value is the one stored in the Dicom header but not
- /// mandatoryly the one thats's used (in case on SQ, or delimiters,
+ /// mandatoryly the one thats's used (in case of SQ, or delimiters,
/// the usable length is set to zero)
const uint32_t &GetReadLength() const { return ReadLength; }
uint32_t GetFullLength();
virtual uint32_t ComputeFullLength() = 0;
-// The following 3 members, for internal use only !
+// The following members, for internal use only !
+
/// \brief Sets the offset of the Dicom entry
/// \warning use with caution !
/// @param of offset to be set
/// Sets to TRUE the ImplicitVr flag of the current Dicom entry
void SetImplicitVR() { ImplicitVR = true; }
+ /// Sets the 'Value Representation' of the current Dicom entry
+ /// @param vr VR to be set
+ void SetVR( VRKey const &vr) { VR = vr; }
+
+ /// Sets the 'Value Representation' of the current Dicom entry
+ /// @param key TagKey to be set
+ void SetTag( TagKey const &key) { Key = key; }
+
+// -----------end of members to be used with caution
+
/// \brief Tells us if the current Dicom entry was checked as ImplicitVr
/// @return true if the current Dicom entry was checked as ImplicitVr
bool IsImplicitVR() const { return ImplicitVR; }
/// \brief pointer to the underlying Dicom dictionary element
DictEntry *DicomDict;
-
- /// \brief Correspond to the real length of the data
+
+ /// \brief Corresponds to the real length of the data
/// This length might always be even
uint32_t Length;
/// Offset from the beginning of file for direct user access
size_t Offset;
+ /// \brief Value Representation (to avoid accessing Dicom Dict every time!)
+ VRKey VR; // JPRx
+
+ /// \brief Dicom \ref TagKey. Contains Dicom Group number and Dicom Element number
+ /// (to avoid accessing Dicom Dict every time !) // JPRx
+ TagKey Key; // JPRx
private:
+
};
} // end namespace gdcm
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.cxx,v $
Language: C++
- Date: $Date: 2006/02/16 20:06:14 $
- Version: $Revision: 1.70 $
+ Date: $Date: 2006/03/22 13:19:25 $
+ 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
gdcmWarningMacro( "Failed to allocate SeqEntry for ("
<<std::hex << group << "|" << elem <<")" );
return 0;
- }
+ }
return newEntry;
}
DictEntry *DocEntrySet::GetDictEntry(uint16_t group,uint16_t elem)
{
DictEntry *found = 0;
+ /// \todo store the DefaultPubDict somwhere, in order not to access the HTable
+ /// every time !
Dict *pubDict = Global::GetDicts()->GetDefaultPubDict();
if (!pubDict)
{
/**
* \brief Searches [both] the public [and the shadow dictionary (when they
* exist)] for the presence of the DictEntry with given
- * group and element, and create a new virtual DictEntry if necessary
+ * group and element, and creates a new virtual DictEntry if necessary
* @param group group number of the searched DictEntry
* @param elem element number of the searched DictEntry
* @param vr V(alue) R(epresentation) to use, if necessary
Program: gdcm
Module: $RCSfile: gdcmGlobal.cxx,v $
Language: C++
- Date: $Date: 2006/01/11 10:44:24 $
- Version: $Revision: 1.31 $
+ Date: $Date: 2006/03/22 13:19:25 $
+ Version: $Revision: 1.32 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
DictGroupName *Global::GroupName = (DictGroupName *)0;
DicomDirElement *Global::ddElem = (DicomDirElement *)0;
+Dict *Global::DefaultPubDict = (Dict *)0;
+
//-----------------------------------------------------------------------------
/**
* \brief Global container
Program: gdcm
Module: $RCSfile: gdcmGlobal.h,v $
Language: C++
- Date: $Date: 2005/11/30 10:58:28 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2006/03/22 13:19:25 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class Dict;
class GDCM_EXPORT Global
{
+friend class DictSet; // to allow setting DefaultPubDict without
+ // providing any body an accesor !
public:
Global();
~Global();
/// \brief Pointer to the hash table containing the Dicom Elements necessary
/// to describe each part of a DICOMDIR
static DicomDirElement *ddElem;
+ /// pointer to the Default Public Dictionnary, redundantly store here,
+ /// in order not to acces the HTable every time!
+ static Dict *DefaultPubDict;
};
} // end namespace gdcm