vtk-dicom  0.8.17
Classes | Public Types | Public Member Functions | List of all members
vtkDICOMImageCodec Class Reference

Codecs for encapsulated images. More...

#include <vtkDICOMImageCodec.h>

Classes

struct  ImageFormat
 A struct to store basic image information for a codec. More...
 

Public Types

enum  EnumType {
  LittleEndian , BigEndian , RLE , JPEGBaseline ,
  JPEGExtended , JPEGLossless , JPEGPrediction , JPEGLS ,
  JPEGLSConstrained , JPEG2KLossless , JPEG2K , MPEG2ML ,
  MPEG2HL , MPEG4HPL41 , MPEG4HPL41BD , MPEG4HPL42V2D ,
  MPEG4HPL42V3D , MPEG4HPL42Stereo , HEVCMPL51 , HEVCM10PL51 ,
  JPEGXLLossless , JPEGXLRecomp , JPEGXL , NumberOfCodecs
}
 
enum  ErrorCode {
  NoError , MissingCodec , BadPixelFormat , MissingData ,
  UnknownError
}
 

Public Member Functions

 vtkDICOMImageCodec ()
 Construct an object for the default codec (little endian uncompressed).
 
 vtkDICOMImageCodec (int k)
 Construct a codec object from the given code. More...
 
 vtkDICOMImageCodec (const std::string &syntax)
 Get a codec for the specified transfer syntax UID. More...
 
std::string GetTransferSyntaxUID () const
 Get the transfer syntax for this codec. More...
 
unsigned char GetKey () const
 Get the numerical identifier for this codec.
 
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. More...
 
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. More...
 
bool operator== (vtkDICOMImageCodec b) const
 
bool operator!= (vtkDICOMImageCodec b) const
 
bool operator<= (vtkDICOMImageCodec a) const
 
bool operator>= (vtkDICOMImageCodec a) const
 
bool operator< (vtkDICOMImageCodec a) const
 
bool operator> (vtkDICOMImageCodec a) const
 

Detailed Description

Codecs for encapsulated images.

DICOM supports a wide variety of image compression methods.

Constructor & Destructor Documentation

◆ vtkDICOMImageCodec() [1/2]

vtkDICOMImageCodec::vtkDICOMImageCodec ( int  k)
inline

Construct a codec object from the given code.

The code can be any of the enumerated code values.

◆ vtkDICOMImageCodec() [2/2]

vtkDICOMImageCodec::vtkDICOMImageCodec ( const std::string &  syntax)
explicit

Get a codec for the specified transfer syntax UID.

This generates an 8-bit code that uniquely identifies a DICOM compression method, given the transfer syntax.

Member Function Documentation

◆ Decode()

int vtkDICOMImageCodec::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.

The length of the source buffer must be provided. The destination must be large enough to accept the entire decompressed frame. On error, the error code is returned, and on success, zero is returned.

◆ Encode()

int vtkDICOMImageCodec::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.

The caller has the responsibility of calling "delete []" on the returned destination buffer.

◆ GetTransferSyntaxUID()

std::string vtkDICOMImageCodec::GetTransferSyntaxUID ( ) const

Get the transfer syntax for this codec.

If the object is invalid, then an empty string is returned.


The documentation for this class was generated from the following file: