]> Creatis software - gdcm.git/commitdiff
gdcm::
authorjpr <jpr>
Thu, 21 Jun 2007 15:06:12 +0000 (15:06 +0000)
committerjpr <jpr>
Thu, 21 Jun 2007 15:06:12 +0000 (15:06 +0000)
Example/BatchUncompress.cxx
Example/DenseMultiFramesToDicom.cxx
Example/DenseToDicom.cxx
Example/exConvert3DplusT.cxx
Example/exDicomRTStructSetFile.cxx
Example/exExtractCSA.cxx

index b14a5aeecb66928f069a6fc4d385be4b01f06e11..3fa30c662ece7be1a167e606611328e5cc74a71a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: BatchUncompress.cxx,v $
   Language:  C++
-  Date:      $Date: 2006/03/01 09:51:56 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2007/06/21 15:06:12 $
+  Version:   $Revision: 1.4 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -41,13 +41,13 @@ int main(int argc, char *argv[])
   const char *inputfilename = argv[1];
   const char *outputfilename = argv[2];
 
-  gdcm::File *input = new gdcm::File( );
+  GDCM_NAME_SPACE::File *input = new GDCM_NAME_SPACE::File( );
   input->SetFileName( inputfilename );
 //  input->SetLoadMode(loadMode);
   input->Load();
   if ( input->IsReadable() )
     {
-    gdcm::FileHelper *output = new gdcm::FileHelper( input );
+    GDCM_NAME_SPACE::FileHelper *output = new GDCM_NAME_SPACE::FileHelper( input );
 
     output->GetImageData(); //EXTREMELY IMPORTANT
     //Otherwise ReadPixel == -1 -> the dicom writing fails completely
@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
     output->SetImageData( imageData, dataSize);
     // lossy compression would be a pixel modification.
     // uncompress is *not* 
-    fh->SetContentType(gdcm::UNMODIFIED_PIXELS_IMAGE);    
+    fh->SetContentType(GDCM_NAME_SPACE::UNMODIFIED_PIXELS_IMAGE);    
     output->WriteDcmExplVR( outputfilename );
 
     delete output;
index bf28fdb320280af4e6bfef080c1ebf3f87e85538..48a74617dac09a7e04cf99297fc17a7536addbf0 100755 (executable)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: DenseMultiFramesToDicom.cxx,v $
   Language:  C++
-  Date:      $Date: 2006/07/26 17:02:55 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2007/06/21 15:06:12 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -111,7 +111,7 @@ int main(int argc, char *argv[])
 
    // ----- Initialize Arguments Manager ------
       
-   gdcm::ArgMgr *am = new gdcm::ArgMgr(argc, argv);
+   GDCM_NAME_SPACE::ArgMgr *am = new GDCM_NAME_SPACE::ArgMgr(argc, argv);
   
    if (argc == 1 || am->ArgMgrDefined("usage")) 
    {
@@ -124,7 +124,7 @@ int main(int argc, char *argv[])
    dirNamein  = am->ArgMgrGetString("dirin","."); 
 
    if (am->ArgMgrDefined("debug"))
-      gdcm::Debug::DebugOn();
+      GDCM_NAME_SPACE::Debug::DebugOn();
       
    int verbose  = am->ArgMgrDefined("verbose");      
    int listonly = am->ArgMgrDefined("listonly");
@@ -149,7 +149,7 @@ int main(int argc, char *argv[])
 
    // ----- Begin Processing -----
    
-   if ( ! gdcm::DirList::IsDirectory(dirNamein) )
+   if ( ! GDCM_NAME_SPACE::DirList::IsDirectory(dirNamein) )
    {
       std::cout << "KO : [" << dirNamein << "] is not a Directory." 
                 << std::endl;
@@ -161,7 +161,7 @@ int main(int argc, char *argv[])
    }
 
    std::string strDirNamein(dirNamein);
-   gdcm::DirList dirList(strDirNamein, true); // (recursively) the list of files
+   GDCM_NAME_SPACE::DirList dirList(strDirNamein, true); // (recursively) the list of files
 
    if (listonly)
    {
@@ -174,15 +174,15 @@ int main(int argc, char *argv[])
    std::string filenameout;
 
    std::string strStudyUID;
-   strStudyUID =  gdcm::Util::CreateUniqueUID();
+   strStudyUID =  GDCM_NAME_SPACE::Util::CreateUniqueUID();
    int serieNumber =0;     
-   gdcm::DirListType fileNames;
+   GDCM_NAME_SPACE::DirListType fileNames;
    fileNames = dirList.GetFilenames();
-   for (gdcm::DirListType::iterator it = fileNames.begin();  
+   for (GDCM_NAME_SPACE::DirListType::iterator it = fileNames.begin();  
                                     it != fileNames.end();
                                   ++it)
    { 
-      if ( gdcm::Util::GetName((*it)).c_str()[0] == '.' ) 
+      if ( GDCM_NAME_SPACE::Util::GetName((*it)).c_str()[0] == '.' ) 
       {
       // skip hidden files
          continue;
@@ -311,7 +311,7 @@ All pixels with zero strain values are outside the masks.
    float val;
      
    std::string strSerieUID;
-   strSerieUID =  gdcm::Util::CreateUniqueUID();
+   strSerieUID =  GDCM_NAME_SPACE::Util::CreateUniqueUID();
    int imageNumber = 0;     
    float currentTime;
    currentTime = timeStart;
@@ -412,11 +412,11 @@ All pixels with zero strain values are outside the masks.
        ptr++;
     }  
 
- // gdcm::Debug::DebugOn();
+ // GDCM_NAME_SPACE::Debug::DebugOn();
   
         std::ostringstream str; 
-        gdcm::File *file;
-        file = gdcm::File::New();       
+        GDCM_NAME_SPACE::File *file;
+        file = GDCM_NAME_SPACE::File::New();       
               
   // Set the image size
         str.str("");
@@ -485,8 +485,8 @@ All pixels with zero strain values are outside the masks.
  
    // file->Print();
     
-    gdcm::FileHelper *fh;
-    fh = gdcm::FileHelper::New(file);
+    GDCM_NAME_SPACE::FileHelper *fh;
+    fh = GDCM_NAME_SPACE::FileHelper::New(file);
     // cast is just to avoid warnings (*no* conversion)
     fh->SetImageData((uint8_t *)img,nx*ny*sizeof(uint16_t));
     fh->SetWriteModeToRaw(); 
@@ -513,7 +513,7 @@ All pixels with zero strain values are outside the masks.
    // Anatomical Images.
   std::cout << " ========= Create Anatomical images" << std::endl;   
 
-  strSerieUID =  gdcm::Util::CreateUniqueUID();     
+  strSerieUID =  GDCM_NAME_SPACE::Util::CreateUniqueUID();     
   imageNumber = 0;     
   currentTime = timeStart;
      
@@ -562,8 +562,8 @@ All pixels with zero strain values are outside the masks.
        ptr++;
     }
         std::ostringstream str; 
-        gdcm::File *file;
-        file = gdcm::File::New();       
+        GDCM_NAME_SPACE::File *file;
+        file = GDCM_NAME_SPACE::File::New();       
               
   // Set the image size
         str.str("");
@@ -631,8 +631,8 @@ All pixels with zero strain values are outside the masks.
          file->InsertEntryString(charImagePosition,0x0018,0x1060, "DS");
    // file->Print();
     
-    gdcm::FileHelper *fh;
-    fh = gdcm::FileHelper::New(file);
+    GDCM_NAME_SPACE::FileHelper *fh;
+    fh = GDCM_NAME_SPACE::FileHelper::New(file);
     // cast is just to avoid warnings (*no* conversion)
     fh->SetImageData((uint8_t *)img,nx*ny*sizeof(uint16_t));
     fh->SetWriteModeToRaw(); 
index 7f0e657d84ef1fb09626caa0f93e893d4355edcc..06ce973fa49c9426e28b25b4918cded5fb82021d 100755 (executable)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: DenseToDicom.cxx,v $
   Language:  C++
-  Date:      $Date: 2006/07/26 17:48:14 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2007/06/21 15:06:13 $
+  Version:   $Revision: 1.3 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -103,7 +103,7 @@ int main(int argc, char *argv[])
 
    // ----- Initialize Arguments Manager ------
       
-   gdcm::ArgMgr *am = new gdcm::ArgMgr(argc, argv);
+   GDCM_NAME_SPACE::ArgMgr *am = new GDCM_NAME_SPACE::ArgMgr(argc, argv);
   
    if (argc == 1 || am->ArgMgrDefined("usage")) 
    {
@@ -116,7 +116,7 @@ int main(int argc, char *argv[])
    dirNamein  = am->ArgMgrGetString("dirin","."); 
 
    if (am->ArgMgrDefined("debug"))
-      gdcm::Debug::DebugOn();
+      GDCM_NAME_SPACE::Debug::DebugOn();
       
    int verbose  = am->ArgMgrDefined("verbose");      
    int listonly = am->ArgMgrDefined("listonly");
@@ -132,7 +132,7 @@ int main(int argc, char *argv[])
 
    // ----- Begin Processing -----
    
-   if ( ! gdcm::DirList::IsDirectory(dirNamein) )
+   if ( ! GDCM_NAME_SPACE::DirList::IsDirectory(dirNamein) )
    {
       std::cout << "KO : [" << dirNamein << "] is not a Directory." << std::endl;
       return 0;
@@ -143,7 +143,7 @@ int main(int argc, char *argv[])
    }
 
    std::string strDirNamein(dirNamein);
-   gdcm::DirList dirList(strDirNamein, true); // get recursively the list of files
+   GDCM_NAME_SPACE::DirList dirList(strDirNamein, true); // get recursively the list of files
 
    if (listonly)
    {
@@ -155,9 +155,9 @@ int main(int argc, char *argv[])
    
    std::string filenameout;
    
-   gdcm::DirListType fileNames;
+   GDCM_NAME_SPACE::DirListType fileNames;
    fileNames = dirList.GetFilenames();
-   for (gdcm::DirListType::iterator it = fileNames.begin();  
+   for (GDCM_NAME_SPACE::DirListType::iterator it = fileNames.begin();  
                                     it != fileNames.end();
                                   ++it)
    {
@@ -312,11 +312,11 @@ mini,maxi=data.GetScalarRange()
            imageSC.SetInput(data)
            imageSC.Update()  
  */ 
- // gdcm::Debug::DebugOn();
+ // GDCM_NAME_SPACE::Debug::DebugOn();
   
        std::ostringstream str; 
-       gdcm::File *file;
-       file = gdcm::File::New();       
+       GDCM_NAME_SPACE::File *file;
+       file = GDCM_NAME_SPACE::File::New();       
               
   // Set the image size
         str.str("");
@@ -353,8 +353,8 @@ mini,maxi=data.GetScalarRange()
     
     file->Print();
     
-    gdcm::FileHelper *fileH;
-    fileH = gdcm::FileHelper::New(file);
+    GDCM_NAME_SPACE::FileHelper *fileH;
+    fileH = GDCM_NAME_SPACE::FileHelper::New(file);
     // cast is just to avoid warnings (*no* conversion)
     fileH->SetImageData((uint8_t *)img,nx*ny*sizeof(uint16_t));
     fileH->SetWriteModeToRaw(); 
index 43db2d2040aa8b05b28fb4bfd428de995414c102..8db5edbbb42eb7febdf4e1044d301db77ee3002f 100755 (executable)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: exConvert3DplusT.cxx,v $
   Language:  C++
-  Date:      $Date: 2006/09/01 13:42:02 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2007/06/21 15:06:13 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
    
      // ----- Initialize Arguments Manager ------
   
-   gdcm::ArgMgr *am = new gdcm::ArgMgr(argc, argv);
+   GDCM_NAME_SPACE::ArgMgr *am = new GDCM_NAME_SPACE::ArgMgr(argc, argv);
   
    if (am->ArgMgrDefined("usage") || argc == 1) 
    {
@@ -80,7 +80,7 @@ int main(int argc, char *argv[])
    }
 
    if (am->ArgMgrDefined("debug"))
-      gdcm::Debug::DebugOn(); 
+      GDCM_NAME_SPACE::Debug::DebugOn(); 
    int verbose  = am->ArgMgrDefined("verbose");
    int oververbose  = am->ArgMgrDefined("oververbose");
       
@@ -106,15 +106,15 @@ int main(int argc, char *argv[])
    int nbOfImagesInVolume = am->ArgMgrGetInt("imagesinvolume",
                                          imagetteLineNumber*imagetteRowNumber);
  
-   int loadMode = gdcm::LD_ALL;
+   int loadMode = GDCM_NAME_SPACE::LD_ALL;
    if ( am->ArgMgrDefined("noshadowseq") )
-      loadMode |= gdcm::LD_NOSHADOWSEQ;
+      loadMode |= GDCM_NAME_SPACE::LD_NOSHADOWSEQ;
    else 
    {
    if ( am->ArgMgrDefined("noshadow") )
-         loadMode |= gdcm::LD_NOSHADOW;
+         loadMode |= GDCM_NAME_SPACE::LD_NOSHADOW;
       if ( am->ArgMgrDefined("noseq") )
-         loadMode |= gdcm::LD_NOSEQ;
+         loadMode |= GDCM_NAME_SPACE::LD_NOSEQ;
    }
         
    /* if unused Param we give up */
@@ -131,7 +131,7 @@ int main(int argc, char *argv[])
  
  
    //std::cout << "dirIn [" << dirIn << "]" << std::endl;
-   if ( ! gdcm::DirList::IsDirectory(dirIn) )
+   if ( ! GDCM_NAME_SPACE::DirList::IsDirectory(dirIn) )
    {
       std::cout << "KO : [" << dirIn << "] is not a Directory." << std::endl;
       return 0;
@@ -148,13 +148,13 @@ int main(int argc, char *argv[])
    if (verbose)
       std::cout << "Check for output directory :[" << dirOut << "]."
              <<std::endl;
-   if ( ! gdcm::DirList::IsDirectory(dirOut) )    // dirout not found
+   if ( ! GDCM_NAME_SPACE::DirList::IsDirectory(dirOut) )    // dirout not found
    {
       systemCommand = "mkdir " +strDirNameout;        // create it!
       if (verbose)
          std::cout << systemCommand << std::endl;
       system (systemCommand.c_str());
-      if ( ! gdcm::DirList::IsDirectory(dirOut) ) // be sure it worked
+      if ( ! GDCM_NAME_SPACE::DirList::IsDirectory(dirOut) ) // be sure it worked
       {
           std::cout << "KO : not a dir : [" << dirOut 
                     << "] (creation failure ?)" << std::endl;
@@ -174,8 +174,8 @@ int main(int argc, char *argv[])
                    << "] already exists; Used as is." << std::endl;
    }
 
-   gdcm::DirList dirList(dirIn,false); // gets (at single level) the file list
-   gdcm::DirListType fileList = dirList.GetFilenames();
+   GDCM_NAME_SPACE::DirList dirList(dirIn,false); // gets (at single level) the file list
+   GDCM_NAME_SPACE::DirListType fileList = dirList.GetFilenames();
    
    // hope sorting on the filename is enough!
    // anyway, *no* filed is available to perform anything more clever.
@@ -189,7 +189,7 @@ int main(int argc, char *argv[])
    //          adding new Series to an already existing Study
    std::string strStudyUID;
    if ( !userDefinedStudy)
-      strStudyUID =  gdcm::Util::CreateUniqueUID();
+      strStudyUID =  GDCM_NAME_SPACE::Util::CreateUniqueUID();
    else
       strStudyUID = studyUID;
 
@@ -201,7 +201,7 @@ int main(int argc, char *argv[])
    
    std::string strSerieUID; 
    if ( !userDefinedSerie)   
-      strSerieUID =  gdcm::Util::CreateUniqueUID();
+      strSerieUID =  GDCM_NAME_SPACE::Util::CreateUniqueUID();
    else      
       strSerieUID = serieUID;
 
@@ -213,20 +213,20 @@ int main(int argc, char *argv[])
    memset(imageTable, 0, totalNumberOfPixels * imagePixelSize);
              
    int16_t **tabImageData = new int16_t *[nbOfImagesInVolume];   
-   gdcm::File **f         = new gdcm::File *[nbOfImagesInVolume];
-   gdcm::FileHelper **fh  = new gdcm::FileHelper *[nbOfImagesInVolume];
+   GDCM_NAME_SPACE::File **f         = new GDCM_NAME_SPACE::File *[nbOfImagesInVolume];
+   GDCM_NAME_SPACE::FileHelper **fh  = new GDCM_NAME_SPACE::FileHelper *[nbOfImagesInVolume];
    
    std::string fullFilename, lastFilename;
    float zPositionComponent = 0.0;
       
    int imageNumber = 0;
    
-   for( gdcm::DirListType::iterator it  = fileList.begin();
+   for( GDCM_NAME_SPACE::DirListType::iterator it  = fileList.begin();
                                  it != fileList.end();
                                  ++it )
    {
       fullFilename = *it;
-      f[imageNumber] = gdcm::File::New( );
+      f[imageNumber] = GDCM_NAME_SPACE::File::New( );
       f[imageNumber]->SetLoadMode(loadMode);
       f[imageNumber]->SetFileName( it->c_str() );
 
@@ -243,7 +243,7 @@ int main(int argc, char *argv[])
 
       // Load the pixels in RAM.    
       
-      fh[imageNumber] = gdcm::FileHelper::New(f[imageNumber]); 
+      fh[imageNumber] = GDCM_NAME_SPACE::FileHelper::New(f[imageNumber]); 
       // Don't convert (Gray Pixels + LUT) into (RGB pixels) ?!?
    
       tabImageData[imageNumber] = (int16_t *)fh[imageNumber]->GetImageDataRaw();
@@ -367,11 +367,11 @@ int main(int argc, char *argv[])
 // ==================================================================================================
 
          fh[imageNumber]->SetWriteTypeToDcmExplVR();               
-         fh[imageNumber]->SetContentType(gdcm::UNMODIFIED_PIXELS_IMAGE);
+         fh[imageNumber]->SetContentType(GDCM_NAME_SPACE::UNMODIFIED_PIXELS_IMAGE);
 
       
-         lastFilename =  gdcm::Util::GetName( fullFilename );
-         std::string fullWriteFilename = strDirNameout + gdcm::GDCM_FILESEPARATOR 
+         lastFilename =  GDCM_NAME_SPACE::Util::GetName( fullFilename );
+         std::string fullWriteFilename = strDirNameout + GDCM_NAME_SPACE::GDCM_FILESEPARATOR 
                                        + lastFilename;
          if (verbose)
             std::cout << "Write : [" << fullWriteFilename << "]" << std::endl;
index edd10d7d4ee2986506f7d4e64c77d4b5d0303291..65b73a69fae4b787d186646590767204244c6eef 100755 (executable)
@@ -4,8 +4,8 @@
   Program:   gdcm
   Module:    $RCSfile: exDicomRTStructSetFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/06/18 12:02:54 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2007/06/21 15:06:13 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 #include "gdcmArgMgr.h" 
  
-bool TestDicomRTStructSetFile(gdcm::File* file); 
-bool TestDicomCTSerie(const gdcm::FileList serie);
+bool TestDicomRTStructSetFile(GDCM_NAME_SPACE::File* file); 
+bool TestDicomCTSerie(const GDCM_NAME_SPACE::FileList serie);
 
   //====================================================================
   
   //====================================================================
   //In a dicom seq try to find an item with a gived tag/(int)value pair, else creates it
-  gdcm::SQItem* GetAnItemWithTagValue(gdcm::SeqEntry* seqEntry, const uint16_t group, 
+  GDCM_NAME_SPACE::SQItem* GetAnItemWithTagValue(GDCM_NAME_SPACE::SeqEntry* seqEntry, const uint16_t group, 
       const uint16_t elem, const int value, const bool writeItem) {
     int foundValue;
     std::stringstream valueStream;
     valueStream<<value;
     std::string strValue = valueStream.str();
-    gdcm::SQItem* curItem = seqEntry->GetFirstSQItem();
-    gdcm::ValEntry* valEntry;
+    GDCM_NAME_SPACE::SQItem* curItem = seqEntry->GetFirstSQItem();
+    GDCM_NAME_SPACE::ValEntry* valEntry;
     while (curItem != NULL) {
       valEntry = curItem->GetValEntry(group,elem);
       std::istringstream(valEntry->GetValue())>>foundValue;
@@ -75,8 +75,8 @@ bool TestDicomCTSerie(const gdcm::FileList serie);
     if (writeItem == true) {
       unsigned int newItemNumber = seqEntry->GetNumberOfSQItems ();
 // ----------       
-      //gdcm::SQItem* newItem = new gdcm::SQItem(seqEntry->GetDepthLevel()+1);
-       gdcm::SQItem* newItem = gdcm::SQItem::New(seqEntry->GetDepthLevel()+1);
+      //GDCM_NAME_SPACE::SQItem* newItem = new GDCM_NAME_SPACE::SQItem(seqEntry->GetDepthLevel()+1);
+       GDCM_NAME_SPACE::SQItem* newItem = GDCM_NAME_SPACE::SQItem::New(seqEntry->GetDepthLevel()+1);
 // ---------- 
       seqEntry->AddSQItem(newItem,(int)newItemNumber);
       newItem->InsertValEntry(strValue, group, elem);  /// \TODO : si VR absent, le chercher dans le dict!
@@ -95,7 +95,7 @@ bool TestDicomCTSerie(const gdcm::FileList serie);
    =================================================*/
   // Test if a file list is  a valid CT serie
        
-  bool TestDicomCTSerie(const gdcm::FileList serie) {
+  bool TestDicomCTSerie(const GDCM_NAME_SPACE::FileList serie) {
   
     if (serie.size() < 2) {
       itkGenericExceptionMacro(<<"Serie must contain at least 2 files !");
@@ -104,8 +104,8 @@ bool TestDicomCTSerie(const gdcm::FileList serie);
     float firstSliceImagePosition[3];
     float currentSliceImagePosition[3];    
     
-    gdcm::FileList::const_iterator first = serie.begin();
-    gdcm::FileList::const_iterator it = first ++;
+    GDCM_NAME_SPACE::FileList::const_iterator first = serie.begin();
+    GDCM_NAME_SPACE::FileList::const_iterator it = first ++;
     
     bool res = (*first)->GetImageOrientationPatient(firstSliceImagePosition);
     if (!res) {
@@ -113,17 +113,17 @@ bool TestDicomCTSerie(const gdcm::FileList serie);
     }
     
     while (it != serie.end()) {
-      if (!gdcm::Util::DicomStringEqual((*it)->GetEntryValue(0x0008,0x0016),"1.2.840.10008.5.1.4.1.1.2")) {
+      if (!GDCM_NAME_SPACE::Util::DicomStringEqual((*it)->GetEntryValue(0x0008,0x0016),"1.2.840.10008.5.1.4.1.1.2")) {
            itkGenericExceptionMacro();
            //CT Dicom slices must have a SOP Class UID [0008|0016] = [1.2.840.10008.5.1.4.1.1.2] ==> [CT Image Storage]
       }
       
-      if (!gdcm::Util::DicomStringEqual((*it)->GetEntryValue(0x0008,0x0060),"CT")) {
+      if (!GDCM_NAME_SPACE::Util::DicomStringEqual((*it)->GetEntryValue(0x0008,0x0060),"CT")) {
         itkGenericExceptionMacro();
        //CT Dicom slices must have a Modality [0008|0060] = [CT]
       }
       
-      if (!gdcm::Util::DicomStringEqual((*it)->GetEntryValue(0x0020,0x0037),"1.0000\\0.0000\\0.0000\\0.0000\\1.0000\\0.0000")) {
+      if (!GDCM_NAME_SPACE::Util::DicomStringEqual((*it)->GetEntryValue(0x0020,0x0037),"1.0000\\0.0000\\0.0000\\0.0000\\1.0000\\0.0000")) {
          itkGenericExceptionMacro("CT Dicom slices must an Image Orientation [0020|0037]"
          <<" = [1.0000\0.0000\0.0000\0.0000\1.0000\0.0000]");  
       }
@@ -173,10 +173,10 @@ bool TestDicomCTSerie(const gdcm::FileList serie);
    =================================================*/
     
  // Test if a file is a valid Dicom-RT Structure-Set file (readable by us) 
-  bool TestDicomRTStructSetFile(gdcm::File* file) {
+  bool TestDicomRTStructSetFile(GDCM_NAME_SPACE::File* file) {
 // ----------  
-    //gdcm::ValEntry* valEntry;
-    gdcm::DataEntry* valEntry;
+    //GDCM_NAME_SPACE::ValEntry* valEntry;
+    GDCM_NAME_SPACE::DataEntry* valEntry;
 // ---------- 
 
     std::string exception0 = "Not a [RT Structure Set Storage]";
@@ -185,20 +185,20 @@ bool TestDicomCTSerie(const gdcm::FileList serie);
     std::string exception3 = "Modality not= RTSTRUCT"; 
             
     //Verify if the file is a RT-Structure-Set dicom file
-    if (!gdcm::Util::DicomStringEqual(file->GetEntryValue(0x0008,0x0016),"1.2.840.10008.5.1.4.1.1.481.3")) {  //SOP clas UID
+    if (!GDCM_NAME_SPACE::Util::DicomStringEqual(file->GetEntryValue(0x0008,0x0016),"1.2.840.10008.5.1.4.1.1.481.3")) {  //SOP clas UID
       itkGenericExceptionMacro(<<exception0);
       // (the file must have a SOP Class UID [0008|0016] = 1.2.840.10008.5.1.4.1.1.481.3 ==> [RT Structure Set Storage] !
     }
         
-    if (!gdcm::Util::DicomStringEqual(file->GetEntryValue(0x0008,0x0060),"RTSTRUCT")) {  //SOP clas UID
+    if (!GDCM_NAME_SPACE::Util::DicomStringEqual(file->GetEntryValue(0x0008,0x0060),"RTSTRUCT")) {  //SOP clas UID
       itkGenericExceptionMacro(<<exception3);
       // (the file must have a Modality tag = RTSTRUCT !
     }    
 
     //Verify only one Referenced Frame UID and one or more Series UID
 
-    gdcm::SeqEntry* seqEntry;
-    gdcm::SQItem* currentItem;
+    GDCM_NAME_SPACE::SeqEntry* seqEntry;
+    GDCM_NAME_SPACE::SQItem* currentItem;
     std::string currentFrameRefUID;
     
     seqEntry  = file->GetSeqEntry(0x3006,0x0020); //Structure Set ROI sequence
@@ -233,7 +233,7 @@ bool TestDicomCTSerie(const gdcm::FileList serie);
       itkGenericExceptionMacro(<<exception1);
     }
     
-    gdcm::SeqEntry* seqEntry2 = currentItem->GetSeqEntry(0x3006,0x0012); //Referenced Study sequence
+    GDCM_NAME_SPACE::SeqEntry* seqEntry2 = currentItem->GetSeqEntry(0x3006,0x0012); //Referenced Study sequence
     if (seqEntry2->GetNumberOfSQItems() < 1) {
       itkGenericExceptionMacro(<<exception2);    
     }
@@ -326,14 +326,14 @@ int main(int argc, char *argv[])
 //   Read the input image.
 // ============================================================ 
 
-   gdcm::File *f = gdcm::File::New( );
+   GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New( );
 
-   //f->SetLoadMode(gdcm::LD_NOSEQ | gdcm::LD_NOSHADOW);
+   //f->SetLoadMode(GDCM_NAME_SPACE::LD_NOSEQ | GDCM_NAME_SPACE::LD_NOSHADOW);
    f->SetFileName( fileName );
    f->SetMaxSizeLoadEntry(0xffff);
    bool res = f->Load();  
 
-   if( gdcm::Debug::GetDebugFlag())
+   if( GDCM_NAME_SPACE::Debug::GetDebugFlag())
    {
       std::cout << "---------------------------------------------" << std::endl;
       f->Print();
index f3ca03bfd64715725997f370fedd4f59455b6b03..4b5e3c74901fb500eb6ec7f199d2bb42b896d602 100755 (executable)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: exExtractCSA.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/06/21 15:01:00 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2007/06/21 15:06:13 $
+  Version:   $Revision: 1.4 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -252,14 +252,14 @@ int main(int argc, char *argv[])
 //   Read the input image.
 // ============================================================ 
   
-   gdcm::File *f = gdcm::File::New( );
+   GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New( );
 
-   //f->SetLoadMode(gdcm::LD_NOSEQ | gdcm::LD_NOSHADOW);
+   //f->SetLoadMode(GDCM_NAME_SPACE::LD_NOSEQ | GDCM_NAME_SPACE::LD_NOSHADOW);
    f->SetFileName( fileName );
    f->SetMaxSizeLoadEntry(0xffff);
    bool res = f->Load();  
 
-   if( gdcm::Debug::GetDebugFlag())
+   if( GDCM_NAME_SPACE::Debug::GetDebugFlag())
    {
       std::cout << "---------------------------------------------" << std::endl;
       f->Print();
@@ -292,9 +292,9 @@ for (int tag_no=0; tag_no<extractNb; tag_no++) {
       std::cout << "Let's try tag : " << std::hex << group << "|" << elem << std::endl;
       
    std::string dicom_tag_value = f->GetEntryString(group, elem);
-   if (dicom_tag_value == gdcm::GDCM_UNFOUND)
+   if (dicom_tag_value == GDCM_NAME_SPACE::GDCM_UNFOUND)
    {
-     gdcm::DictEntry *dictEntry = f->GetPubDict()->GetEntry( group, elem);
+     GDCM_NAME_SPACE::DictEntry *dictEntry = f->GetPubDict()->GetEntry( group, elem);
      if (dictEntry != NULL)
         std::cerr << "Image doesn't contain any tag: " << dictEntry->GetName() 
                   << std::endl;
@@ -305,8 +305,8 @@ for (int tag_no=0; tag_no<extractNb; tag_no++) {
      return 1;
    }
 
-   gdcm::DocEntry *dicom_tag_doc = f->GetDocEntry(group, elem);
-   gdcm::DataEntry *dicom_tag = dynamic_cast<gdcm::DataEntry *>(dicom_tag_doc);
+   GDCM_NAME_SPACE::DocEntry *dicom_tag_doc = f->GetDocEntry(group, elem);
+   GDCM_NAME_SPACE::DataEntry *dicom_tag = dynamic_cast<GDCM_NAME_SPACE::DataEntry *>(dicom_tag_doc);
    if( !dicom_tag )
    {
       std::cerr << "Sorry DataEntry only please" << std::endl;