-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.111 2003/11/07 14:34:50 jpr Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.112 2003/11/10 09:21:40 jpr Exp $
#include "gdcmHeader.h"
// qui pourrait ne pas etre generalisable
// Well, I'm expecting your code !!!
- // to try to 'go inside' the SeQuences
+ // the test was commented out to 'go inside' the SeQuences
// we don't any longer skip them !
// if( vr == "SQ" )
// SkipLoad = true;
- // A sequence "contains" a set of Elements.
+ // A SeQuence "contains" a set of Elements.
// (fffe e000) tells us an Element is beginning
// (fffe e00d) tells us an Element just ended
- // (fffe e0dd) tells us the current SQuence just ended
+ // (fffe e0dd) tells us the current SeQuence just ended
if( group == 0xfffe )
SkipLoad = true;
s << "gdcm::NotLoaded.";
s << " Address:" << (long)ElVal->GetOffset();
s << " Length:" << ElVal->GetLength();
+ s << " x(" << std::hex << ElVal->GetLength() << ")";
ElVal->SetValue(s.str());
return;
}
// When an integer is expected, read and convert the following two or
// four bytes properly i.e. as an integer as opposed to a string.
- // pour les elements de Value Multiplicity > 1
- // on aura en fait une serie d'entiers
- // on devrait pouvoir faire + compact (?)
+ // Actually, elements with Value Multiplicity > 1
+ // contain a set of integers (not a single one)
+ // Any compacter code suggested (?)
if ( IsAnInteger(ElVal) ) {
guint32 NewInt;
*/
int gdcmHeader::ReplaceOrCreateByNumber(std::string Value,
guint16 Group, guint16 Elem ) {
-
// TODO : FIXME JPRx
// curieux, non ?
// on (je) cree une Elvalue ne contenant pas de valeur
* \ingroup gdcmHeader
* \brief Searches within the public dictionary for element value of
* a given tag.
- * @param TagName name of the researched element.
+ * @param TagName name of the searched element.
* @return Corresponding element value when it exists, and the string
* GDCM_UNFOUND ("gdcm::Unfound") otherwise.
*/
* to convert the string typed content to caller's native type
* (think of C++ vs Python). The VR is actually of a higher level
* of semantics than just the native C++ type.
- * @param TagName name of the researched element.
+ * @param TagName name of the searched element.
* @return Corresponding element value representation when it exists,
* and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
*/
* \ingroup gdcmHeader
* \brief Searches within elements parsed with the SHADOW dictionary
* for the element value of a given tag.
- * @param group Group of the researched tag.
- * @param element Element of the researched tag.
+ * @param group Group of the searched tag.
+ * @param element Element of the searched tag.
* @return Corresponding element value representation when it exists,
* and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
*/
* to convert the string typed content to caller's native type
* (think of C++ vs Python). The VR is actually of a higher level
* of semantics than just the native C++ type.
- * @param group Group of the researched tag.
- * @param element Element of the researched tag.
+ * @param group Group of the searched tag.
+ * @param element Element of the searched tag.
* @return Corresponding element value representation when it exists,
* and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
*/
* \ingroup gdcmHeader
* \brief Searches within the elements parsed with the shadow dictionary
* for an element value of given tag.
- * @param TagName name of the researched element.
+ * @param TagName name of the searched element.
* @return Corresponding element value when it exists, and the string
* GDCM_UNFOUND ("gdcm::Unfound") otherwise.
*/
* to convert the string typed content to caller's native type
* (think of C++ vs Python). The VR is actually of a higher level
* of semantics than just the native C++ type.
- * @param TagName name of the researched element.
+ * @param TagName name of the searched element.
* @return Corresponding element value representation when it exists,
* and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
*/
* \brief Searches within elements parsed with the public dictionary
* and then within the elements parsed with the shadow dictionary
* for the element value of a given tag.
- * @param group Group of the researched tag.
- * @param element Element of the researched tag.
+ * @param group Group of the searched tag.
+ * @param element Element of the searched tag.
* @return Corresponding element value representation when it exists,
* and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
*/
* to convert the string typed content to caller's native type
* (think of C++ vs Python). The VR is actually of a higher level
* of semantics than just the native C++ type.
- * @param group Group of the researched tag.
- * @param element Element of the researched tag.
+ * @param group Group of the searched tag.
+ * @param element Element of the searched tag.
* @return Corresponding element value representation when it exists,
* and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
*/
* \brief Searches within elements parsed with the public dictionary
* and then within the elements parsed with the shadow dictionary
* for the element value of a given tag.
- * @param TagName name of the researched element.
+ * @param TagName name of the searched element.
* @return Corresponding element value when it exists,
* and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
*/
* to convert the string typed content to caller's native type
* (think of C++ vs Python). The VR is actually of a higher level
* of semantics than just the native C++ type.
- * @param TagName name of the researched element.
+ * @param TagName name of the searched element.
* @return Corresponding element value representation when it exists,
* and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
*/
rewind(fp);
CheckSwap();
- while ( (newElValue = ReadNextElement()) ) {
+ while ( (newElValue = ReadNextElement()) ) {
SkipElementValue(newElValue);
PubElValSet.Add(newElValue);
}
/**
* \ingroup gdcmHeader
- * \brief This predicate, based on hopefully reasonnable heuristics,
+ * \brief This predicate, based on hopefully reasonable heuristics,
* decides whether or not the current gdcmHeader was properly parsed
* and contains the mandatory information for being considered as
* a well formed and usable image.
* public tag based hash table.
*/
void gdcmHeader::LoadElements(void) {
- rewind(fp);
- TagElValueHT ht = PubElValSet.GetTagHt();
- for (TagElValueHT::iterator tag = ht.begin(); tag != ht.end(); ++tag) {
- LoadElementValue(tag->second);
- }
+ rewind(fp);
+
+ // We don't use any longer the HashTable, since a lot a stuff is missing
+ // we SeQuences were encountered
+ //
+ //TagElValueHT ht = PubElValSet.GetTagHt();
+ //for (TagElValueHT::iterator tag = ht.begin(); tag != ht.end(); ++tag) {
+ // LoadElementValue(tag->second);
+ //}
+
+ for (std::list<gdcmElValue*>::iterator i = GetListElem().begin();
+ i != GetListElem().end();
+ ++i){
+ LoadElementValue(*i);
+ }
+
rewind(fp);
// Load 'non string' values
*/
int gdcmHeader::Write(FILE * fp, FileType type) {
-
- // TODO : move the following lines (and a lot of others)
+ // TODO : move the following lines (and a lot of others, to be written)
// to a future function CheckAndCorrectHeader
if (type == ImplicitVR) {