14 #ifndef vtkDICOMImageCodec_h
15 #define vtkDICOMImageCodec_h
17 #include "vtkSystemIncludes.h"
18 #include "vtkDICOMModule.h"
72 unsigned short Columns;
73 unsigned short BitsAllocated;
74 unsigned short BitsStored;
75 unsigned short PixelRepresentation;
76 unsigned short SamplesPerPixel;
77 unsigned short PlanarConfiguration;
78 bool AllowLossyCompression;
80 ImageFormat() : Rows(0), Columns(0), BitsAllocated(0), BitsStored(0),
81 PixelRepresentation(0), SamplesPerPixel(0),
82 PlanarConfiguration(0), AllowLossyCompression(
false) {}
113 unsigned char GetKey()
const {
return this->Key; }
124 const unsigned char *source,
size_t sourceSize,
125 unsigned char *dest,
size_t destSize)
const;
133 const unsigned char *source,
size_t sourceSize,
134 unsigned char **dest,
size_t *destSize)
const;
148 static const char *UIDs[24];
150 static int DecodeRLE(
151 const ImageFormat& image,
152 const unsigned char *source,
size_t sourceSize,
153 unsigned char *dest,
size_t destSize);
155 static int EncodeRLE(
156 const ImageFormat& image,
157 const unsigned char *source,
size_t sourceSize,
158 unsigned char **dest,
size_t *destSize);
161 static unsigned int UnpackUnsignedInt(
const void *source) {
162 const unsigned char *cp =
static_cast<const unsigned char *
>(source);
163 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:113
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:95