GDCM_NAME_SPACE::TS Class Reference

Container for dicom 'Transfer Syntax' Hash Table. More...

#include <gdcmTS.h>

Inheritance diagram for GDCM_NAME_SPACE::TS:

Inheritance graph
[legend]
Collaboration diagram for GDCM_NAME_SPACE::TS:

Collaboration graph
[legend]
List of all members.

Public Types

enum  SpecialType {
  ImplicitVRLittleEndian = 0, ImplicitVRBigEndianPrivateGE, ExplicitVRLittleEndian, DeflatedExplicitVRLittleEndian,
  ExplicitVRBigEndian, JPEGBaselineProcess1, JPEGExtendedProcess2_4, JPEGExtendedProcess3_5,
  JPEGSpectralSelectionProcess6_8, JPEGFullProgressionProcess10_12, JPEGLosslessProcess14, JPEGLosslessProcess14_1,
  JPEGLSLossless, JPEGLSNearLossless, JPEG2000Lossless, JPEG2000,
  RLELossless, MPEG2MainProfile, UltrasoundImageStorage_Retired, UnknownTS
}

Public Member Functions

virtual void Print (std::ostream &os=std::cout, std::string const &="")
 Print all.
int Count (TSKey const &key)
 returns occurence number of the given key
TSAtr const & GetValue (TSKey const &key)
 returns the human readable value of a Transfer Syntax string
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.
bool IsMPEG (TSKey const &key)
 Determines if the Transfer Syntax corresponds to any form of MPEG encoded Pixel data.
SpecialType GetSpecialTransferSyntax (TSKey const &key)
 GetSpecialTransferSyntax ??
const char * GetSpecialTransferSyntax (SpecialType t)
 GetSpecialTransferSyntax ??
bool IsUltrasoundImageStorage_Retired (TSKey const &key)
 Determines if the SOP id corresponds to any form of UltrasoundImageStorage_Retired.
void Delete ()
 Delete the object.
void Register ()
 Register the object.
void Unregister ()
 Unregister the object.
const unsigned long & GetRefCount () const
 Get the reference counting.
void SetPrintLevel (int level)
 Sets the print level for the Dicom Header Elements.
int GetPrintLevel ()
 Gets the print level for the Dicom Entries.

Static Public Member Functions

static TSNew ()
 Constructs a gdcmTS with a RefCounter.

Protected Member Functions

 TS ()
 ~TS ()

Protected Attributes

int PrintLevel
 Amount of printed details for each Dicom Entries : 0 : stands for the least detail level.

Private Member Functions

 gdcmTypeMacro (TS)

Private Attributes

TSHT TsMap

Detailed Description

Container for dicom 'Transfer Syntax' Hash Table.

Note:
This is a singleton

Definition at line 41 of file gdcmTS.h.


Member Enumeration Documentation

enum GDCM_NAME_SPACE::TS::SpecialType
 

Enumerator:
ImplicitVRLittleEndian 
ImplicitVRBigEndianPrivateGE 
ExplicitVRLittleEndian 
DeflatedExplicitVRLittleEndian 
ExplicitVRBigEndian 
JPEGBaselineProcess1 
JPEGExtendedProcess2_4 
JPEGExtendedProcess3_5 
JPEGSpectralSelectionProcess6_8 
JPEGFullProgressionProcess10_12 
JPEGLosslessProcess14 
JPEGLosslessProcess14_1 
JPEGLSLossless 
JPEGLSNearLossless 
JPEG2000Lossless 
JPEG2000 
RLELossless 
MPEG2MainProfile 
UltrasoundImageStorage_Retired 
UnknownTS 

Definition at line 46 of file gdcmTS.h.


Constructor & Destructor Documentation

GDCM_NAME_SPACE::TS::TS  )  [protected]
 

Definition at line 98 of file gdcmTS.cxx.

References GDCM_NAME_SPACE::DictSet::BuildDictPath(), DICT_TS, GDCM_NAME_SPACE::FillDefaultTSDict(), gdcmWarningMacro, and TsMap.

00099 {
00100 
00101    std::string filename = DictSet::BuildDictPath() + DICT_TS;
00102    std::ifstream from(filename.c_str());
00103    if ( !from )
00104    {
00105       gdcmWarningMacro("Can't open dictionary" << filename.c_str());
00106       FillDefaultTSDict( TsMap );
00107    }
00108    else
00109    {
00110       TSKey key;
00111       TSAtr name;
00112 
00113       while (!from.eof())
00114       {
00115          from >> key;
00116          from >> std::ws;
00117          std::getline(from, name);
00118 
00119          if (key != "")
00120          {
00121             TsMap[key] = name;
00122          }
00123       }
00124 
00125       from.close();
00126    }
00127 }

GDCM_NAME_SPACE::TS::~TS  )  [protected]
 

Definition at line 129 of file gdcmTS.cxx.

References TsMap.

00130 {
00131    TsMap.clear();
00132 }


Member Function Documentation

int GDCM_NAME_SPACE::TS::Count TSKey const &  key  ) 
 

returns occurence number of the given key

Definition at line 138 of file gdcmTS.cxx.

References TsMap.

00139 {
00140    return TsMap.count(key);
00141 }

void GDCM_NAME_SPACE::RefCounter::Delete  )  [inline, inherited]
 

Delete the object.

Remarks:
The object is deleted only if its reference counting is to zero

Definition at line 41 of file gdcmRefCounter.h.

Referenced by GDCM_NAME_SPACE::SerieHelper::AddFileName(), GDCM_NAME_SPACE::Document::Backtrack(), GDCM_NAME_SPACE::FileHelper::CheckMandatoryElements(), GDCM_NAME_SPACE::FileHelper::CheckMandatoryEntry(), GDCM_NAME_SPACE::FileHelper::CopyMandatoryEntry(), GDCM_NAME_SPACE::Dict::DoTheLoadingJob(), GDCM_NAME_SPACE::FillDefaultDataDict(), GDCM_NAME_SPACE::DicomDirObject::FillObject(), vtkGdcmReader::GetFileInformation(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryBinArea(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryString(), GDCM_NAME_SPACE::DocEntrySet::InsertSeqEntry(), vtkGdcmReader::LoadFileInformation(), GDCM_NAME_SPACE::DicomDir::NewMeta(), GDCM_NAME_SPACE::DicomDirStudy::NewVisit(), GDCM_NAME_SPACE::Document::ReadNextDocEntry(), GDCM_NAME_SPACE::DicomDir::SetElement(), GDCM_NAME_SPACE::FileHelper::SetMandatoryEntry(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToExplicitVR(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToImplicitVR(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToJPEG(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToJPEG2000(), GDCM_NAME_SPACE::FileHelper::SetWriteToLibido(), GDCM_NAME_SPACE::DicomDir::~DicomDir(), GDCM_NAME_SPACE::DictSet::~DictSet(), and GDCM_NAME_SPACE::Global::~Global().

00041 { Unregister(); }

GDCM_NAME_SPACE::TS::gdcmTypeMacro TS   )  [private]
 

int GDCM_NAME_SPACE::Base::GetPrintLevel  )  [inline, inherited]
 

Gets the print level for the Dicom Entries.

Definition at line 50 of file gdcmBase.h.

00050 { return PrintLevel; }

const unsigned long& GDCM_NAME_SPACE::RefCounter::GetRefCount  )  const [inline, inherited]
 

Get the reference counting.

Returns:
Reference count

Definition at line 59 of file gdcmRefCounter.h.

00060    {
00061       return RefCount;
00062    }

const char * GDCM_NAME_SPACE::TS::GetSpecialTransferSyntax SpecialType  t  ) 
 

GetSpecialTransferSyntax ??

Parameters:
t SpecialType t ??
Returns:
char* TS : SpecialStrings[t] ??.

Definition at line 361 of file gdcmTS.cxx.

References GDCM_NAME_SPACE::SpecialStrings.

00362 {
00363    return SpecialStrings[t];
00364 }

TS::SpecialType GDCM_NAME_SPACE::TS::GetSpecialTransferSyntax TSKey const &  key  ) 
 

GetSpecialTransferSyntax ??

Parameters:
key TSKey const &key ??
Returns:
TS::SpecialType ??.

Definition at line 344 of file gdcmTS.cxx.

References GDCM_NAME_SPACE::SpecialStrings.

Referenced by GDCM_NAME_SPACE::Document::HandleOutOfGroup0002().

00345 {
00346    for (int i = 0; SpecialStrings[i] != NULL; i++)
00347    {
00348       if ( SpecialStrings[i] == key )
00349       {
00350          return SpecialType(i);
00351       }
00352    }
00353    return UnknownTS;
00354 }

TSAtr const & GDCM_NAME_SPACE::TS::GetValue TSKey const &  key  ) 
 

returns the human readable value of a Transfer Syntax string

Definition at line 144 of file gdcmTS.cxx.

References GDCM_NAME_SPACE::GDCM_UNFOUND, and TsMap.

Referenced by GDCM_NAME_SPACE::File::GetRescaleSlopeIntercept(), GDCM_NAME_SPACE::File::GetSpacing(), and GDCM_NAME_SPACE::Document::GetTransferSyntaxName().

00145 {
00146    // First thing clean up the string 
00147    // (sometimes the transfer syntax is padded with spaces)
00148    std::string copy = key;
00149    while ( copy.size() && !isdigit((unsigned char)copy[copy.size()-1]) )
00150    {
00151       copy.erase(copy.size()-1, 1);
00152    }
00153 
00154    TSHT::const_iterator it = TsMap.find(copy);
00155    if (it == TsMap.end())
00156    {
00157       return GDCM_UNFOUND;
00158    }
00159    return it->second;
00160 }

bool GDCM_NAME_SPACE::TS::IsJPEG TSKey const &  key  ) 
 

Determines if the Transfer Syntax corresponds to 'classical' Jpeg Lossless or Jpeg lossy.

Returns:
True when any form of JPEG found. False otherwise.

Definition at line 264 of file gdcmTS.cxx.

References IsJPEG2000(), IsJPEGLossless(), IsJPEGLossy(), IsJPEGLS(), and IsTransferSyntax().

00265 {
00266    bool r = false;
00267    // First check this is an actual transfer syntax
00268    if ( IsTransferSyntax(key) )
00269    {
00270       if ( IsJPEGLossy( key )
00271         || IsJPEGLossless( key )
00272         || IsJPEG2000( key )
00273         || IsJPEGLS( key )
00274          )
00275       {
00276          r = true;
00277       }
00278    }
00279    return r;
00280 }

bool GDCM_NAME_SPACE::TS::IsJPEG2000 TSKey const &  key  ) 
 

Determines if the Transfer Syntax was already encountered and if it corresponds to a JPEG2000 one.

Returns:
True when JPEG2000 (Lossly or LossLess) found. False in all other cases.

Definition at line 244 of file gdcmTS.cxx.

References IsTransferSyntax(), JPEG2000, JPEG2000Lossless, and GDCM_NAME_SPACE::SpecialStrings.

Referenced by IsJPEG().

00245 {
00246    bool r = false;
00247    // First check this is an actual transfer syntax
00248    if ( IsTransferSyntax(key) )
00249    {
00250       if ( key == SpecialStrings[JPEG2000Lossless]
00251         || key == SpecialStrings[JPEG2000] )
00252       {
00253          r = true;
00254       }
00255    }
00256    return r;
00257 }

bool GDCM_NAME_SPACE::TS::IsJPEGLossless TSKey const &  key  ) 
 

Determines if the Transfer Syntax was already encountered and if it corresponds to a 'classical' JPEG Lossless one.

Returns:
True when 'classical' Lossless found. False in all other cases.

Definition at line 199 of file gdcmTS.cxx.

References IsTransferSyntax(), JPEGFullProgressionProcess10_12, JPEGLosslessProcess14, JPEGLosslessProcess14_1, and GDCM_NAME_SPACE::SpecialStrings.

Referenced by IsJPEG().

00200 {
00201    bool r = false;
00202    // First check this is an actual transfer syntax
00203    if ( IsTransferSyntax(key) )
00204    {
00205       if ( key == SpecialStrings[JPEGFullProgressionProcess10_12]
00206         || key == SpecialStrings[JPEGLosslessProcess14]
00207         || key == SpecialStrings[JPEGLosslessProcess14_1] )
00208       {
00209          r = true;
00210       }
00211    }
00212    return r;
00213 }

bool GDCM_NAME_SPACE::TS::IsJPEGLossy TSKey const &  key  ) 
 

Determines if the Transfer Syntax was already encountered and if it corresponds to a 'classical' JPEG Lossy one.

Returns:
True when 'classical' Lossy found. False in all other cases.

Definition at line 221 of file gdcmTS.cxx.

References IsTransferSyntax(), JPEGBaselineProcess1, JPEGExtendedProcess2_4, JPEGExtendedProcess3_5, JPEGSpectralSelectionProcess6_8, and GDCM_NAME_SPACE::SpecialStrings.

Referenced by IsJPEG().

00222 {
00223    bool r = false;
00224    // First check this is an actual transfer syntax
00225    if ( IsTransferSyntax(key) )
00226    {
00227       if ( key == SpecialStrings[JPEGBaselineProcess1]
00228         || key == SpecialStrings[JPEGExtendedProcess2_4]
00229         || key == SpecialStrings[JPEGExtendedProcess3_5]
00230         || key == SpecialStrings[JPEGSpectralSelectionProcess6_8] )
00231       {
00232          r = true;
00233       }
00234    }
00235    return r;
00236 }

bool GDCM_NAME_SPACE::TS::IsJPEGLS TSKey const &  key  ) 
 

Determines if the Transfer Syntax corresponds to any form of Jpeg-LS encoded Pixel data.

Returns:
True when any form of JPEG-LS found. False otherwise.

Definition at line 287 of file gdcmTS.cxx.

References IsTransferSyntax(), JPEGLSLossless, JPEGLSNearLossless, and GDCM_NAME_SPACE::SpecialStrings.

Referenced by IsJPEG().

00288 {
00289    bool r = false;
00290    // First check this is an actual transfer syntax
00291    if ( IsTransferSyntax(key) )
00292    {
00293       if ( key == SpecialStrings[JPEGLSLossless]
00294         || key == SpecialStrings[JPEGLSNearLossless] ) 
00295       {
00296          r = true;
00297       }
00298    }
00299    return r;
00300 }

bool GDCM_NAME_SPACE::TS::IsMPEG TSKey const &  key  ) 
 

Determines if the Transfer Syntax corresponds to any form of MPEG encoded Pixel data.

Returns:
True when any form of MPEG found. False otherwise.

Definition at line 307 of file gdcmTS.cxx.

References IsTransferSyntax(), MPEG2MainProfile, and GDCM_NAME_SPACE::SpecialStrings.

00308 {
00309    bool r = false;
00310    // First check this is an actual transfer syntax
00311    if ( IsTransferSyntax(key) )
00312    {
00313       if ( key == SpecialStrings[MPEG2MainProfile] ) 
00314       {
00315          r = true;
00316       }
00317    }
00318    return r;
00319 }

bool GDCM_NAME_SPACE::TS::IsRLELossless TSKey const &  key  ) 
 

Determines if the Transfer Syntax was already encountered and if it corresponds to a Run Length Encoding Lossless one.

Returns:
True when Run Length Encoding Lossless found. False in all other cases.

Definition at line 179 of file gdcmTS.cxx.

References IsTransferSyntax(), RLELossless, and GDCM_NAME_SPACE::SpecialStrings.

00180 {
00181    bool r = false;
00182    // First check this is an actual transfer syntax
00183    if ( IsTransferSyntax(key) )
00184    {
00185       if ( key == SpecialStrings[RLELossless] )
00186       {
00187          r = true;
00188       }
00189    }
00190    return r;
00191 }

bool GDCM_NAME_SPACE::TS::IsTransferSyntax TSKey const &  key  ) 
 

Determines if the key passed corresponds to a 'Transfer Syntax' as defined in DICOM (and stored in gdcm::TS class).

Returns:
True when key is an actual 'Transfer Syntax'. False in all other cases.

Definition at line 167 of file gdcmTS.cxx.

References TsMap.

Referenced by IsJPEG(), IsJPEG2000(), IsJPEGLossless(), IsJPEGLossy(), IsJPEGLS(), IsMPEG(), IsRLELossless(), and IsUltrasoundImageStorage_Retired().

00168 {
00169    TSHT::const_iterator it = TsMap.find(key);
00170    return it != TsMap.end();
00171 }

bool GDCM_NAME_SPACE::TS::IsUltrasoundImageStorage_Retired TSKey const &  key  ) 
 

Determines if the SOP id corresponds to any form of UltrasoundImageStorage_Retired.

Returns:
True when Ultrasound Image Storage Retired. False otherwise.

Definition at line 326 of file gdcmTS.cxx.

References IsTransferSyntax(), GDCM_NAME_SPACE::SpecialStrings, and UltrasoundImageStorage_Retired.

00327 {
00328    bool r = false;
00329    // First check this is an actual SOP id
00330    if ( IsTransferSyntax(key) )
00331    {
00332       if ( key == SpecialStrings[UltrasoundImageStorage_Retired] ) 
00333       {
00334          r = true;
00335       }
00336    }
00337    return r;
00338 }

static TS* GDCM_NAME_SPACE::TS::New  )  [inline, static]
 

Constructs a gdcmTS with a RefCounter.

Definition at line 74 of file gdcmTS.h.

Referenced by GDCM_NAME_SPACE::Global::Global().

00074 {return new TS();}

void GDCM_NAME_SPACE::TS::Print std::ostream &  os = std::cout,
std::string const &  = ""
[virtual]
 

Print all.

Parameters:
os The output stream to be written to.

Reimplemented from GDCM_NAME_SPACE::Base.

Definition at line 378 of file gdcmTS.cxx.

References TsMap.

00379 {
00380    std::ostringstream s;
00381 
00382    for (TSHT::const_iterator it = TsMap.begin(); it != TsMap.end(); ++it)
00383    {
00384       s << "TS : " << it->first << " = " << it->second << std::endl;
00385    }
00386    os << s.str();
00387 }

void GDCM_NAME_SPACE::RefCounter::Register  )  [inline, inherited]
 

Register the object.

Remarks:
It increments the reference counting

Definition at line 46 of file gdcmRefCounter.h.

Referenced by GDCM_NAME_SPACE::SQItem::AddEntry(), GDCM_NAME_SPACE::SeqEntry::AddSQItem(), GDCM_NAME_SPACE::SeqEntry::Copy(), GDCM_NAME_SPACE::DicomDir::Copy(), GDCM_NAME_SPACE::FileHelper::FileHelper(), GDCM_NAME_SPACE::DocEntrySet::GetDictEntry(), GDCM_NAME_SPACE::DocEntry::GetName(), GDCM_NAME_SPACE::DocEntry::GetVM(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryString(), GDCM_NAME_SPACE::CommandManager::InSetCommand(), GDCM_NAME_SPACE::DocEntryArchive::Push(), and GDCM_NAME_SPACE::SeqEntry::SetDelimitationItem().

00046 { RefCount++; }

void GDCM_NAME_SPACE::Base::SetPrintLevel int  level  )  [inline, inherited]
 

Sets the print level for the Dicom Header Elements.

Note:
0 for Light Print; 1 for 'medium' Print, 2 for Heavy Print

Definition at line 47 of file gdcmBase.h.

Referenced by GDCM_NAME_SPACE::FileHelper::Print(), and GDCM_NAME_SPACE::DicomDir::Print().

00047 { PrintLevel = level; }

void GDCM_NAME_SPACE::RefCounter::Unregister  )  [inline, inherited]
 

Unregister the object.

Remarks:
It decrements the reference counting

Definition at line 50 of file gdcmRefCounter.h.

Referenced by GDCM_NAME_SPACE::Document::ReadNextDocEntry(), GDCM_NAME_SPACE::SQItem::RemoveEntry(), GDCM_NAME_SPACE::ElementSet::RemoveEntry(), and GDCM_NAME_SPACE::FileHelper::~FileHelper().

00051    {
00052 //std::cout <<"================Unreg " << typeid(*this).name() << std::endl;
00053       RefCount--;
00054       if(RefCount<=0)
00055         delete this;
00056    }


Member Data Documentation

int GDCM_NAME_SPACE::Base::PrintLevel [protected, inherited]
 

Amount of printed details for each Dicom Entries : 0 : stands for the least detail level.

Definition at line 55 of file gdcmBase.h.

Referenced by GDCM_NAME_SPACE::SeqEntry::Print(), GDCM_NAME_SPACE::FileHelper::Print(), GDCM_NAME_SPACE::ElementSet::Print(), GDCM_NAME_SPACE::DocEntry::Print(), GDCM_NAME_SPACE::DictEntry::Print(), GDCM_NAME_SPACE::DicomDirStudy::Print(), GDCM_NAME_SPACE::DicomDirSerie::Print(), GDCM_NAME_SPACE::DicomDirPatient::Print(), GDCM_NAME_SPACE::DicomDirMeta::Print(), GDCM_NAME_SPACE::DicomDir::Print(), and GDCM_NAME_SPACE::DataEntry::Print().

TSHT GDCM_NAME_SPACE::TS::TsMap [private]
 

Definition at line 102 of file gdcmTS.h.

Referenced by Count(), GetValue(), IsTransferSyntax(), Print(), TS(), and ~TS().


The documentation for this class was generated from the following files:
Generated on Fri Aug 24 12:57:27 2007 for gdcm by  doxygen 1.4.6