Program: gdcm
Module: $RCSfile: gdcmCommon.h,v $
Language: C++
- Date: $Date: 2005/09/05 08:28:02 $
- Version: $Revision: 1.90 $
+ Date: $Date: 2005/09/06 15:28:49 $
+ Version: $Revision: 1.91 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
GDCM_EXPORT extern const std::string GDCM_BINLOADED;
GDCM_EXPORT extern const std::string GDCM_NOTLOADED;
GDCM_EXPORT extern const std::string GDCM_UNREAD;
-
+GDCM_EXPORT extern const std::string GDCM_NOTASCII;
+;
/// \brief TagKey is made to hold the standard Dicom Tag
/// (Group number, Element number)
/// Instead of using the two '16 bits integers' as the Hask Table key, we
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.cxx,v $
Language: C++
- Date: $Date: 2005/08/24 12:09:13 $
- Version: $Revision: 1.58 $
+ Date: $Date: 2005/09/06 15:28:49 $
+ Version: $Revision: 1.59 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmSeqEntry.h"
#include "gdcmValEntry.h"
#include "gdcmBinEntry.h"
+#include "gdcmUtil.h"
namespace gdcm
{
* @param group Group number of the searched tag.
* @param elem Element number of the searched tag.
* @return Corresponding element value when it exists,
- * and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
+ * and the string GDCM_UNFOUND otherwise.
*/
std::string DocEntrySet::GetEntryValue(uint16_t group, uint16_t elem)
{
return 0;
}
+/**
+ * \brief Return the value of the BinEntry if it's "std::string representable"
+ * @param group Group number of the searched tag.
+ * @param elem Element number of the searched tag.
+ * @return Corresponding element value when it's "std::string representable"
+ * and the string GDCM_NOTASCII otherwise.
+ */
+std::string DocEntrySet::GetEntryForcedAsciiValue(uint16_t group, uint16_t elem)
+{
+ DocEntry *d = GetDocEntry(group,elem);
+ if ( !d )
+ return GDCM_UNFOUND;
+
+ if (ValEntry *v = dynamic_cast<ValEntry *>(d))
+ return v->GetValue();
+
+ if (BinEntry *b = dynamic_cast<BinEntry *>(d))
+ {
+ uint8_t *a = b->GetBinArea();
+ if (!b)
+ return GDCM_NOTLOADED;
+ // TODO : unify those two methods.
+ if (Util::IsCleanArea(a, b->GetLength()) )
+ return Util::CreateCleanString(a, b->GetLength());
+ }
+ return GDCM_NOTASCII;
+}
+
/**
* \brief Searches within Header Entries (Dicom Elements) parsed with
* the public and private dictionaries
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.h,v $
Language: C++
- Date: $Date: 2005/09/02 07:10:03 $
- Version: $Revision: 1.55 $
+ Date: $Date: 2005/09/06 15:28:49 $
+ 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
virtual DocEntry *GetNextEntry()=0;
virtual std::string GetEntryValue(uint16_t group, uint16_t elem);
- virtual void *GetEntryBinArea(uint16_t group, uint16_t elem);
+ virtual void *GetEntryBinArea(uint16_t group, uint16_t elem);
+
virtual int GetEntryLength(uint16_t group, uint16_t elem);
virtual std::string GetEntryVR(uint16_t group, uint16_t elem);
-
+ virtual std::string GetEntryForcedAsciiValue(uint16_t group, uint16_t elem);
/// \brief Gets any type of DocEntry, identified by its (group,elem)
virtual DocEntry *GetDocEntry(uint16_t group, uint16_t elem) = 0;
/// \brief Gets a ValEntry, identified by its (group, elem)
Program: gdcm
Module: $RCSfile: gdcmUtil.cxx,v $
Language: C++
- Date: $Date: 2005/08/31 16:24:19 $
- Version: $Revision: 1.162 $
+ Date: $Date: 2005/09/06 15:28:49 $
+ Version: $Revision: 1.163 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::cout<< std::endl << s << std::endl;
for(unsigned int i=0; i<s.size(); i++)
{
- std::cout<< std::endl << i << " : " << (unsigned char)s[i] << std::endl;
+ //std::cout<< std::endl << i << " : " << (unsigned char)s[i] << std::endl;
if (!isprint((unsigned char)s[i]) )
{
return false;
}
}
-
return str;
}
/**