DCMTK
Version 3.6.1 20170228
OFFIS DICOM Toolkit
|
Template class to scale images (on pixel data level). More...
Public Member Functions | |
DiScaleTemplate (const int planes, const Uint16 columns, const Uint16 rows, const signed long left_pos, const signed long top_pos, const Uint16 src_cols, const Uint16 src_rows, const Uint16 dest_cols, const Uint16 dest_rows, const Uint32 frames, const int bits=0) | |
constructor, scale clipping area. More... | |
DiScaleTemplate (const int planes, const Uint16 src_cols, const Uint16 src_rows, const Uint16 dest_cols, const Uint16 dest_rows, const Uint32 frames, const int bits=0) | |
constructor, scale whole image. More... | |
virtual | ~DiScaleTemplate () |
destructor | |
int | isSigned () const |
check whether template type T is signed or not More... | |
void | scaleData (const T *src[], T *dest[], const int interpolate, const T value=0) |
choose scaling/clipping algorithm depending on specified parameters. More... | |
Protected Attributes | |
const signed long | Left |
left coordinate of clipping area | |
const signed long | Top |
top coordinate of clipping area | |
const Uint16 | Columns |
width of source image | |
const Uint16 | Rows |
height of source image | |
![]() | |
int | Planes |
number of planes | |
Uint16 | Src_X |
width of source image | |
Uint16 | Src_Y |
height of source image | |
const Uint16 | Dest_X |
width of destination image | |
const Uint16 | Dest_Y |
height of destination image | |
const Uint32 | Frames |
number of frames | |
const int | Bits |
number of bits per plane/pixel | |
Private Member Functions | |
void | clipPixel (const T *src[], T *dest[]) |
clip image to specified area (only inside image boundaries). More... | |
void | clipBorderPixel (const T *src[], T *dest[], const T value) |
clip image to specified area and add a border if necessary More... | |
void | replicatePixel (const T *src[], T *dest[]) |
enlarge image by an integer factor. More... | |
void | suppressPixel (const T *src[], T *dest[]) |
shrink image by an integer divisor. More... | |
void | scalePixel (const T *src[], T *dest[]) |
free scaling method without interpolation. More... | |
void | interpolatePixel (const T *src[], T *dest[]) |
free scaling method with interpolation More... | |
void | expandPixel (const T *src[], T *dest[]) |
free scaling method with interpolation (only for magnification) More... | |
void | reducePixel (const T *src[], T *dest[]) |
free scaling method with interpolation (only for reduction) More... | |
void | bilinearPixel (const T *src[], T *dest[]) |
bilinear interpolation method (only for magnification) More... | |
void | bicubicPixel (const T *src[], T *dest[]) |
bicubic interpolation method (only for magnification) More... | |
Additional Inherited Members | |
![]() | |
DiTransTemplate (const int planes, const Uint16 src_x, const Uint16 src_y, const Uint16 dest_x, const Uint16 dest_y, const Uint32 frames, const int bits=0) | |
constructor More... | |
virtual | ~DiTransTemplate () |
destructor | |
void | copyPixel (const T *src[], T *dest[]) |
copy pixel data More... | |
void | fillPixel (T *dest[], const T value) |
fill pixel data with specified value More... | |
void | clearPixel (T *dest[]) |
clear pixel data (set values to 0) More... | |
Template class to scale images (on pixel data level).
with and without interpolation
|
inline |
constructor, scale clipping area.
planes | number of planes (1 or 3) |
columns | width of source image |
rows | height of source image |
left_pos | left coordinate of clipping area |
top_pos | top coordinate of clipping area |
src_cols | width of clipping area |
src_rows | height of clipping area |
dest_cols | width of destination image (scaled image) |
dest_rows | height of destination image |
frames | number of frames |
bits | number of bits per plane/pixel |
|
inline |
constructor, scale whole image.
planes | number of planes (1 or 3) |
src_cols | width of source image |
src_rows | height of source image |
dest_cols | width of destination image (scaled image) |
dest_rows | height of destination image |
frames | number of frames |
bits | number of bits per plane/pixel |
|
inlineprivate |
bicubic interpolation method (only for magnification)
src | array of pointers to source image pixels |
dest | array of pointers to destination image pixels |
References DiTransTemplate< T >::Bits, DiTransTemplate< T >::clearPixel(), DiScaleTemplate< T >::Columns, DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::isSigned(), DiScaleTemplate< T >::Left, DicomImageClass::maxval(), DiTransTemplate< T >::Planes, DiTransTemplate< T >::Src_X, and DiTransTemplate< T >::Src_Y.
Referenced by DiScaleTemplate< T >::scaleData().
|
inlineprivate |
bilinear interpolation method (only for magnification)
src | array of pointers to source image pixels |
dest | array of pointers to destination image pixels |
References DiTransTemplate< T >::clearPixel(), DiScaleTemplate< T >::Columns, DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::Left, DiTransTemplate< T >::Planes, DiTransTemplate< T >::Src_X, and DiTransTemplate< T >::Src_Y.
Referenced by DiScaleTemplate< T >::scaleData().
|
inlineprivate |
clip image to specified area and add a border if necessary
src | array of pointers to source image pixels |
dest | array of pointers to destination image pixels |
value | value to be set outside the image boundaries |
References DiScaleTemplate< T >::Columns, DiTransTemplate< T >::Frames, DiTransTemplate< T >::Planes, DiTransTemplate< T >::Src_X, and DiTransTemplate< T >::Src_Y.
Referenced by DiScaleTemplate< T >::scaleData().
|
inlineprivate |
clip image to specified area (only inside image boundaries).
This is an optimization of the more general method clipBorderPixel().
src | array of pointers to source image pixels |
dest | array of pointers to destination image pixels |
References DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::Left, DiTransTemplate< T >::Planes, DiTransTemplate< T >::Src_X, and DiTransTemplate< T >::Src_Y.
Referenced by DiScaleTemplate< T >::scaleData().
|
inlineprivate |
free scaling method with interpolation (only for magnification)
src | array of pointers to source image pixels |
dest | array of pointers to destination image pixels |
References DiScaleTemplate< T >::Columns, DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::Left, DiTransTemplate< T >::Planes, DiTransTemplate< T >::Src_X, and DiTransTemplate< T >::Src_Y.
Referenced by DiScaleTemplate< T >::scaleData().
|
inlineprivate |
free scaling method with interpolation
src | array of pointers to source image pixels |
dest | array of pointers to destination image pixels |
References DiTransTemplate< T >::Bits, DiTransTemplate< T >::clearPixel(), DiScaleTemplate< T >::Columns, DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::isSigned(), DicomImageClass::maxval(), DiTransTemplate< T >::Planes, DiScaleTemplate< T >::Rows, DiTransTemplate< T >::Src_X, and DiTransTemplate< T >::Src_Y.
Referenced by DiScaleTemplate< T >::scaleData().
|
inline |
check whether template type T is signed or not
References DiPixelRepresentationTemplate< T >::isSigned().
Referenced by DiScaleTemplate< T >::bicubicPixel(), and DiScaleTemplate< T >::interpolatePixel().
|
inlineprivate |
free scaling method with interpolation (only for reduction)
src | array of pointers to source image pixels |
dest | array of pointers to destination image pixels |
References DiScaleTemplate< T >::Columns, DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::Left, DiTransTemplate< T >::Planes, DiTransTemplate< T >::Src_X, and DiTransTemplate< T >::Src_Y.
Referenced by DiScaleTemplate< T >::scaleData().
|
inlineprivate |
enlarge image by an integer factor.
Pixels are replicated independently in both directions.
src | array of pointers to source image pixels |
dest | array of pointers to destination image pixels |
References DiScaleTemplate< T >::Columns, DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::Left, DiTransTemplate< T >::Planes, DiTransTemplate< T >::Src_X, and DiTransTemplate< T >::Src_Y.
Referenced by DiScaleTemplate< T >::scaleData().
|
inline |
choose scaling/clipping algorithm depending on specified parameters.
src | array of pointers to source image pixels |
dest | array of pointers to destination image pixels |
interpolate | preferred interpolation algorithm (0 = no interpolation, 1 = pbmplus algorithm, 2 = c't algorithm, 3 = bilinear magnification, 4 = bicubic magnification) |
value | value to be set outside the image boundaries (used for clipping, default: 0) |
References DiScaleTemplate< T >::bicubicPixel(), DiScaleTemplate< T >::bilinearPixel(), DiTransTemplate< T >::Bits, DiScaleTemplate< T >::clipBorderPixel(), DiScaleTemplate< T >::clipPixel(), DiScaleTemplate< T >::Columns, DiTransTemplate< T >::copyPixel(), DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiScaleTemplate< T >::expandPixel(), DiTransTemplate< T >::fillPixel(), DiScaleTemplate< T >::interpolatePixel(), DiScaleTemplate< T >::Left, DiScaleTemplate< T >::reducePixel(), DiScaleTemplate< T >::replicatePixel(), DiScaleTemplate< T >::Rows, DiScaleTemplate< T >::scalePixel(), DiTransTemplate< T >::Src_X, DiTransTemplate< T >::Src_Y, DiScaleTemplate< T >::suppressPixel(), and DiScaleTemplate< T >::Top.
Referenced by DiColorScaleTemplate< T >::scale(), and DiMonoScaleTemplate< T >::scale().
|
inlineprivate |
free scaling method without interpolation.
This algorithm is necessary for overlays (1 bpp).
src | array of pointers to source image pixels |
dest | array of pointers to destination image pixels |
References DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::Left, DiTransTemplate< T >::Planes, OFBitmanipTemplate< T >::setMem(), DiTransTemplate< T >::Src_X, and DiTransTemplate< T >::Src_Y.
Referenced by DiScaleTemplate< T >::scaleData().
|
inlineprivate |
shrink image by an integer divisor.
Pixels are suppressed independently in both directions.
src | array of pointers to source image pixels |
dest | array of pointers to destination image pixels |
References DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::Left, DiTransTemplate< T >::Planes, DiTransTemplate< T >::Src_X, and DiTransTemplate< T >::Src_Y.
Referenced by DiScaleTemplate< T >::scaleData().