]> Creatis software - gdcm.git/commitdiff
remove old mutimap related code
authorjpr <jpr>
Mon, 28 Jun 2004 14:29:52 +0000 (14:29 +0000)
committerjpr <jpr>
Mon, 28 Jun 2004 14:29:52 +0000 (14:29 +0000)
src/gdcmDicomDir.cxx
src/gdcmDocument.cxx
src/gdcmFile.cxx
src/gdcmHeader.cxx

index 7a18df16f7d28230eda48d4c2e06238e89678b5a..2b07c9b9fbf22f71258fa160c016d393d83551ec 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/06/28 09:30:58 $
-  Version:   $Revision: 1.53 $
+  Date:      $Date: 2004/06/28 14:29:52 $
+  Version:   $Revision: 1.54 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -84,7 +84,7 @@ gdcmDicomDir::gdcmDicomDir(const char *FileName, bool parseDir,
 {
    // que l'on ai passe un root directory ou un DICOMDIR
    // et quelle que soit la valeur de parseDir,
-   // on a lance gdcmDocument 
+   // on a deja lance gdcmDocument 
    Initialize();
 
    // gdcmDocument already executed
@@ -118,7 +118,7 @@ gdcmDicomDir::gdcmDicomDir(const char *FileName, bool parseDir,
       if (e==NULL) {
          dbg.Verbose(0, "gdcmDicomDir::gdcmDicomDir : NO Directory record"
                         " sequence (0x0004,0x1220)");
-         /// \todo FIXME : what to do when the parsed file IS NOT a
+         /// \todo FIXME : what do we do when the parsed file IS NOT a
          ///       DICOMDIR file ?         
       }      
       CreateDicomDir();
@@ -417,20 +417,18 @@ void gdcmDicomDir::CreateDicomDirChainedList(std::string path)
                              it!=fileList.end(); 
                              ++it) 
    {
-      std::cout << "nom fichier " << it->c_str() << std::endl; //JPR
-
       progress=(float)(count+1)/(float)fileList.size();
       CallProgressMethod();
       if(abort)
           break;
 
-      header=new gdcmHeader(it->c_str());
+      header=new gdcmHeader(it->c_str(),false,true);
       if(!header) {
          std::cout << "echec new Header " << it->c_str() << std::endl; // JPR
       }
       if(header->IsReadable()) {
          list.push_back(header);  // adds the file header to the chained list
-         std::cout << "readable : " <<it->c_str() << std::endl;
+         std::cout << "readable : " <<it->c_str() << std::endl; // JPR
        }
       else
          delete header;
index 258dcff8644a1dc61e371b77775de89134a8d7ef..53bfa0052e18387c52600b7c5675076a8ed0e912 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/06/28 11:01:18 $
-  Version:   $Revision: 1.38 $
+  Date:      $Date: 2004/06/28 14:29:52 $
+  Version:   $Revision: 1.39 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -99,9 +99,9 @@ gdcmDocument::gdcmDocument(std::string const & inFilename,
                            bool enable_sequences,
                            bool ignore_shadow) 
               : gdcmElementSet(-1)   {
-   enableSequences=enable_sequences;
    IgnoreShadow   =ignore_shadow;
-   
+   //enableSequences=enable_sequences;
+   enableSequences=true; // JPR // TODO : remove params out of the constructor
    SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE); 
    Filename = inFilename;
    Initialise();
@@ -176,7 +176,7 @@ gdcmDocument::gdcmDocument(std::string const & inFilename,
 gdcmDocument::gdcmDocument(bool exception_on_error) 
              :gdcmElementSet(-1)    {
    (void)exception_on_error;
-   enableSequences=0;
+   //enableSequences=0; // ?!? JPR
 
    SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE);
    Initialise();
@@ -261,12 +261,14 @@ bool gdcmDocument::SetShaDict(DictKey dictName){
  *         false otherwise. 
  */
 bool gdcmDocument::IsReadable(void) { 
+
    if(Filetype==gdcmUnknown) {
-      //std::cout << " gdcmDocument::IsReadable: Filetype " << Filetype
-      //         << " " << "gdcmUnknown " << gdcmUnknown << std::endl; //JPR
+      std::cout << " gdcmDocument::IsReadable: Filetype " << Filetype
+               << " " << "gdcmUnknown " << gdcmUnknown << std::endl; //JPR
       dbg.Verbose(0, "gdcmDocument::IsReadable: wrong filetype");
       return false;
    }
+
    if(tagHT.empty()) { 
       dbg.Verbose(0, "gdcmDocument::IsReadable: no tags in internal"
                      " hash table.");
index 6e25ca5e6b2852cdf9122306d78bca2c4860b03a..7da9762c84d68a8024b9480470516594d28531dd 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/06/28 14:12:03 $
-  Version:   $Revision: 1.112 $
+  Date:      $Date: 2004/06/28 14:29:52 $
+  Version:   $Revision: 1.113 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -781,45 +781,25 @@ bool gdcmFile::WriteBase (std::string const & fileName, FileType type)
       Header->SetEntryByNumber(rows   ,  0x0028, 0x0011);
    }
    // ----------------- End of Special Patch ----------------
-   
-   /// \todo get the grPixel, numPixel values (for some ACR-NEMA images only)
-   
+      
    uint16_t grPixel  = Header->GetGrPixel();
    uint16_t numPixel = Header->GetNumPixel();;
-    
-   // Update Pixel Data Length
-   // the *last* of the (GrPixel, NumPixel), if many.
           
-   TagKey key = gdcmDictEntry::TranslateToKey(grPixel, numPixel); 
-   TagDocEntryHT::iterator p2;
    gdcmDocEntry* PixelElement;
-   
-   IterHT it = Header->GetEntry().equal_range(key); // get a pair of iterators first-last synonym   
 
-   if ( Header->GetEntry().count(key) == 1 ) // only the first is significant
-   {
-      p2 = it.first; // iterator on the first (unique) synonym
-   }
-   else
-   {
-      p2 = it.second;// iterator on the last synonym
-   }
-   
-   PixelElement = p2->second;        // H Table target column (2-nd col)
-  // PixelElement->SetPrintLevel(2);
-  // PixelElement->Print();      
+   PixelElement = GetHeader()->GetDocEntryByNumber(grPixel, numPixel);  
  
    if ( PixelRead == 1 )
    {
+      // we read pixel 'as is' (no tranformation LUT -> RGB)
       PixelElement->SetLength( ImageDataSizeRaw );
    }
    else if ( PixelRead == 0 )
    {
+      // we tranformed GrayLevel pixels + LUT into RGB Pixel
       PixelElement->SetLength( ImageDataSize );
    }
-   
-   //PixelElement->SetPrintLevel(2);
-   //PixelElement->Print();    
    Header->Write(fp1, type);
 
    // --------------------------------------------------------------
index 7fdcda0b516b7aa55cf2a328e2569340c4715ea1..40ff3bfb3247f667c90974c667fcc99155a0259f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/06/28 11:01:18 $
-  Version:   $Revision: 1.172 $
+  Date:      $Date: 2004/06/28 14:29:52 $
+  Version:   $Revision: 1.173 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -119,7 +119,7 @@ void gdcmHeader::Write(FILE* fp,FileType filetype) {
    // Drop Palette Color, if necessary
    
    if ( GetEntryByNumber(0x0028,0x0002).c_str()[0] == '3' ) {
-    
+    // if SamplesPerPixel = 3, sure we don't need any LUT !   
     // Drop 0028|1101, 0028|1102, 0028|1103
     // Drop 0028|1201, 0028|1202, 0028|1203
 
@@ -164,7 +164,6 @@ void gdcmHeader::Write(FILE* fp,FileType filetype) {
  */
 bool gdcmHeader::IsReadable() {
    if(!gdcmDocument::IsReadable()) {
-      //std::cout << "doc non Readable " << std::endl; //JPR
       return false;
    }
    std::string res = GetEntryByNumber(0x0028, 0x0005);