]> Creatis software - gdcm.git/commitdiff
* src/gdcmPixelWriteConvert.[h|cxx] : ficnished this class
authorregrain <regrain>
Tue, 7 Dec 2004 09:32:23 +0000 (09:32 +0000)
committerregrain <regrain>
Tue, 7 Dec 2004 09:32:23 +0000 (09:32 +0000)
   * src/gdcmFile.cxx : finished the correctly use of PixelWriteConvert
   -- BeNours

ChangeLog
src/gdcmDicomDirObject.cxx
src/gdcmFile.cxx
src/gdcmPixelWriteConvert.cxx
src/gdcmPixelWriteConvert.h

index 5e1419d5efb30fe96e331b543d65c43d6dc621fb..75dfeb08b0561456eaa038306c1388d6f8ed1901 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-12-07 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+   * src/gdcmPixelWriteConvert.[h|cxx] : ficnished this class
+   * src/gdcmFile.cxx : finished the correctly use of PixelWriteConvert
+
 2004-12-06 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
    * src/gdcmDocument.cxx : bug fix when opening the file. All read is followed
      by an eof to prevent all bad read of the file... and in this case, the
index 11dfd84c78ce3bccdffc9d89847597793f436674..db99f950748ebbd65bd6ef302104b0ece52ea7de 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirObject.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/12/06 11:37:38 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2004/12/07 09:32:24 $
+  Version:   $Revision: 1.11 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -120,7 +120,7 @@ void DicomDirObject::FillObject(ListDicomDirMetaElem const & elemList)
       else
       {
          entry->SetLength(entry->GetValue().length()); 
-      }                                
+      }
       AddEntry(entry);
    }   
 }   
index c7f72f23ee4e4ba4f4f422874feabce4a27ab43f..3de485f7c2057e172f551cbfa691f022e85f109f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/12/03 20:16:58 $
-  Version:   $Revision: 1.171 $
+  Date:      $Date: 2004/12/07 09:32:24 $
+  Version:   $Revision: 1.172 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -540,18 +540,13 @@ void File::SetWriteToDecompressed()
          photInt->SetLength(12);
       }
 
+      PixelWriteConverter->SetReadData(PixelReadConverter->GetDecompressed(),
+                                       PixelReadConverter->GetDecompressedSize());
+
       BinEntry* pixel = CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
       pixel->SetValue(GDCM_BINLOADED);
-      if(PixelWriteConverter->GetUserData())
-      {
-         pixel->SetBinArea(PixelWriteConverter->GetUserData(),false);
-         pixel->SetLength(PixelWriteConverter->GetUserDataSize());
-      }
-      else
-      {
-         pixel->SetBinArea(PixelReadConverter->GetDecompressed(),false);
-         pixel->SetLength(PixelReadConverter->GetDecompressedSize());
-      }
+      pixel->SetBinArea(PixelWriteConverter->GetData(),false);
+      pixel->SetLength(PixelWriteConverter->GetDataSize());
 
       Archive->Push(photInt);
       Archive->Push(pixel);
@@ -576,24 +571,22 @@ void File::SetWriteToRGB()
       photInt->SetValue("RGB ");
       photInt->SetLength(4);
 
-      BinEntry* pixel = CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
-      pixel->SetValue(GDCM_BINLOADED);
-      if(PixelWriteConverter->GetUserData())
-      {
-         pixel->SetBinArea(PixelWriteConverter->GetUserData(),false);
-         pixel->SetLength(PixelWriteConverter->GetUserDataSize());
-      }
-      else if(PixelReadConverter->GetRGB())
+      if(PixelReadConverter->GetRGB())
       {
-         pixel->SetBinArea(PixelReadConverter->GetRGB(),false);
-         pixel->SetLength(PixelReadConverter->GetRGBSize());
+         PixelWriteConverter->SetReadData(PixelReadConverter->GetRGB(),
+                                          PixelReadConverter->GetRGBSize());
       }
       else // Decompressed data
       {
-         pixel->SetBinArea(PixelReadConverter->GetDecompressed(),false);
-         pixel->SetLength(PixelReadConverter->GetDecompressedSize());
+         PixelWriteConverter->SetReadData(PixelReadConverter->GetDecompressed(),
+                                          PixelReadConverter->GetDecompressedSize());
       }
 
+      BinEntry* pixel = CopyBinEntry(GetHeader()->GetGrPixel(),GetHeader()->GetNumPixel());
+      pixel->SetValue(GDCM_BINLOADED);
+      pixel->SetBinArea(PixelWriteConverter->GetData(),false);
+      pixel->SetLength(PixelWriteConverter->GetDataSize());
+
       Archive->Push(spp);
       Archive->Push(planConfig);
       Archive->Push(photInt);
index a4f8cec9072a94114db333ec351f4976b0b2a17e..d0f9e243331add60f46025d686b08c4db44414af 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelWriteConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/12/03 11:55:38 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2004/12/07 09:32:24 $
+  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
@@ -57,15 +57,29 @@ void PixelWriteConvert::SetUserData(uint8_t* data,size_t size)
    UserDataSize = size;
 }
 
+uint8_t* PixelWriteConvert::GetData()
+{
+   if(UserData)
+   {
+      return UserData;
+   }
+   else
+   {
+      return ReadData;
+   }
+}
+
+size_t PixelWriteConvert::GetDataSize()
+{
+   if(UserData)
+   {
+      return UserDataSize;
+   }
+   else
+   {
+      return ReadDataSize;
+   }
+}
+
 //-----------------------------------------------------------------------------
 } // end namespace gdcm
-
-// NOTES on File internal calls
-// User
-// ---> GetImageData
-//     ---> GetImageDataIntoVector
-//        |---> GetImageDataIntoVectorRaw
-//        | lut intervention
-// User
-// ---> GetImageDataRaw
-//     ---> GetImageDataIntoVectorRaw
index 3568b2518fcda248fa41e68be291abbbe4da88b4..6f070e5587f0cdaf9511119f2437bf0cd1bf67a8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelWriteConvert.h,v $
   Language:  C++
-  Date:      $Date: 2004/12/03 11:55:38 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2004/12/07 09:32:24 $
+  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
@@ -43,6 +43,10 @@ public:
    uint8_t* GetUserData() { return UserData; }
    size_t   GetUserDataSize() { return UserDataSize; }
 
+   // Get the used image and its size
+   uint8_t* GetData();
+   size_t   GetDataSize();
+
 private:
 // Variables
    /// Pixel data represented as RGB after LUT color interpretation.