14 #ifndef vtkDICOMImageCodec_h
15 #define vtkDICOMImageCodec_h
17 #include "vtkSystemIncludes.h"
18 #include "vtkDICOMModule.h"
69 unsigned short Columns;
70 unsigned short BitsAllocated;
71 unsigned short BitsStored;
72 unsigned short PixelRepresentation;
73 unsigned short SamplesPerPixel;
74 unsigned short PlanarConfiguration;
75 bool AllowLossyCompression;
77 ImageFormat() : Rows(0), Columns(0), BitsAllocated(0), BitsStored(0),
78 PixelRepresentation(0), SamplesPerPixel(0),
79 PlanarConfiguration(0), AllowLossyCompression(
false) {}
110 unsigned char GetKey()
const {
return this->Key; }
121 const unsigned char *source,
size_t sourceSize,
122 unsigned char *dest,
size_t destSize)
const;
130 const unsigned char *source,
size_t sourceSize,
131 unsigned char **dest,
size_t *destSize)
const;
145 static const char *UIDs[21];
147 static int DecodeRLE(
148 const ImageFormat& image,
149 const unsigned char *source,
size_t sourceSize,
150 unsigned char *dest,
size_t destSize);
152 static int EncodeRLE(
153 const ImageFormat& image,
154 const unsigned char *source,
size_t sourceSize,
155 unsigned char **dest,
size_t *destSize);
158 static unsigned int UnpackUnsignedInt(
const void *source) {
159 const unsigned char *cp =
static_cast<const unsigned char *
>(source);
160 return cp[0] + (cp[1] << 8) + (cp[2] << 16) + (cp[3] << 24); }
Codecs for encapsulated images.
Definition: vtkDICOMImageCodec.h:29
std::string GetTransferSyntaxUID() const
Get the transfer syntax for this codec.
int Encode(const ImageFormat &image, const unsigned char *source, size_t sourceSize, unsigned char **dest, size_t *destSize) const
Encode a compressed image, and return an allocated destination buffer.
unsigned char GetKey() const
Get the numerical identifier for this codec.
Definition: vtkDICOMImageCodec.h:110
vtkDICOMImageCodec(const std::string &syntax)
Get a codec for the specified transfer syntax UID.
int Decode(const ImageFormat &image, const unsigned char *source, size_t sourceSize, unsigned char *dest, size_t destSize) const
Decode a compressed image into the given destination buffer.
vtkDICOMImageCodec(int k)
Construct a codec object from the given code.
Definition: vtkDICOMImageCodec.h:92