]> Creatis software - gdcm.git/blob - src/gdcmTS.h
* Some classes inherit now from gdcm::RefCounter
[gdcm.git] / src / gdcmTS.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmTS.h,v $
5   Language:  C++
6   Date:      $Date: 2005/10/25 14:52:35 $
7   Version:   $Revision: 1.22 $
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    void Print(std::ostream &os = std::cout);
72
73    int Count(TSKey const &key);
74    TSAtr const &GetValue(TSKey const &key);
75    bool IsTransferSyntax(TSKey const &key);
76    bool IsRLELossless(TSKey const &key);
77    bool IsJPEGLossless(TSKey const&key);
78    bool IsJPEGLossy(TSKey const&key);
79    bool IsJPEG2000(TSKey const &key);
80    bool IsJPEG(TSKey const &key);
81    bool IsJPEGLS(TSKey const &key);
82    bool IsMPEG(TSKey const &key);
83
84    // This should be deprecated very soon
85    SpecialType GetSpecialTransferSyntax(TSKey const &key);
86    const char* GetSpecialTransferSyntax(SpecialType t);
87
88 protected:
89    TS();
90    ~TS();
91
92 private:
93    TSHT TsMap;
94 };
95 } // end namespace gdcm
96
97 //-----------------------------------------------------------------------------
98 #endif