]> Creatis software - gdcm.git/commitdiff
* src/gdcmCommon.h, gdcmDicomDir.cxx, gdcmFile.cxx, gdcmHeaderHelper.h,
authorregrain <regrain>
Wed, 5 May 2004 12:48:29 +0000 (12:48 +0000)
committerregrain <regrain>
Wed, 5 May 2004 12:48:29 +0000 (12:48 +0000)
      gdcmParser.cxx, gdcmParser.h : bug fix for the Microsoft .Net compilation
     -- BeNours

ChangeLog
src/gdcmCommon.h
src/gdcmDicomDir.cxx
src/gdcmFile.cxx
src/gdcmParser.cxx
src/gdcmParser.h

index c2ee06a8f444894ad951996c67d07f81eb0fe78f..a4f7c524f81ce0575f274155efa6a0da05ab01e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-04 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+    * src/gdcmCommon.h, gdcmDicomDir.cxx, gdcmFile.cxx, gdcmHeaderHelper.h,
+      gdcmParser.cxx, gdcmParser.h : bug fix for the Microsoft .Net compilation
+
 2004-05-04 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
      * src/gdcmFile.cxx, gdcmHeader.cxx : bug fix for the msvc compilation
      * Test/ShowDicom.cxx : bug fix for msvc compilation
index 0af21208d3643698614776e408519bed1d07d5fb..76b3b0642dde8fbbf5696ff32fe4af9a1a9719c2 100644 (file)
@@ -92,11 +92,11 @@ typedef std::string TagKey;
 typedef std::string TagName;
 
 enum FileType {
-      Unknown = 0,
-      ExplicitVR, // gdcmDicomDir is in this case
-      ImplicitVR,
-      ACR,
-      ACR_LIBIDO
+      gdcmUnknown = 0,
+      gdcmExplicitVR, // gdcmDicomDir is in this case
+      gdcmImplicitVR,
+      gdcmACR,
+      gdcmACR_LIBIDO
 };
 
 //-----------------------------------------------------------------------------
index 6f80dfce2b7d19b98e1c92d63edf93ca73365ad9..20d81973fbdab959aabef1076f546bc53a66e5ff 100644 (file)
@@ -337,28 +337,28 @@ void gdcmDicomDir::WriteEntries(FILE *_fp)
    
    ptrMeta= GetDicomDirMeta();
    for(i=ptrMeta->debut();i!=ptrMeta->fin();++i) {
-      WriteEntry(*i,_fp, ExplicitVR);
+      WriteEntry(*i,_fp, gdcmExplicitVR);
    }   
     
    itPatient = GetDicomDirPatients().begin(); 
    while ( itPatient != GetDicomDirPatients().end() ) {
       for(i=(*itPatient)->debut();i!=(*itPatient)->fin();++i) {
-         WriteEntry(*i,_fp, ExplicitVR);
+         WriteEntry(*i,_fp, gdcmExplicitVR);
       }
       itStudy = ((*itPatient)->GetDicomDirStudies()).begin();        
       while (itStudy != (*itPatient)->GetDicomDirStudies().end() ) {   
          for(i=(*itStudy)->debut();i!=(*itStudy)->fin();++i) {
-            WriteEntry(*i,_fp, ExplicitVR);
+            WriteEntry(*i,_fp, gdcmExplicitVR);
          } 
          itSerie = ((*itStudy)->GetDicomDirSeries()).begin();
          while (itSerie != (*itStudy)->GetDicomDirSeries().end() ) {
             for(i=(*itSerie)->debut();i!=(*itSerie)->fin();++i) {
-               WriteEntry(*i,_fp, ExplicitVR);
+               WriteEntry(*i,_fp, gdcmExplicitVR);
             }
             itImage = ((*itSerie)->GetDicomDirImages()).begin();
             while (itImage != (*itSerie)->GetDicomDirImages().end() ) {
                for(i=(*itImage)->debut();i!=(*itImage)->fin();++i) {
-                  WriteEntry(*i,_fp, ExplicitVR);
+                  WriteEntry(*i,_fp, gdcmExplicitVR);
                }
                ++itImage;                  
            }
index 607c37ae1bfd2b1e4c0654c4337786b9981324ce..12d464bc23159e0748f2958e340d6855c4115597 100644 (file)
@@ -623,7 +623,7 @@ bool gdcmFile::WriteRawData (std::string fileName) {
  */
 
 bool gdcmFile::WriteDcmImplVR (std::string fileName) {
-   return WriteBase(fileName, ImplicitVR);
+   return WriteBase(fileName, gdcmImplicitVR);
 }
 
 /**
@@ -649,7 +649,7 @@ bool gdcmFile::WriteDcmImplVR (const char *fileName) {
  */
 
 bool gdcmFile::WriteDcmExplVR (std::string fileName) {
-   return WriteBase(fileName, ExplicitVR);
+   return WriteBase(fileName, gdcmExplicitVR);
 }
        
 /**
@@ -668,7 +668,7 @@ bool gdcmFile::WriteDcmExplVR (std::string fileName) {
  */
 
 bool gdcmFile::WriteAcr (std::string fileName) {
-   return WriteBase(fileName, ACR);
+   return WriteBase(fileName, gdcmACR);
 }
 
 //-----------------------------------------------------------------------------
@@ -686,7 +686,7 @@ bool gdcmFile::WriteBase (std::string fileName, FileType type) {
 
    FILE *fp1;
    
-   if (PixelRead==-1 && type != ExplicitVR) {
+   if (PixelRead==-1 && type != gdcmExplicitVR) {
       return false;               
    }
 
@@ -696,7 +696,7 @@ bool gdcmFile::WriteBase (std::string fileName, FileType type) {
       return (false);
    }
 
-   if ( (type == ImplicitVR) || (type == ExplicitVR) ) {
+   if ( (type == gdcmImplicitVR) || (type == gdcmExplicitVR) ) {
       char *filePreamble;
       // writing Dicom File Preamble
       filePreamble=new char[128];
@@ -717,7 +717,7 @@ bool gdcmFile::WriteBase (std::string fileName, FileType type) {
    ///       but pb expected if user deals with, e.g. COMPLEX images
 
    std::string rows, columns; 
-   if ( Header->GetFileType() == ACR_LIBIDO){
+   if ( Header->GetFileType() == gdcmACR_LIBIDO){
          rows    = Header->GetEntryByNumber(0x0028, 0x0010);
          columns = Header->GetEntryByNumber(0x0028, 0x0011);
          Header->SetEntryByNumber(columns,  0x0028, 0x0010);
@@ -763,7 +763,7 @@ bool gdcmFile::WriteBase (std::string fileName, FileType type) {
    // ...and we restore the Header to be Dicom Compliant again 
    // just after writting
 
-   if (Header->GetFileType() == ACR_LIBIDO){
+   if (Header->GetFileType() == gdcmACR_LIBIDO){
          Header->SetEntryByNumber(rows   , 0x0028, 0x0010);
          Header->SetEntryByNumber(columns, 0x0028, 0x0011);
    }   
index 9a1c07cea4a1934d63cfb10120e64333ab917198..332b415adc257c92d47d68a429b73744bb9bf236 100644 (file)
@@ -178,7 +178,7 @@ bool gdcmParser::SetShaDict(DictKey dictName){
  *         false otherwise. 
  */
 bool gdcmParser::IsReadable(void) { 
-   if(filetype==Unknown) {
+       if(filetype==gdcmUnknown) {
       return(false);
    }
    if(listEntries.size()<=0) {    
@@ -258,7 +258,7 @@ bool gdcmParser::IsExplicitVRBigEndianTransferSyntax(void) {
 
 /**
  * \brief  returns the File Type 
- *         (ACR, ACR_LIBIDO, ExplicitVR, ImplicitVR, Unknown)
+ *         (ACR, ACR_LIBIDO, ExplicitVR, ImplicitVR, Unfound)
  * @return the FileType code
  */
 FileType gdcmParser::GetFileType(void) {
@@ -346,7 +346,7 @@ bool gdcmParser::Write(FILE *fp, FileType type) {
    /// a moins de se livrer a un tres complique ajout des champs manquants.
    /// faire un CheckAndCorrectHeader (?)  
 
-   if (type == ImplicitVR) 
+   if (type == gdcmImplicitVR) 
    {
       std::string implicitVRTransfertSyntax = UI1_2_840_10008_1_2;
       ReplaceOrCreateByNumber(implicitVRTransfertSyntax,0x0002, 0x0010);
@@ -359,7 +359,7 @@ bool gdcmParser::Write(FILE *fp, FileType type) {
       SetEntryLengthByNumber(18, 0x0002, 0x0010);
    } 
 
-   if (type == ExplicitVR) 
+   if (type == gdcmExplicitVR) 
    {
       std::string explicitVRTransfertSyntax = UI1_2_840_10008_1_2_1;
       ReplaceOrCreateByNumber(explicitVRTransfertSyntax,0x0002, 0x0010);
@@ -881,7 +881,7 @@ void gdcmParser::UpdateGroupLength(bool SkipSequence, FileType type) {
       } 
       else // any elem but the first
       {   
-         if (type == ExplicitVR) 
+         if (type == gdcmExplicitVR) 
          {
             if ( (vr == "OB") || (vr == "OW") || (vr == "SQ") ) 
             {
@@ -946,7 +946,7 @@ void gdcmParser::WriteEntryTagVRLength(gdcmHeaderEntry *tag,
    fwrite ( &group,(size_t)2 ,(size_t)1 ,_fp);  //group
    fwrite ( &el,(size_t)2 ,(size_t)1 ,_fp);     //element
       
-   if ( type == ExplicitVR ) {
+   if ( type == gdcmExplicitVR ) {
 
       // Special case of delimiters:
       if (group == 0xfffe) {
@@ -961,7 +961,7 @@ void gdcmParser::WriteEntryTagVRLength(gdcmHeaderEntry *tag,
 
       guint16 z=0;
       guint16 shortLgr = lgr;
-      if (vr == "unkn") {     // Unknown was 'written'
+      if (vr == "unkn") {     // Unfound was 'written'
          // deal with Little Endian            
          fwrite ( &shortLgr,(size_t)2 ,(size_t)1 ,_fp);
          fwrite ( &z,  (size_t)2 ,(size_t)1 ,_fp);
@@ -1097,7 +1097,7 @@ bool gdcmParser::WriteEntries(FILE *_fp,FileType type)
                           tag2 != listEntries.end();
                           ++tag2)
    {
-      if ( type == ACR ){ 
+      if ( type == gdcmACR ){ 
          if ((*tag2)->GetGroup() < 0x0008)
             // Ignore pure DICOM V3 groups
             continue;
@@ -1138,7 +1138,7 @@ void gdcmParser::WriteEntriesDeprecated(FILE *_fp,FileType type) {
    for (TagHeaderEntryHT::iterator tag2=tagHT.begin();
         tag2 != tagHT.end();
         ++tag2){
-      if ( type == ACR ){ 
+      if ( type == gdcmACR ){ 
          if ((*tag2->second).GetGroup() < 0x0008)    continue; // ignore pure DICOM V3 groups
          if ((*tag2->second).GetElement() %2)        continue; // ignore shadow groups
          if ((*tag2->second).GetVR() == "SQ" )       continue; // ignore Sequences
@@ -1261,7 +1261,7 @@ bool gdcmParser::LoadHeaderEntries(bool exception_on_error) throw(gdcmFormatErro
        RecCode == "CANRME_AILIBOD1_1." )  // for brain-damaged softwares
                                           // with "little-endian strings"
    {
-         filetype = ACR_LIBIDO; 
+         filetype = gdcmACR_LIBIDO; 
          std::string rows    = GetEntryByNumber(0x0028, 0x0010);
          std::string columns = GetEntryByNumber(0x0028, 0x0011);
          SetEntryByNumber(columns, 0x0028, 0x0010);
@@ -1398,7 +1398,7 @@ void gdcmParser::AddHeaderEntry(gdcmHeaderEntry *newHeaderEntry) {
    guint16 length16;
        
    
-   if ( (filetype == ExplicitVR) && (! Entry->IsImplicitVR()) ) 
+   if ( (filetype == gdcmExplicitVR) && (! Entry->IsImplicitVR()) ) 
    {
       if ( (vr=="OB") || (vr=="OW") || (vr=="SQ") || (vr=="UN") ) 
       {
@@ -1480,7 +1480,7 @@ void gdcmParser::AddHeaderEntry(gdcmHeaderEntry *newHeaderEntry) {
          //dbg.Verbose(0, "gdcmParser::FindLength",
          //            "Erroneous element length fixed.");
          // Actually, length= 0xffff means that we deal with
-         // Unknown Sequence Length 
+         // Unfound Sequence Length 
       }
       FixHeaderEntryFoundLength(Entry, (guint32)length16);
       return;
@@ -1505,7 +1505,7 @@ void gdcmParser::AddHeaderEntry(gdcmHeaderEntry *newHeaderEntry) {
  */
 void gdcmParser::FindHeaderEntryVR( gdcmHeaderEntry *Entry) 
 {
-   if (filetype != ExplicitVR)
+   if (filetype != gdcmExplicitVR)
       return;
 
    char VR[3];
@@ -2026,13 +2026,13 @@ bool gdcmParser::CheckSwap() {
       // Use gdcmParser::dicom_vr to test all the possibilities
       // instead of just checking for UL, OB and UI !? group 0000 
       {
-         filetype = ExplicitVR;
+         filetype = gdcmExplicitVR;
          dbg.Verbose(1, "gdcmParser::CheckSwap:",
                      "explicit Value Representation");
       } 
       else 
       {
-         filetype = ImplicitVR;
+         filetype = gdcmImplicitVR;
          dbg.Verbose(1, "gdcmParser::CheckSwap:",
                      "not an explicit Value Representation");
       }
@@ -2077,19 +2077,19 @@ bool gdcmParser::CheckSwap() {
    switch (s32) {
       case 0x00040000 :
          sw = 3412;
-         filetype = ACR;
+         filetype = gdcmACR;
          return true;
       case 0x04000000 :
          sw = 4321;
-         filetype = ACR;
+         filetype = gdcmACR;
          return true;
       case 0x00000400 :
          sw = 2143;
-         filetype = ACR;
+         filetype = gdcmACR;
          return true;
       case 0x00000004 :
          sw = 0;
-         filetype = ACR;
+         filetype = gdcmACR;
          return true;
       default :
 
@@ -2108,27 +2108,27 @@ bool gdcmParser::CheckSwap() {
       //  the file IS NOT ACR-NEMA nor DICOM V3
       //  Find a trick to tell it the caller...
       
-      s16 = *((guint16 *)(deb));
-      
-      switch (s16) {
-      case 0x0002 :
-      case 0x0004 :
-      case 0x0008 :      
-         sw = 0;
-         filetype = ACR;
-         return true;
-      case 0x0200 :
-      case 0x0400 :
-      case 0x0800 : 
-         sw = 4321;
-         filetype = ACR;
-         return true;
-      default :
-         dbg.Verbose(0, "gdcmParser::CheckSwap:",
-                     "ACR/NEMA unfound swap info (Really hopeless !)"); 
-         filetype = Unknown;     
-         return false;
-      }
+               s16 = *((guint16 *)(deb));
+             
+               switch (s16) {
+                       case 0x0002 :
+                       case 0x0004 :
+                       case 0x0008 :      
+                               sw = 0;
+                               filetype = gdcmACR;
+                               return true;
+                       case 0x0200 :
+                       case 0x0400 :
+                       case 0x0800 : 
+                               sw = 4321;
+                               filetype = gdcmACR;
+                               return true;
+                       default :
+                               dbg.Verbose(0, "gdcmParser::CheckSwap:",
+                                                       "ACR/NEMA unfound swap info (Really hopeless !)"); 
+                               filetype = gdcmUnknown;     
+                               return false;
+               }
       
       // Then the only info we have is the net2host one.
       //if (! net2host )
index 6f6c30bbf8557bf736b79df91c9f2a84d48a4a9f..3bdc99a07c49f0cbcab10cb2ff674063c47c3856 100644 (file)
@@ -194,7 +194,7 @@ protected:
    void LoadHeaderEntrySafe(gdcmHeaderEntry *);
 
    void UpdateGroupLength(bool SkipSequence = false,
-                          FileType type = ImplicitVR);
+                          FileType type = gdcmImplicitVR);
 
    void AddHeaderEntry       (gdcmHeaderEntry *);