// problems appears at loading of _gdcm.[so/dll]). So, simply uncomment
// the declaration once you provided the definition of the method...
+#ifndef GDCM_H
+#define GDCM_H
+
#include <string>
-#ifdef _MSC_VER
-using namespace std; // string type lives in the std namespace on VC++
-#endif
+using namespace std;
#include <iostream>
#include <stddef.h> // For size_t
#include <stdio.h> // FIXME For FILE on GCC only
#include <list>
#include <map>
+#include "gdcmException.h"
+
// The requirement for the hash table (or map) that
// we shall use:
// which should be around 4500 entries which is the
// average dictionary size (said JPR)
//
- // En fait, je disais que dans LE Directory Dicom (dans son etat 2002)
- // il y a 1600 entrees.
+ // En fait, je disais que dans LE Directory Dicom (dans son etat 2001)
+ // il y a +/- 1600 entrees.
// Une valeur raisonable pour un majorant du nombre d'entrees
// dans une entete DICOM d'une image semble semble etre 300
// Si on 'decortique' les elements SQ (ce qui ne semble pas etre fait pour le moment)
class GDCM_EXPORT gdcmDictSet {
private:
- string DictPath; // Directory path to dictionaries
DictSetHT dicts;
int AppendDict(gdcmDict* NewDict);
- int LoadDictFromFile(string filename, DictKey);
- void SetDictPath(void);
+ void LoadDictFromFile(string filename, DictKey);
+private:
+ static string DictPath; // Directory path to dictionaries
+ static string BuildDictPath(void);
+ static gdcmDict* DefaultPubDict;
public:
- gdcmDictSet(void); // loads THE DICOM v3 dictionary
+ static list<string> * GetPubDictTagNames(void);
+ static map<string, list<string> >* GetPubDictTagNamesByCategory(void);
+ static gdcmDict* LoadDefaultPubDict(void);
+
+ gdcmDictSet(void);
// TODO Swig int LoadDictFromFile(string filename);
// QUESTION: the following function might not be thread safe !? Maybe
// we need some mutex here, to avoid concurent creation of
// TODO Swig int LoadAllDictFromDirectory(string DirectoryName);
// TODO Swig string* GetAllDictNames();
//
- // Question : ne faudra-t-il pas mettre LE dictionnaire DICOM dans un Directory
- // et les eventuels 'dictionnaires prives' dans un autre?
- // (pour eviter a un utilisateur mal dégourdi de tout saccager ?)
- //
- int LoadDicomV3Dict(void);
void Print(ostream&);
gdcmDict* GetDict(DictKey DictName);
- gdcmDict* GetDefaultPublicDict(void);
+ gdcmDict* GetDefaultPubDict(void);
};
///////////////////////////////////////////////////////////////////////////
TagElValueHT & GetTagHt(void);
int SetElValueByNumber(string content, guint32 group, guint32 element);
- int SetElValueByName(string content, string TagName);
+ int SetElValueByName (string content, string TagName);
+
+ int SetElValueLengthByNumber(guint32 l, guint32 group, guint32 element);
+ int SetElValueLengthByName (guint32 l, string TagName);
+
};
////////////////////////////////////////////////////////////////////////////
static VRHT *dicom_vr;
// Dictionaries of data elements:
- static gdcmDictSet* Dicts; // global dictionary container
+ gdcmDictSet* Dicts; // global dictionary container
gdcmDict* RefPubDict; // public dictionary
gdcmDict* RefShaDict; // shadow dictionary (optional)
// Parsed element values:
int anonymize(ostream&); // FIXME : anonymize should be a friend ?
public:
void LoadElements(void);
- virtual void ParseHeader(void);
- gdcmHeader(const char* filename);
+ virtual void ParseHeader(bool exception_on_error = false)
+ throw(gdcmFormatError);
+ gdcmHeader(const char *filename, bool exception_on_error = false)
+ throw(gdcmFileError);
virtual ~gdcmHeader();
size_t GetPixelOffset(void);
// an additional specific dictionary to access extra information.
// TODO Swig int SetShaDict(string filename);
- // Retrieve all potentially available tag [tag = (group, element)] names
- // from the standard (or public) dictionary. Typical usage : enable the
- // user of a GUI based interface to select his favorite fields for sorting
- // or selecting.
- list<string> * GetPubTagNames(void);
- map<string, list<string> > * GetPubTagNamesByCategory(void);
// Get the element values themselves:
-
string GetPubElValByName(string TagName);
string GetPubElValByNumber(guint16 group, guint16 element);
TagElValueHT & GetPubElVal(void) { return PubElVals.GetTagHt(); };
void PrintPubElVal(ostream & os = cout);
- void PrintPubDict(ostream &);
+ void PrintPubDict(ostream & os = cout);
// Same thing with the shadow :
// TODO Swig string* GetShaTagNames();
// Copies (at most MaxSize bytes) of data to caller's memory space.
// Returns an error code on failure (if MaxSize is not big enough)
- int PutImageDataHere(void* destination, size_t MaxSize );
+ int GetImageDataIntoVector(void* destination, size_t MaxSize );
// Question :
//
- // GetImageData et PutImageDataHere
+ // GetImageData et GetImageDataIntoVector
// Get et Put pour 2 fonctions qui font presque la meme chose :-(
//
// Ca sera à l'utilisateur d'appeler son Reader correctement
int WriteRawData (string nomFichier);
- int WriteDcm (string nomFichier);
+ int WriteDcm (string nomFichier);
};
//
//class gdcmMultiFrame : gdcmFile;
+#endif // #ifndef GDCM_H