NameHt[newElValue->GetName()] = newElValue;
}
+
+/**
+ * \ingroup gdcmElValSet
+ * \brief Checks if a given Dicom element exists
+ * \ within a ElValSet
+ * @param
+ * @return
+ */
+int gdcmElValSet::CheckIfExistByNumber(guint16 Group, guint16 Elem ) {
+ string key = TranslateToKey(Group, Elem );
+ return (tagHt.count(key));
+}
+
/**
* \ingroup gdcmElValSet
* \brief
-// $Header: /cvs/public/gdcm/src/Attic/gdcmElValSet.h,v 1.14 2003/06/17 17:44:48 jpr Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmElValSet.h,v 1.15 2003/06/26 13:07:01 jpr Exp $
#ifndef GDCMELVALSET_H
#define GDCMELVALSET_H
int SetElValueLengthByName (guint32 l, std::string TagName);
guint32 GenerateFreeTagKeyInGroup(guint16 group);
+ int CheckIfExistByNumber(guint16 Group, guint16 Elem );
private:
void UpdateGroupLength(bool SkipSequence = false, FileType type = ImplicitVR);
-// gdcm.h
+// gdcmExeption.h
// gdcmlib Intro:
// * gdcmlib is a library dedicated to reading and writing dicom files.
-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.70 2003/06/20 14:17:47 jpr Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.71 2003/06/26 13:07:01 jpr Exp $
#include <stdio.h>
#include <cerrno>
guint16 length16;
if( (element == 0x0010) && (group == 0x7fe0) ) {// JPR
- dbg.SetDebug(1);
+ dbg.SetDebug(10);
dbg.Verbose(2, "gdcmHeader::FindLength: ", // JPR
"on est sur 7fe0 0010");
}
string v = Value;
PubElValSet.SetElValueByNumber(v, Group, Elem);
return(1);
-}
+}
+
+/**
+ * \ingroup gdcmHeader
+ * \brief TODO
+ * @param
+ */
+
+ int gdcmHeader::CheckIfExistByNumber(guint16 Group, guint16 Elem ) {
+ return (PubElValSet.CheckIfExistByNumber(Group, Elem));
+ }
+
+
/**
* \ingroup gdcmHeader
* \brief Build a new Element Value from all the low level arguments.
-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.h,v 1.28 2003/06/20 14:17:47 jpr Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.h,v 1.29 2003/06/26 13:07:01 jpr Exp $
#ifndef GDCMHEADER_H
#define GDCMHEADER_H
FileType filetype;
gdcmElValue * GetElValueByNumber(guint16 group, guint16 element);
+ int CheckIfExistByNumber(guint16 Group, guint16 Elem );
guint16 SwapShort(guint16); // needed by gdcmFile
guint32 SwapLong(guint32); // for JPEG Files :-(
-// $Header: /cvs/public/gdcm/src/gdcmUtil.cxx,v 1.12 2003/06/17 17:44:48 jpr Exp $
+// $Header: /cvs/public/gdcm/src/gdcmUtil.cxx,v 1.13 2003/06/26 13:07:01 jpr Exp $
#include <stdio.h>
#include <ctype.h> // For isspace
return d;
}
+///////////////////////////////////////////////////////////////////////////
+//
+// because it may not be associated to a dictionary ...
+
+std::string TranslateToKey(guint16 group, guint16 element) {
+ char trash[10];
+ string key;
+ // CLEAN ME: better call the iostream<< with the hex manipulator on.
+ // This requires some reading of the stdlibC++ sources to make the
+ // proper call (or copy).
+ sprintf(trash, "%04x|%04x", group , element);
+ key = trash; // Convertion through assignement
+ return key;
+}
+
+
+
-// $Header: /cvs/public/gdcm/src/gdcmUtil.h,v 1.11 2003/06/17 17:44:48 jpr Exp $
+// $Header: /cvs/public/gdcm/src/gdcmUtil.h,v 1.12 2003/06/26 13:07:01 jpr Exp $
#ifndef GDCMUTIL_H
#define GDCMUTIL_H
char * _cleanString(char *v);
char * _CreateCleanString(string s);
+std::string TranslateToKey(guint16 group, guint16 element);
+
#endif