]> Creatis software - gdcm.git/blob - src/gdcmTS.h
* Remove compilation warnings
[gdcm.git] / src / gdcmTS.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmTS.h,v $
5   Language:  C++
6   Date:      $Date: 2005/10/26 08:04:16 $
7   Version:   $Revision: 1.23 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18
19 #ifndef GDCMTS_H
20 #define GDCMTS_H
21
22 #include "gdcmRefCounter.h"
23
24 #include <map>
25 #include <string>
26 #include <iostream>
27
28 namespace gdcm 
29 {
30 //-----------------------------------------------------------------------------
31 typedef std::string TSKey;
32 typedef std::string TSAtr;
33 typedef std::map<TSKey, TSAtr> TSHT;    // Transfer Syntax Hash Table
34
35
36 //-----------------------------------------------------------------------------
37 /**
38  * \brief Container for dicom 'Transfer Syntax' Hash Table
39  * \note   This is a singleton
40  */
41 class GDCM_EXPORT TS : public RefCounter
42 {
43    gdcmTypeMacro(TS);
44
45 public:
46    enum SpecialType {
47    ImplicitVRLittleEndian = 0,
48    ImplicitVRBigEndianPrivateGE,
49    ExplicitVRLittleEndian,
50    DeflatedExplicitVRLittleEndian,
51    ExplicitVRBigEndian,
52    JPEGBaselineProcess1,
53    JPEGExtendedProcess2_4,
54    JPEGExtendedProcess3_5,
55    JPEGSpectralSelectionProcess6_8,
56    JPEGFullProgressionProcess10_12,
57    JPEGLosslessProcess14,
58    JPEGLosslessProcess14_1,
59    JPEGLSLossless,
60    JPEGLSNearLossless,
61    JPEG2000Lossless,  
62    JPEG2000,
63    RLELossless,
64    MPEG2MainProfile,  
65    UnknownTS
66    };
67
68 public:
69    static TS *New() {return new TS();}
70
71    virtual void Print(std::ostream &os = std::cout, 
72                       std::string const &indent = "" );
73
74    int Count(TSKey const &key);
75    TSAtr const &GetValue(TSKey const &key);
76    bool IsTransferSyntax(TSKey const &key);
77    bool IsRLELossless(TSKey const &key);
78    bool IsJPEGLossless(TSKey const&key);
79    bool IsJPEGLossy(TSKey const&key);
80    bool IsJPEG2000(TSKey const &key);
81    bool IsJPEG(TSKey const &key);
82    bool IsJPEGLS(TSKey const &key);
83    bool IsMPEG(TSKey const &key);
84
85    // This should be deprecated very soon
86    SpecialType GetSpecialTransferSyntax(TSKey const &key);
87    const char* GetSpecialTransferSyntax(SpecialType t);
88
89 protected:
90    TS();
91    ~TS();
92
93 private:
94    TSHT TsMap;
95 };
96 } // end namespace gdcm
97
98 //-----------------------------------------------------------------------------
99 #endif