]> Creatis software - gdcm.git/commitdiff
ENH: Untangle the transfer syntax from the Document. The Document can only read a...
authormalaterre <malaterre>
Tue, 11 Jan 2005 16:44:42 +0000 (16:44 +0000)
committermalaterre <malaterre>
Tue, 11 Jan 2005 16:44:42 +0000 (16:44 +0000)
Testing/TestTS.cxx
src/gdcmDocument.cxx
src/gdcmDocument.h
src/gdcmFile.cxx
src/gdcmPixelReadConvert.cxx
src/gdcmTS.cxx
src/gdcmTS.h

index ec79fa6bfb8c05eabd7328a9191f1ef1ca2998db..b2f57f82405f3e78ed0befd398e198fbeeb8d666 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestTS.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/11 14:39:03 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2005/01/11 16:44:42 $
+  Version:   $Revision: 1.6 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -56,5 +56,18 @@ int TestTS(int , char *[])
    // Unknown
    std::cout << ts.IsTransferSyntax( "Unknown Transfer Syntax" ) << std::endl;
 
+   // Test JPEG test:
+   std::cout << "Test TS:" << std::endl;
+   std::cout << ts.IsJPEGLossless( "1.2.840.10008.1.2.4.55") << std::endl;
+//if ( key == "1.2.840.10008.1.2.4.55"
+//        || key == "1.2.840.10008.1.2.4.57"
+//        || key == "1.2.840.10008.1.2.4.70" )
+   std::cout << ts.IsRLELossless( "1.2.840.10008.1.2.5") << std::endl;
+   std::cout << ts.IsJPEGLossless( "1.2.840.10008.1.2.5") << std::endl;
+   std::cout << ts.IsJPEG2000( "1.2.840.10008.1.2.5") << std::endl;
+   std::cout << ts.IsJPEG( "1.2.840.10008.1.2.5") << std::endl;
+   std::cout << ts.IsEncapsulate( "1.2.840.10008.1.2.5") << std::endl;
+   std::cout << ts.GetSpecialTransferSyntax( ts.GetSpecialTransferSyntax( "1.2.840.10008.1.2.5")) << std::endl;
+
    return ts.GetValue( "" ) != gdcm::GDCM_UNFOUND;
 }
index 2bb417caf6d661b48c81fee68038ecf4138f3326..f4b47a1e032e6fc28959a931ccd9b4a7d4ddc98d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/11 11:37:13 $
-  Version:   $Revision: 1.173 $
+  Date:      $Date: 2005/01/11 16:44:43 $
+  Version:   $Revision: 1.174 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 namespace gdcm 
 {
-//-----------------------------------------------------------------------------
-static const char *TransferSyntaxStrings[] =  {
-  // Implicit VR Little Endian
-  "1.2.840.10008.1.2",
-  // Implicit VR Big Endian DLX (G.E Private)
-  "1.2.840.113619.5.2",
-  // Explicit VR Little Endian
-  "1.2.840.10008.1.2.1",
-  // Deflated Explicit VR Little Endian
-  "1.2.840.10008.1.2.1.99",
-  // Explicit VR Big Endian
-  "1.2.840.10008.1.2.2",
-  // JPEG Baseline (Process 1)
-  "1.2.840.10008.1.2.4.50",
-  // JPEG Extended (Process 2 & 4)
-  "1.2.840.10008.1.2.4.51",
-  // JPEG Extended (Process 3 & 5)
-  "1.2.840.10008.1.2.4.52",
-  // JPEG Spectral Selection, Non-Hierarchical (Process 6 & 8)
-  "1.2.840.10008.1.2.4.53",
-  // JPEG Full Progression, Non-Hierarchical (Process 10 & 12)
-  "1.2.840.10008.1.2.4.55",
-  // JPEG Lossless, Non-Hierarchical (Process 14)
-  "1.2.840.10008.1.2.4.57",
-  // JPEG Lossless, Hierarchical, First-Order Prediction (Process 14, [Selection Value 1])
-  "1.2.840.10008.1.2.4.70",
-  // JPEG 2000 Lossless
-  "1.2.840.10008.1.2.4.90",
-  // JPEG 2000
-  "1.2.840.10008.1.2.4.91",
-  // RLE Lossless
-  "1.2.840.10008.1.2.5",
-  // Unknown
-  "Unknown Transfer Syntax"
-};
 
 //-----------------------------------------------------------------------------
 // Refer to Document::CheckSwap()
@@ -304,12 +269,12 @@ bool Document::IsReadable()
  *          value from disk when only parsing occured).
  * @return  The encountered Transfer Syntax of the current document.
  */
-TransferSyntaxType Document::GetTransferSyntax()
+std::string Document::GetTransferSyntax()
 {
    DocEntry *entry = GetDocEntry(0x0002, 0x0010);
    if ( !entry )
    {
-      return UnknownTS;
+      return GDCM_UNKNOWN;
    }
 
    // The entry might be present but not loaded (parsing and loading
@@ -324,68 +289,15 @@ TransferSyntaxType Document::GetTransferSyntax()
       if  ( transfer.length() == 0 )
       {
          // for brain damaged headers
-         return UnknownTS;
+         return GDCM_UNKNOWN;
       }
       while ( !isdigit((unsigned char)transfer[transfer.length()-1]) )
       {
          transfer.erase(transfer.length()-1, 1);
       }
-      for (int i = 0; TransferSyntaxStrings[i] != NULL; i++)
-      {
-         if ( TransferSyntaxStrings[i] == transfer )
-         {
-            return TransferSyntaxType(i);
-         }
-      }
+      return transfer;
    }
-   return UnknownTS;
-}
-
-bool Document::IsJPEGLossless()
-{
-   TransferSyntaxType r = GetTransferSyntax();
-   return    r ==  JPEGFullProgressionProcess10_12
-          || r == JPEGLosslessProcess14
-          || r == JPEGLosslessProcess14_1;
-}
-                                                                                
-/**
- * \brief   Determines if the Transfer Syntax was already encountered
- *          and if it corresponds to a JPEG2000 one
- * @return  True when JPEG2000 (Lossly or LossLess) found. False in all
- *          other cases.
- */
-bool Document::IsJPEG2000()
-{
-   TransferSyntaxType r = GetTransferSyntax();
-   return r == JPEG2000Lossless || r == JPEG2000;
-}
-
-/**
- * \brief   Determines if the Transfer Syntax corresponds to any form
- *          of Jpeg encoded Pixel data.
- * @return  True when any form of JPEG found. False otherwise.
- */
-bool Document::IsJPEG()
-{
-   TransferSyntaxType r = GetTransferSyntax();
-   return r == JPEGBaselineProcess1 
-     || r == JPEGExtendedProcess2_4
-     || r == JPEGExtendedProcess3_5
-     || r == JPEGSpectralSelectionProcess6_8
-     ||      IsJPEGLossless()
-     ||      IsJPEG2000();
-}
-
-/**
- * \brief   Determines if the Transfer Syntax corresponds to encapsulated
- *          of encoded Pixel Data (as opposed to native).
- * @return  True when encapsulated. False when native.
- */
-bool Document::IsEncapsulate()
-{
-   TransferSyntaxType r = GetTransferSyntax();
-   return IsJPEG() || r == RLELossless;
+   return GDCM_UNKNOWN;
 }
 
 /**
@@ -739,11 +651,6 @@ bool Document::ReplaceIfExist(std::string const &value,
    return true;
 } 
 
-std::string Document::GetTransferSyntaxValue(TransferSyntaxType type)
-{
-   return TransferSyntaxStrings[type];
-}
-
 //-----------------------------------------------------------------------------
 // Protected
 
@@ -1273,15 +1180,15 @@ void Document::ParseDES(DocEntrySet *set, long offset,
          if (    ( newDocEntry->GetGroup()   == 0x7fe0 )
               && ( newDocEntry->GetElement() == 0x0010 ) )
          {
-             TransferSyntaxType ts = GetTransferSyntax();
-             if ( ts == RLELossless ) 
+             std::string ts = GetTransferSyntax();
+             if ( Global::GetTS()->IsRLELossless(ts) ) 
              {
                 long positionOnEntry = Fp->tellg();
                 Fp->seekg( newDocEntry->GetOffset(), std::ios::beg );
                 ComputeRLEInfo();
                 Fp->seekg( positionOnEntry, std::ios::beg );
              }
-             else if ( IsJPEG() )
+             else if ( Global::GetTS()->IsJPEG(ts) )
              {
                 long positionOnEntry = Fp->tellg();
                 Fp->seekg( newDocEntry->GetOffset(), std::ios::beg );
@@ -1669,8 +1576,8 @@ void Document::FindDocEntryLength( DocEntry *entry )
       // big endian and proceed...
       if ( element  == 0x0000 && length16 == 0x0400 ) 
       {
-         TransferSyntaxType ts = GetTransferSyntax();
-         if ( ts != ExplicitVRBigEndian ) 
+         std::string ts = GetTransferSyntax();
+         if ( Global::GetTS()->GetSpecialTransferSyntax(ts) != TS::ExplicitVRBigEndian ) 
          {
             throw FormatError( "Document::FindDocEntryLength()",
                                " not explicit VR." );
@@ -2714,8 +2621,8 @@ void Document::ReadAndSkipEncapsulatedBasicOffsetTable()
  */
 void Document::ComputeRLEInfo()
 {
-   TransferSyntaxType ts = GetTransferSyntax();
-   if ( ts != RLELossless )
+   std::string ts = GetTransferSyntax();
+   if ( Global::GetTS()->IsRLELossless(ts) ) 
    {
       return;
    }
@@ -2812,7 +2719,8 @@ void Document::ComputeRLEInfo()
 void Document::ComputeJPEGFragmentInfo()
 {
    // If you need to, look for comments of ComputeRLEInfo().
-   if ( ! IsJPEG() )
+   std::string ts = GetTransferSyntax();
+   if ( ! Global::GetTS()->IsJPEG(ts) )
    {
       return;
    }
index d237d0d24c1047311c73236750662cb2eb4226e5..aee3aaa188722a801d1e7547c4a573a4c9d23a8a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/11 11:37:13 $
-  Version:   $Revision: 1.79 $
+  Date:      $Date: 2005/01/11 16:44:43 $
+  Version:   $Revision: 1.80 $
  
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -36,25 +36,6 @@ class Dict;
 class RLEFramesInfo;
 class JPEGFragmentsInfo;
 
-enum TransferSyntaxType {
-  ImplicitVRLittleEndian = 0,
-  ImplicitVRLittleEndianDLXGE,
-  ExplicitVRLittleEndian,
-  DeflatedExplicitVRLittleEndian,
-  ExplicitVRBigEndian,
-  JPEGBaselineProcess1,
-  JPEGExtendedProcess2_4,
-  JPEGExtendedProcess3_5,
-  JPEGSpectralSelectionProcess6_8,
-  JPEGFullProgressionProcess10_12,
-  JPEGLosslessProcess14,
-  JPEGLosslessProcess14_1,
-  JPEG2000Lossless,
-  JPEG2000,
-  RLELossless,
-  UnknownTS
-};
-
 //-----------------------------------------------------------------------------
 /**
  * \brief Derived by both Header and DicomDir
@@ -66,12 +47,8 @@ public:
    virtual bool IsReadable();
    FileType GetFileType();
 
-   TransferSyntaxType GetTransferSyntax();
+   std::string GetTransferSyntax();
 
-   bool IsJPEGLossless();
-   bool IsJPEG2000();
-   bool IsJPEG();
-   bool IsEncapsulate();
    bool IsDicomV3();
 
    RLEFramesInfo *GetRLEInfo() { return RLEInfo; }
@@ -145,9 +122,6 @@ public:
    void LoadDocEntrySafe(DocEntry *entry);
    TagDocEntryHT *BuildFlatHashTable();
       
-// Divers
-   static std::string GetTransferSyntaxValue(TransferSyntaxType type);
-
 protected:
 // Methods
    // Constructor and destructor are protected to forbid end user 
index c6638963c2eb66e21c57280699165230af740886..11ec7fe6e6071545ed107b4987909d2549d382e9 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/11 11:37:13 $
-  Version:   $Revision: 1.189 $
+  Date:      $Date: 2005/01/11 16:44:43 $
+  Version:   $Revision: 1.190 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -17,6 +17,8 @@
 =========================================================================*/
 
 #include "gdcmFile.h"
+#include "gdcmGlobal.h"
+#include "gdcmTS.h"
 #include "gdcmDocument.h"
 #include "gdcmDebug.h"
 #include "gdcmUtil.h"
@@ -777,7 +779,7 @@ void File::SetWriteFileTypeToACR()
 void File::SetWriteFileTypeToExplicitVR()
 {
    std::string ts = Util::DicomString( 
-      Document::GetTransferSyntaxValue(ExplicitVRLittleEndian).c_str() );
+      Global::GetTS()->GetSpecialTransferSyntax(TS::ExplicitVRLittleEndian) );
 
    ValEntry *tss = CopyValEntry(0x0002,0x0010);
    tss->SetValue(ts);
@@ -788,7 +790,7 @@ void File::SetWriteFileTypeToExplicitVR()
 void File::SetWriteFileTypeToImplicitVR()
 {
    std::string ts = Util::DicomString(
-      Document::GetTransferSyntaxValue(ImplicitVRLittleEndian).c_str() );
+      Global::GetTS()->GetSpecialTransferSyntax(TS::ImplicitVRLittleEndian) );
 
    ValEntry *tss = CopyValEntry(0x0002,0x0010);
    tss->SetValue(ts);
index 31ebbc479f3abb10d2f90dd3a1d68f87723be6e7..17c28603bcf67a5bc08cd0586ef5704cab7defb5 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelReadConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/08 15:03:59 $
-  Version:   $Revision: 1.20 $
+  Date:      $Date: 2005/01/11 16:44:43 $
+  Version:   $Revision: 1.21 $
                                                                                 
   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"
@@ -1035,17 +1037,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();
index af3bf7b0417e718bc9e41fe98bbd8ce46f14eee8..f0f2049c98b396da2975088157dc1df339c6db42 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmTS.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/11 00:37:41 $
-  Version:   $Revision: 1.34 $
+  Date:      $Date: 2005/01/11 16:44:43 $
+  Version:   $Revision: 1.35 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 namespace gdcm 
 {
+//-----------------------------------------------------------------------------
+static const char *SpecialStrings[] =  {
+  // Implicit VR Little Endian
+  "1.2.840.10008.1.2",
+  // Implicit VR Big Endian DLX (G.E Private)
+  "1.2.840.113619.5.2",
+  // Explicit VR Little Endian
+  "1.2.840.10008.1.2.1",
+  // Deflated Explicit VR Little Endian
+  "1.2.840.10008.1.2.1.99",
+  // Explicit VR Big Endian
+  "1.2.840.10008.1.2.2",
+  // JPEG Baseline (Process 1)
+  "1.2.840.10008.1.2.4.50",
+  // JPEG Extended (Process 2 & 4)
+  "1.2.840.10008.1.2.4.51",
+  // JPEG Extended (Process 3 & 5)
+  "1.2.840.10008.1.2.4.52",
+  // JPEG Spectral Selection, Non-Hierarchical (Process 6 & 8)
+  "1.2.840.10008.1.2.4.53",
+  // JPEG Full Progression, Non-Hierarchical (Process 10 & 12)
+  "1.2.840.10008.1.2.4.55",
+  // JPEG Lossless, Non-Hierarchical (Process 14)
+  "1.2.840.10008.1.2.4.57",
+  // JPEG Lossless, Hierarchical, First-Order Prediction (Process 14, [Selection Value 1])
+  "1.2.840.10008.1.2.4.70",
+  // JPEG 2000 Lossless
+  "1.2.840.10008.1.2.4.90",
+  // JPEG 2000
+  "1.2.840.10008.1.2.4.91",
+  // RLE Lossless
+  "1.2.840.10008.1.2.5",
+  // Unknown
+  "Unknown Transfer Syntax"
+};
+
 void FillDefaultTSDict(TSHT &ts);
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
@@ -49,13 +85,13 @@ TS::TS()
    {
       TSKey key;
       TSAtr name;
-   
+
       while (!from.eof())
       {
          from >> key;
          from >> std::ws;
          std::getline(from, name);
-   
+
          if(key != "")
          {
             TsMap[key] = name;
@@ -108,12 +144,121 @@ TSAtr const & TS::GetValue(TSKey const &key)
 
 bool TS::IsTransferSyntax(TSKey const &key)
 {
-   for (TSHT::const_iterator it = TsMap.begin(); it != TsMap.end(); ++it)
+   TSHT::const_iterator it = TsMap.find(key);
+   return it != TsMap.end();
+}
+
+bool TS::IsRLELossless(TSKey const &key)
+{
+   bool r = false;
+   // First check this is an actual transfer syntax
+   if( IsTransferSyntax(key) )
+   {
+      if ( key == SpecialStrings[RLELossless] )
+      {
+         r = true;
+      }
+   }
+   return r;
+}
+
+bool TS::IsJPEGLossless(TSKey const &key)
+{
+   bool r = false;
+   // First check this is an actual transfer syntax
+   if( IsTransferSyntax(key) )
+   {
+      if ( key == SpecialStrings[JPEGFullProgressionProcess10_12]
+        || key == SpecialStrings[JPEGLosslessProcess14]
+        || key == SpecialStrings[JPEGLosslessProcess14_1] )
+      {
+         r = true;
+      }
+   }
+   return r;
+}
+
+/**
+ * \brief   Determines if the Transfer Syntax was already encountered
+ *          and if it corresponds to a JPEG2000 one
+ * @return  True when JPEG2000 (Lossly or LossLess) found. False in all
+ *          other cases.
+ */
+bool TS::IsJPEG2000(TSKey const &key)
+{
+   bool r = false;
+   // First check this is an actual transfer syntax
+   if( IsTransferSyntax(key) )
    {
-      if( it->first == key ) return true;
+      if ( key == SpecialStrings[JPEG2000Lossless]
+        || key == SpecialStrings[JPEG2000] )
+      {
+         r = true;
+      }
    }
+   return r;
+}
 
-  return false;
+/**
+ * \brief   Determines if the Transfer Syntax corresponds to any form
+ *          of Jpeg encoded Pixel data.
+ * @return  True when any form of JPEG found. False otherwise.
+ */
+bool TS::IsJPEG(TSKey const &key)
+{
+   bool r = false;
+   // First check this is an actual transfer syntax
+   if( IsTransferSyntax(key) )
+   {
+      if ( key == SpecialStrings[JPEGBaselineProcess1]
+        || key == SpecialStrings[JPEGExtendedProcess2_4]
+        || key == SpecialStrings[JPEGExtendedProcess3_5]
+        || key == SpecialStrings[JPEGSpectralSelectionProcess6_8]
+        || IsJPEGLossless( key ) 
+        || IsJPEG2000( key ) )
+      {
+         r = true;
+      }
+   }
+   return r;
+}
+
+/**
+ * \brief   Determines if the Transfer Syntax corresponds to encapsulated
+ *          of encoded Pixel Data (as opposed to native).
+ * @return  True when encapsulated. False when native.
+ */
+bool TS::IsEncapsulate(TSKey const &key)
+{
+   bool r = false;
+   // First check this is an actual transfer syntax
+   if( IsTransferSyntax(key) )
+   {
+      if ( key == SpecialStrings[RLELossless]
+        || IsJPEG(key) )
+      {
+         r = true;
+      }
+   }
+   return r;
+}
+
+TS::SpecialType TS::GetSpecialTransferSyntax(TSKey const &key)
+{
+   for (int i = 0; SpecialStrings[i] != NULL; i++)
+   {
+      if ( SpecialStrings[i] == key )
+      {
+         return SpecialType(i);
+      }
+   }
+
+   return UnknownTS;
+}
+
+const char* TS::GetSpecialTransferSyntax(SpecialType t)
+{
+   return SpecialStrings[t];
 }
 
 //-----------------------------------------------------------------------------
index e1fa5502982c745a89b05e6e038f6769a87b615f..4b6ddc501896e57907b059beedb4d8aa29baf73d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmTS.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/11 15:15:38 $
-  Version:   $Revision: 1.16 $
+  Date:      $Date: 2005/01/11 16:44:43 $
+  Version:   $Revision: 1.17 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -32,6 +32,7 @@ typedef std::string TSKey;
 typedef std::string TSAtr;
 typedef std::map<TSKey, TSAtr> TSHT;    // Transfer Syntax Hash Table
 
+
 //-----------------------------------------------------------------------------
 /**
  * \brief Container for dicom 'Transfer Syntax' Hash Table
@@ -39,6 +40,26 @@ typedef std::map<TSKey, TSAtr> TSHT;    // Transfer Syntax Hash Table
  */
 class GDCM_EXPORT TS
 {
+public:
+enum SpecialType {
+  ImplicitVRLittleEndian = 0,
+  ImplicitVRLittleEndianDLXGE,
+  ExplicitVRLittleEndian,
+  DeflatedExplicitVRLittleEndian,
+  ExplicitVRBigEndian,
+  JPEGBaselineProcess1,
+  JPEGExtendedProcess2_4,
+  JPEGExtendedProcess3_5,
+  JPEGSpectralSelectionProcess6_8,
+  JPEGFullProgressionProcess10_12,
+  JPEGLosslessProcess14,
+  JPEGLosslessProcess14_1,
+  JPEG2000Lossless,
+  JPEG2000,
+  RLELossless,
+  UnknownTS
+};
+
 public:
    TS();
    ~TS();
@@ -48,6 +69,15 @@ public:
    int Count(TSKey const &key);
    TSAtr const &GetValue(TSKey const &key);
    bool IsTransferSyntax(TSKey const &key);
+   bool IsRLELossless(TSKey const &key);
+   bool IsJPEGLossless(TSKey const&key);
+   bool IsJPEG2000(TSKey const &key);
+   bool IsJPEG(TSKey const &key);
+   bool IsEncapsulate(TSKey const &key);
+
+   // This should be deprecated very soon
+   SpecialType GetSpecialTransferSyntax(TSKey const &key);
+   const char* GetSpecialTransferSyntax(SpecialType t);
 
 private:
    TSHT TsMap;