]> Creatis software - gdcm.git/blobdiff - src/gdcmPixelReadConvert.cxx
ENH: Since HandleOutOfGroup0002 need access to the transfer syntax move the method...
[gdcm.git] / src / gdcmPixelReadConvert.cxx
index febf2d12de143560228ce79e048bc3f1773528af..016d552c2b5b622e86f9e107f5fd23b2d7da313e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelReadConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/07 22:19:48 $
-  Version:   $Revision: 1.19 $
+  Date:      $Date: 2005/01/11 22:40:32 $
+  Version:   $Revision: 1.22 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -24,6 +24,8 @@
 
 #include "gdcmDebug.h"
 #include "gdcmHeader.h"
+#include "gdcmGlobal.h"
+#include "gdcmTS.h"
 #include "gdcmPixelReadConvert.h"
 #include "gdcmDocEntry.h"
 #include "gdcmRLEFramesInfo.h"
@@ -317,11 +319,8 @@ void PixelReadConvert::ConvertSwapZone()
       uint16_t *im16 = (uint16_t*)Raw;
       switch( SwapCode )
       {
-         case 0:
-         case 12:
          case 1234:
             break;
-         case 21:
          case 3412:
          case 2143:
          case 4321:
@@ -342,7 +341,6 @@ void PixelReadConvert::ConvertSwapZone()
       uint32_t* im32 = (uint32_t*)Raw;
       switch ( SwapCode )
       {
-         case 0:
          case 1234:
             break;
          case 4321:
@@ -1035,17 +1033,17 @@ void PixelReadConvert::GrabInformationsFromHeader( Header *header )
    PixelSize = header->GetPixelSize();
    PixelSign = header->IsSignedPixelData();
    SwapCode  = header->GetSwapCode();
-   TransferSyntaxType ts = header->GetTransferSyntax();
+   std::string ts = header->GetTransferSyntax();
    IsRaw =
         ( ! header->IsDicomV3() )
-     || ts == ImplicitVRLittleEndian
-     || ts == ImplicitVRLittleEndianDLXGE
-     || ts == ExplicitVRLittleEndian
-     || ts == ExplicitVRBigEndian
-     || ts == DeflatedExplicitVRLittleEndian;
-   IsJPEG2000     = header->IsJPEG2000();
-   IsJPEGLossless = header->IsJPEGLossless();
-   IsRLELossless  =  ( ts == RLELossless );
+     || Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::ImplicitVRLittleEndian
+     || Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::ImplicitVRLittleEndianDLXGE
+     || Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::ExplicitVRLittleEndian
+     || Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::ExplicitVRBigEndian
+     || Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::DeflatedExplicitVRLittleEndian;
+   IsJPEG2000     = Global::GetTS()->IsJPEG2000(ts);
+   IsJPEGLossless = Global::GetTS()->IsJPEGLossless(ts);
+   IsRLELossless  =  Global::GetTS()->IsRLELossless(ts);
    PixelOffset     = header->GetPixelOffset();
    PixelDataLength = header->GetPixelAreaLength();
    RLEInfo  = header->GetRLEInfo();
@@ -1062,9 +1060,9 @@ void PixelReadConvert::GrabInformationsFromHeader( Header *header )
    if ( HasLUT )
    {
       // Just in case some access to a Header element requires disk access.
-      LutRedDescriptor   = header->GetEntryByNumber( 0x0028, 0x1101 );
-      LutGreenDescriptor = header->GetEntryByNumber( 0x0028, 0x1102 );
-      LutBlueDescriptor  = header->GetEntryByNumber( 0x0028, 0x1103 );
+      LutRedDescriptor   = header->GetEntry( 0x0028, 0x1101 );
+      LutGreenDescriptor = header->GetEntry( 0x0028, 0x1102 );
+      LutBlueDescriptor  = header->GetEntry( 0x0028, 0x1103 );
    
       // Depending on the value of Document::MAX_SIZE_LOAD_ELEMENT_VALUE
       // [ refer to invocation of Document::SetMaxSizeLoadEntry() in
@@ -1082,7 +1080,7 @@ void PixelReadConvert::GrabInformationsFromHeader( Header *header )
    
       ////// Red round
       header->LoadEntryBinArea(0x0028, 0x1201);
-      LutRedData = (uint8_t*)header->GetEntryBinAreaByNumber( 0x0028, 0x1201 );
+      LutRedData = (uint8_t*)header->GetEntryBinArea( 0x0028, 0x1201 );
       if ( ! LutRedData )
       {
          gdcmVerboseMacro( "Unable to read red LUT data" );
@@ -1090,7 +1088,7 @@ void PixelReadConvert::GrabInformationsFromHeader( Header *header )
 
       ////// Green round:
       header->LoadEntryBinArea(0x0028, 0x1202);
-      LutGreenData = (uint8_t*)header->GetEntryBinAreaByNumber(0x0028, 0x1202 );
+      LutGreenData = (uint8_t*)header->GetEntryBinArea(0x0028, 0x1202 );
       if ( ! LutGreenData)
       {
          gdcmVerboseMacro( "Unable to read green LUT data" );
@@ -1098,7 +1096,7 @@ void PixelReadConvert::GrabInformationsFromHeader( Header *header )
 
       ////// Blue round:
       header->LoadEntryBinArea(0x0028, 0x1203);
-      LutBlueData = (uint8_t*)header->GetEntryBinAreaByNumber( 0x0028, 0x1203 );
+      LutBlueData = (uint8_t*)header->GetEntryBinArea( 0x0028, 0x1203 );
       if ( ! LutBlueData )
       {
          gdcmVerboseMacro( "Unable to read blue LUT data" );