gdcmTransferSyntax.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMTRANSFERSYNTAX_H
#define GDCMTRANSFERSYNTAX_H
#include "gdcmSwapCode.h"
namespace gdcm
{
class GDCM_EXPORT TransferSyntax
{
public:
typedef enum {
Unknown = 0,
Explicit,
Implicit
} NegociatedType;
#if 0
//NOT FLEXIBLE, since forces user to update lib every time new module
//comes out...
// TODO
typedef enum {
NoSpacing = 0,
PixelSpacing,
ImagerPixelSpacing,
PixelAspectRatio
} ImageSpacingType;
ImageSpacingType GetImageSpacing();
#endif
typedef enum {
ImplicitVRLittleEndian = 0,
ImplicitVRBigEndianPrivateGE,
ExplicitVRLittleEndian,
DeflatedExplicitVRLittleEndian,
ExplicitVRBigEndian,
JPEGBaselineProcess1,
JPEGExtendedProcess2_4,
JPEGExtendedProcess3_5,
JPEGSpectralSelectionProcess6_8,
JPEGFullProgressionProcess10_12,
JPEGLosslessProcess14,
JPEGLosslessProcess14_1,
JPEGLSLossless,
JPEGLSNearLossless,
JPEG2000Lossless,
JPEG2000,
JPEG2000Part2Lossless,
JPEG2000Part2,
RLELossless,
MPEG2MainProfile,
ImplicitVRBigEndianACRNEMA,
WeirdPapryus,
CT_private_ELE,
JPIPReferenced,
MPEG2MainProfileHighLevel,
MPEG4AVCH264HighProfileLevel4_1,
MPEG4AVCH264BDcompatibleHighProfileLevel4_1,
TS_END
} TSType;
// Return the string as written in the official DICOM dict from
// a custom enum type
static const char* GetTSString(TSType ts);
static TSType GetTSType(const char *str);
NegociatedType GetNegociatedType() const;
SwapCode GetSwapCode() const;
bool IsValid() const { return TSField != TS_END; }
operator TSType () const { return TSField; }
// FIXME: ImplicitVRLittleEndian used to be the default, but nowadays
// this is rather the ExplicitVRLittleEndian instead...should be change the default ?
TransferSyntax(TSType type = ImplicitVRLittleEndian):TSField(type) {}
// return if dataset is encoded or not (Deflate Explicit VR)
bool IsEncoded() const;
bool IsImplicit() const;
bool IsExplicit() const;
bool IsEncapsulated() const;
bool IsLossy() const;
bool IsLossless() const;
bool CanStoreLossy() const;
const char *GetString() const { return TransferSyntax::GetTSString(TSField); }
friend std::ostream &operator<<(std::ostream &os, const TransferSyntax &ts);
private:
// DO NOT EXPOSE the following. Internal details of TransferSyntax
bool IsImplicit(TSType ts) const;
bool IsExplicit(TSType ts) const;
bool IsLittleEndian(TSType ts) const;
bool IsBigEndian(TSType ts) const;
TSType TSField;
};
//-----------------------------------------------------------------------------
inline std::ostream &operator<<(std::ostream &_os, const TransferSyntax &ts)
{
_os << TransferSyntax::GetTSString(ts);
return _os;
}
} // end namespace gdcm
#endif //GDCMTRANSFERSYNTAX_H
gdcm::SwapCode
SwapCode representation.
Definition gdcmSwapCode.h:27
gdcm::TransferSyntax
Class to manipulate Transfer Syntax.
Definition gdcmTransferSyntax.h:40
gdcm::TransferSyntax::CanStoreLossy
bool CanStoreLossy() const
gdcm::TransferSyntax::GetTSType
static TSType GetTSType(const char *str)
gdcm::TransferSyntax::IsImplicit
bool IsImplicit() const
gdcm::TransferSyntax::IsValid
bool IsValid() const
Definition gdcmTransferSyntax.h:104
gdcm::TransferSyntax::IsEncoded
bool IsEncoded() const
gdcm::TransferSyntax::IsEncapsulated
bool IsEncapsulated() const
gdcm::TransferSyntax::GetNegociatedType
NegociatedType GetNegociatedType() const
gdcm::TransferSyntax::GetSwapCode
SwapCode GetSwapCode() const
gdcm::TransferSyntax::GetTSString
static const char * GetTSString(TSType ts)
gdcm::TransferSyntax::TSType
TSType
Definition gdcmTransferSyntax.h:61
gdcm::TransferSyntax::ImplicitVRBigEndianACRNEMA
@ ImplicitVRBigEndianACRNEMA
Definition gdcmTransferSyntax.h:82
gdcm::TransferSyntax::MPEG4AVCH264HighProfileLevel4_1
@ MPEG4AVCH264HighProfileLevel4_1
Definition gdcmTransferSyntax.h:87
gdcm::TransferSyntax::CT_private_ELE
@ CT_private_ELE
Definition gdcmTransferSyntax.h:84
gdcm::TransferSyntax::JPEG2000
@ JPEG2000
Definition gdcmTransferSyntax.h:77
gdcm::TransferSyntax::JPEGLSNearLossless
@ JPEGLSNearLossless
Definition gdcmTransferSyntax.h:75
gdcm::TransferSyntax::JPEGFullProgressionProcess10_12
@ JPEGFullProgressionProcess10_12
Definition gdcmTransferSyntax.h:71
gdcm::TransferSyntax::MPEG2MainProfile
@ MPEG2MainProfile
Definition gdcmTransferSyntax.h:81
gdcm::TransferSyntax::JPEG2000Part2
@ JPEG2000Part2
Definition gdcmTransferSyntax.h:79
gdcm::TransferSyntax::JPEG2000Lossless
@ JPEG2000Lossless
Definition gdcmTransferSyntax.h:76
gdcm::TransferSyntax::JPIPReferenced
@ JPIPReferenced
Definition gdcmTransferSyntax.h:85
gdcm::TransferSyntax::WeirdPapryus
@ WeirdPapryus
Definition gdcmTransferSyntax.h:83
gdcm::TransferSyntax::ExplicitVRBigEndian
@ ExplicitVRBigEndian
Definition gdcmTransferSyntax.h:66
gdcm::TransferSyntax::TS_END
@ TS_END
Definition gdcmTransferSyntax.h:89
gdcm::TransferSyntax::JPEGExtendedProcess3_5
@ JPEGExtendedProcess3_5
Definition gdcmTransferSyntax.h:69
gdcm::TransferSyntax::RLELossless
@ RLELossless
Definition gdcmTransferSyntax.h:80
gdcm::TransferSyntax::MPEG2MainProfileHighLevel
@ MPEG2MainProfileHighLevel
Definition gdcmTransferSyntax.h:86
gdcm::TransferSyntax::JPEGLosslessProcess14_1
@ JPEGLosslessProcess14_1
Definition gdcmTransferSyntax.h:73
gdcm::TransferSyntax::JPEGSpectralSelectionProcess6_8
@ JPEGSpectralSelectionProcess6_8
Definition gdcmTransferSyntax.h:70
gdcm::TransferSyntax::ExplicitVRLittleEndian
@ ExplicitVRLittleEndian
Definition gdcmTransferSyntax.h:64
gdcm::TransferSyntax::DeflatedExplicitVRLittleEndian
@ DeflatedExplicitVRLittleEndian
Definition gdcmTransferSyntax.h:65
gdcm::TransferSyntax::JPEG2000Part2Lossless
@ JPEG2000Part2Lossless
Definition gdcmTransferSyntax.h:78
gdcm::TransferSyntax::MPEG4AVCH264BDcompatibleHighProfileLevel4_1
@ MPEG4AVCH264BDcompatibleHighProfileLevel4_1
Definition gdcmTransferSyntax.h:88
gdcm::TransferSyntax::ImplicitVRBigEndianPrivateGE
@ ImplicitVRBigEndianPrivateGE
Definition gdcmTransferSyntax.h:63
gdcm::TransferSyntax::JPEGBaselineProcess1
@ JPEGBaselineProcess1
Definition gdcmTransferSyntax.h:67
gdcm::TransferSyntax::JPEGExtendedProcess2_4
@ JPEGExtendedProcess2_4
Definition gdcmTransferSyntax.h:68
gdcm::TransferSyntax::JPEGLSLossless
@ JPEGLSLossless
Definition gdcmTransferSyntax.h:74
gdcm::TransferSyntax::ImplicitVRLittleEndian
@ ImplicitVRLittleEndian
Definition gdcmTransferSyntax.h:62
gdcm::TransferSyntax::JPEGLosslessProcess14
@ JPEGLosslessProcess14
Definition gdcmTransferSyntax.h:72
gdcm::TransferSyntax::IsExplicit
bool IsExplicit() const
gdcm::TransferSyntax::IsLossy
bool IsLossy() const
gdcm::TransferSyntax::GetString
const char * GetString() const
Definition gdcmTransferSyntax.h:127
gdcm::TransferSyntax::NegociatedType
NegociatedType
Definition gdcmTransferSyntax.h:42
gdcm::TransferSyntax::Unknown
@ Unknown
Definition gdcmTransferSyntax.h:43
gdcm::TransferSyntax::Explicit
@ Explicit
Definition gdcmTransferSyntax.h:44
gdcm::TransferSyntax::Implicit
@ Implicit
Definition gdcmTransferSyntax.h:45
gdcm::TransferSyntax::IsLossless
bool IsLossless() const
gdcm::TransferSyntax::TransferSyntax
TransferSyntax(TSType type=ImplicitVRLittleEndian)
Definition gdcmTransferSyntax.h:110
gdcmSwapCode.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21
gdcm::operator<<
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88