+2003-11-12 Jean-Pierre Roux
+ *ENH gdcmHeader constructor has one more parameter (default value : false)
+ that allows the user to 'go inside' the SeQuences only
+ if he wants to.
+ gdcmElValSet:Print takes it into account
+
+2003-11-12 Mathieu Malaterre <Mathieu.Malaterre@creatis.insa-lyon.fr>
+ *ENH: Update gdcmPython/CMakeLists
+ *FIX: (gdcmHeaderHelper) GetRescale and GetSlope
+ *FIX: (gdcmElValSet) char 'tag' was overiding private members (VC++)
+
2003-11-10 Jean-Pierre Roux
*FIX : gdcmHeader::LoadElements is now based
on the ListTag listElem member,
}
std::cout << "------------ using listElem -----------------" << std::endl;
-
- //for (ListTag::iterator i = listElem.begin();
-
+
+ guint32 lgth;
char greltag[9]; //group element tag
for (std::list<gdcmElValue*>::iterator i = listElem.begin();
i != listElem.end();
++i){
- sprintf(greltag,"%04x|%04x",(*i)->GetGroup(),(*i)->GetElement());
g = (*i)->GetGroup();
e = (*i)->GetElement();
+ sprintf(greltag,"%04x|%04x",g,e);
v = (*i)->GetValue();
o = (*i)->GetOffset();
d2 = _CreateCleanString(v); // replace non printable characters by '.'
- //os << std::hex <<g << "|" << e << std::dec << ": ";
- os << greltag << " : ";
- os << " lgr : " << (*i)->GetReadLength();
+ os << greltag << ": lgth : ";
+ lgth = (*i)->GetReadLength();
+ if ( lgth == 0xffffffff)
+ os << std::hex << lgth << std::dec ;
+ else
+ os << lgth;
os << ", Offset : " << o;
os << " x(" << std::hex << o << std::dec << ") ";
os << "\t[" << (*i)->GetVR() << "]";
-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.114 2003/11/12 14:06:34 malaterre Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.115 2003/11/12 15:35:19 jpr Exp $
#include "gdcmHeader.h"
* @param InFilename
* @param exception_on_error
*/
-gdcmHeader::gdcmHeader(const char *InFilename, bool exception_on_error) {
+gdcmHeader::gdcmHeader(const char *InFilename,
+ bool exception_on_error,
+ bool enable_sequences ) {
+ if (enable_sequences)
+ enableSequences = 1;
+ else
+ enableSequences = 0;
+
SetMaxSizeLoadElementValue(_MaxSizeLoadElementValue_);
filename = InFilename;
Initialise();
void gdcmHeader::FixFoundLength(gdcmElValue * ElVal, guint32 FoundLength) {
ElVal->SetReadLength(FoundLength); // will be updated only if a bug is found
-
- if ( FoundLength == 0xffffffff)
+
+ if ( FoundLength == 0xffffffff) {
FoundLength = 0;
+ }
// Sorry for the patch!
// XMedCom did the trick to read some nasty GE images ...
}
// end of fix
- // to try to 'go inside' SeQuences (with length), and not to ship them
+ // to try to 'go inside' SeQuences (with length), and not to skip them
else if ( ElVal->GetVR() == "SQ") {
+ if (enableSequences) // only if the user does want to !
FoundLength =0;
}
-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.h,v 1.42 2003/11/10 09:21:40 jpr Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.h,v 1.43 2003/11/12 15:35:19 jpr Exp $
#ifndef GDCMHEADER_H
#define GDCMHEADER_H
gdcmElValSet ShaElValSet;
/// Refering underlying filename.
std::string filename;
-
+
+ int enableSequences;
+
// FIXME sw should be an enum e.g.
//enum EndianType {
//LittleEndian,
void SetMaxSizeLoadElementValue(long);
gdcmDictEntry * GetDictEntryByNumber(guint16, guint16);
- gdcmDictEntry * GetDictEntryByName(std::string Name);
+ gdcmDictEntry * GetDictEntryByName (std::string Name);
// ElValue related utilities
gdcmElValue * ReadNextElement(void);
gdcmElValue * NewElValueByNumber(guint16 group, guint16 element);
- gdcmElValue * NewElValueByName(std::string Name);
+ gdcmElValue * NewElValueByName (std::string Name);
- void FindLength(gdcmElValue *);
- void FindVR(gdcmElValue *);
- void LoadElementValue(gdcmElValue *);
+ void FindLength (gdcmElValue *);
+ void FindVR (gdcmElValue *);
+ void LoadElementValue (gdcmElValue *);
void LoadElementValueSafe(gdcmElValue *);
- void SkipElementValue(gdcmElValue *);
- void FixFoundLength(gdcmElValue*, guint32);
- bool IsAnInteger(gdcmElValue *);
+ void SkipElementValue (gdcmElValue *);
+ void FixFoundLength (gdcmElValue*, guint32);
+ bool IsAnInteger (gdcmElValue *);
void LoadElements(void);
protected:
virtual void ParseHeader(bool exception_on_error = false)
throw(gdcmFormatError);
- gdcmHeader(const char *filename, bool exception_on_error = false);
+
gdcmHeader( bool exception_on_error = false);
+ gdcmHeader(const char *filename,
+ bool exception_on_error = false,
+ bool enable_sequences = false);
+
virtual ~gdcmHeader();
std::string GetFileName(void) {return filename;}