#include <gdcmTS.h>
Public Types | |
| enum | SpecialType { ImplicitVRLittleEndian = 0, ImplicitVRLittleEndianDLXGE, ExplicitVRLittleEndian, DeflatedExplicitVRLittleEndian, ExplicitVRBigEndian, JPEGBaselineProcess1, JPEGExtendedProcess2_4, JPEGExtendedProcess3_5, JPEGSpectralSelectionProcess6_8, JPEGFullProgressionProcess10_12, JPEGLosslessProcess14, JPEGLosslessProcess14_1, JPEGLSLossless, JPEGLSNearLossless, JPEG2000Lossless, JPEG2000, RLELossless, UnknownTS } |
Public Member Functions | |
| TS () | |
| ~TS () | |
| void | Print (std::ostream &os=std::cout) |
| Print all. | |
| int | Count (TSKey const &key) |
| TSAtr const & | GetValue (TSKey const &key) |
| bool | IsTransferSyntax (TSKey const &key) |
| Determines if the key passed corresponds to a 'Transfer Syntax' as defined in DICOM (and stored in gdcm::TS class). | |
| bool | IsRLELossless (TSKey const &key) |
| Determines if the Transfer Syntax was already encountered and if it corresponds to a Run Length Encoding Lossless one. | |
| bool | IsJPEGLossless (TSKey const &key) |
| Determines if the Transfer Syntax was already encountered and if it corresponds to a 'classical' JPEG Lossless one. | |
| bool | IsJPEGLossy (TSKey const &key) |
| Determines if the Transfer Syntax was already encountered and if it corresponds to a 'classical' JPEG Lossy one. | |
| bool | IsJPEG2000 (TSKey const &key) |
| Determines if the Transfer Syntax was already encountered and if it corresponds to a JPEG2000 one. | |
| bool | IsJPEG (TSKey const &key) |
| Determines if the Transfer Syntax corresponds to 'classical' Jpeg Lossless or Jpeg lossy. | |
| bool | IsJPEGLS (TSKey const &key) |
| Determines if the Transfer Syntax corresponds to any form of Jpeg-LS encoded Pixel data. | |
| SpecialType | GetSpecialTransferSyntax (TSKey const &key) |
| const char * | GetSpecialTransferSyntax (SpecialType t) |
Private Attributes | |
| TSHT | TsMap |
Definition at line 41 of file gdcmTS.h.
|
|
Definition at line 44 of file gdcmTS.h. Referenced by GetSpecialTransferSyntax().
00044 {
00045 ImplicitVRLittleEndian = 0,
00046 ImplicitVRLittleEndianDLXGE,
00047 ExplicitVRLittleEndian,
00048 DeflatedExplicitVRLittleEndian,
00049 ExplicitVRBigEndian,
00050 JPEGBaselineProcess1,
00051 JPEGExtendedProcess2_4,
00052 JPEGExtendedProcess3_5,
00053 JPEGSpectralSelectionProcess6_8,
00054 JPEGFullProgressionProcess10_12,
00055 JPEGLosslessProcess14,
00056 JPEGLosslessProcess14_1,
00057 JPEGLSLossless,
00058 JPEGLSNearLossless,
00059 JPEG2000Lossless,
00060 JPEG2000,
00061 RLELossless,
00062 UnknownTS
00063 };
|
|
|
Definition at line 81 of file gdcmTS.cxx. References DICT_TS, gdcm::FillDefaultTSDict(), gdcmWarningMacro, gdcm::TSAtr, gdcm::TSKey, and TsMap.
00082 {
00083 std::string filename = DictSet::BuildDictPath() + DICT_TS;
00084 std::ifstream from(filename.c_str());
00085 if( !from )
00086 {
00087 gdcmWarningMacro("Can't open dictionary" << filename.c_str());
00088 FillDefaultTSDict( TsMap );
00089 }
00090 else
00091 {
00092 TSKey key;
00093 TSAtr name;
00094
00095 while (!from.eof())
00096 {
00097 from >> key;
00098 from >> std::ws;
00099 std::getline(from, name);
00100
00101 if(key != "")
00102 {
00103 TsMap[key] = name;
00104 }
00105 }
00106 from.close();
00107 }
00108 }
|
|
|
Definition at line 110 of file gdcmTS.cxx. References TsMap.
00111 {
00112 TsMap.clear();
00113 }
|
|
|
Definition at line 117 of file gdcmTS.cxx. References gdcm::TSKey, and TsMap.
00118 {
00119 return TsMap.count(key);
00120 }
|
|
|
Definition at line 290 of file gdcmTS.cxx. References gdcm::SpecialStrings.
00291 {
00292 return SpecialStrings[t];
00293 }
|
|
|
Definition at line 277 of file gdcmTS.cxx. References gdcm::SpecialStrings, SpecialType, gdcm::TSKey, and UnknownTS.
00278 {
00279 for (int i = 0; SpecialStrings[i] != NULL; i++)
00280 {
00281 if ( SpecialStrings[i] == key )
00282 {
00283 return SpecialType(i);
00284 }
00285 }
00286
00287 return UnknownTS;
00288 }
|
|
|
Definition at line 122 of file gdcmTS.cxx. References gdcm::GDCM_UNFOUND, gdcm::TSAtr, gdcm::TSKey, and TsMap. Referenced by gdcm::ValEntry::Print().
00123 {
00124 // First thing clean up the string sometime the transfer syntax is padded with spaces
00125 std::string copy = key;
00126 while ( copy.size() && !isdigit((unsigned char)copy[copy.size()-1]) )
00127 {
00128 copy.erase(copy.size()-1, 1);
00129 }
00130
00131 TSHT::const_iterator it = TsMap.find(copy);
00132 if (it == TsMap.end())
00133 {
00134 return GDCM_UNFOUND;
00135 }
00136 return it->second;
00137 }
|
|
|
Determines if the Transfer Syntax corresponds to 'classical' Jpeg Lossless or Jpeg lossy.
Definition at line 241 of file gdcmTS.cxx. References IsJPEGLossless(), IsJPEGLossy(), IsTransferSyntax(), and gdcm::TSKey.
00242 {
00243 bool r = false;
00244 // First check this is an actual transfer syntax
00245 if( IsTransferSyntax(key) )
00246 {
00247 if ( IsJPEGLossy( key )
00248 || IsJPEGLossless( key )
00249 )
00250 {
00251 r = true;
00252 }
00253 }
00254 return r;
00255 }
|
|
|
Determines if the Transfer Syntax was already encountered and if it corresponds to a JPEG2000 one.
Definition at line 221 of file gdcmTS.cxx. References IsTransferSyntax(), JPEG2000, JPEG2000Lossless, gdcm::SpecialStrings, and gdcm::TSKey.
00222 {
00223 bool r = false;
00224 // First check this is an actual transfer syntax
00225 if( IsTransferSyntax(key) )
00226 {
00227 if ( key == SpecialStrings[JPEG2000Lossless]
00228 || key == SpecialStrings[JPEG2000] )
00229 {
00230 r = true;
00231 }
00232 }
00233 return r;
00234 }
|
|
|
Determines if the Transfer Syntax was already encountered and if it corresponds to a 'classical' JPEG Lossless one.
Definition at line 176 of file gdcmTS.cxx. References IsTransferSyntax(), JPEGFullProgressionProcess10_12, JPEGLosslessProcess14, JPEGLosslessProcess14_1, gdcm::SpecialStrings, and gdcm::TSKey. Referenced by IsJPEG().
00177 {
00178 bool r = false;
00179 // First check this is an actual transfer syntax
00180 if( IsTransferSyntax(key) )
00181 {
00182 if ( key == SpecialStrings[JPEGFullProgressionProcess10_12]
00183 || key == SpecialStrings[JPEGLosslessProcess14]
00184 || key == SpecialStrings[JPEGLosslessProcess14_1] )
00185 {
00186 r = true;
00187 }
00188 }
00189 return r;
00190 }
|
|
|
Determines if the Transfer Syntax was already encountered and if it corresponds to a 'classical' JPEG Lossy one.
Definition at line 198 of file gdcmTS.cxx. References IsTransferSyntax(), JPEGBaselineProcess1, JPEGExtendedProcess2_4, JPEGExtendedProcess3_5, JPEGSpectralSelectionProcess6_8, gdcm::SpecialStrings, and gdcm::TSKey. Referenced by IsJPEG().
00199 {
00200 bool r = false;
00201 // First check this is an actual transfer syntax
00202 if( IsTransferSyntax(key) )
00203 {
00204 if ( key == SpecialStrings[JPEGBaselineProcess1]
00205 || key == SpecialStrings[JPEGExtendedProcess2_4]
00206 || key == SpecialStrings[JPEGExtendedProcess3_5]
00207 || key == SpecialStrings[JPEGSpectralSelectionProcess6_8] )
00208 {
00209 r = true;
00210 }
00211 }
00212 return r;
00213 }
|
|
|
Determines if the Transfer Syntax corresponds to any form of Jpeg-LS encoded Pixel data.
Definition at line 262 of file gdcmTS.cxx. References IsTransferSyntax(), JPEGLSLossless, JPEGLSNearLossless, gdcm::SpecialStrings, and gdcm::TSKey.
00263 {
00264 bool r = false;
00265 // First check this is an actual transfer syntax
00266 if( IsTransferSyntax(key) )
00267 {
00268 if ( key == SpecialStrings[JPEGLSLossless]
00269 || key == SpecialStrings[JPEGLSNearLossless] )
00270 {
00271 r = true;
00272 }
00273 }
00274 return r;
00275 }
|
|
|
Determines if the Transfer Syntax was already encountered and if it corresponds to a Run Length Encoding Lossless one.
Definition at line 156 of file gdcmTS.cxx. References IsTransferSyntax(), RLELossless, gdcm::SpecialStrings, and gdcm::TSKey.
00157 {
00158 bool r = false;
00159 // First check this is an actual transfer syntax
00160 if( IsTransferSyntax(key) )
00161 {
00162 if ( key == SpecialStrings[RLELossless] )
00163 {
00164 r = true;
00165 }
00166 }
00167 return r;
00168 }
|
|
|
Determines if the key passed corresponds to a 'Transfer Syntax' as defined in DICOM (and stored in gdcm::TS class).
Definition at line 144 of file gdcmTS.cxx. References gdcm::TSKey, and TsMap. Referenced by IsJPEG(), IsJPEG2000(), IsJPEGLossless(), IsJPEGLossy(), IsJPEGLS(), and IsRLELossless().
|
|
|
Print all.
Definition at line 307 of file gdcmTS.cxx. References TsMap.
|
|
|
Definition at line 86 of file gdcmTS.h. Referenced by Count(), GetValue(), IsTransferSyntax(), Print(), TS(), and ~TS(). |
1.3.6