DCMTK  Version 3.6.1 20170228
OFFIS DICOM Toolkit
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | List of all members
IODCIELabUtil Class Reference

Class supporting color space conversions from and to CIELab. More...

Static Public Member Functions

static void dicomLab2RGB (double &R, double &G, double &B, double LDicom, double aDicom, double bDicom)
 Convert CIELab color representation as found in DICOM to sRGB value representation. More...
 
static void rgb2DicomLab (double &LDicom, double &aDicom, double &bDicom, double R, double G, double B)
 Convert sRGB color representation to CIELab color representation as found in DICOM. More...
 
static void dicomlab2Lab (double &L, double &a, double &b, double LDicom, double aDicom, double bDicom)
 Convert CIELab color representation as found in DICOM to CIELab representation. More...
 
static void lab2DicomLab (double &LDicom, double &aDicom, double &bDicom, double L, double a, double b)
 Convert CIELab color representation to CIELab color representation found in DICOM. More...
 
static void rgb2Lab (double &L, double &a, double &b, double R, double G, double B)
 Convert sRGB color representation to CIELab representation. More...
 
static void rgb2Xyz (double &X, double &Y, double &Z, double R, double G, double B)
 Convert sRGB color representation to CIE XYZ representation. More...
 
static void xyz2Lab (double &L, double &a, double &b, double X, double Y, double Z)
 Convert CIELAB XYZ color representation to CIELab representation. More...
 
static void lab2Rgb (double &R, double &G, double &B, double L, double a, double b)
 Convert CIELab color representation to sRGB representation. More...
 
static void lab2Xyz (double &X, double &Y, double &Z, double L, double a, double b)
 Convert CIELab color representation to CIE XYZ representation. More...
 
static void xyz2Rgb (double &R, double &G, double &B, double X, double Y, double Z)
 Convert CIE XYZ color representation to sRGB representation. More...
 

Static Public Attributes

static const double D65_WHITEPOINT_X
 D65 standard lightpoint X component for conversion from CIEXYZ to CIELab.
 
static const double D65_WHITEPOINT_Y
 D65 standard lightpoint Y component for conversion from CIEXYZ to CIELab.
 
static const double D65_WHITEPOINT_Z
 D65 standard lightpoint Z component for conversion from CIEXYZ to CIELab.
 

Static Protected Member Functions

static double gammaCorrection (double n)
 Perform sRGB gamma correction, transforms R to R'. More...
 
static double invGammaCorrection (double n)
 Perform inverse sRGB gamma correction, transforms R' to R. More...
 
static double labf (double n)
 CIE L*a*b* f function (used to convert XYZ to L*a*b*) More...
 
static double labfInv (double n)
 CIE L*a*b* inverse f function. More...
 
static double min2 (double a, double b)
 Get the minimum of two numbers. More...
 
static double min3 (double a, double b, double c)
 Get the minimum of three numbers. More...
 

Detailed Description

Class supporting color space conversions from and to CIELab.

In some IODs DICOM stores CIELab color values which must often be converted to RGB for display or other purposes. This is supported by the functions dicomLab2RGB() and rgb2DicomLab(). The CIELab value range in DICOM is [0,65535] for all three values. The RGB value range in this class is [0;1]. Further functions are available in order to convert between RGB, "normal" CIELab value range as well as CIEXYZ. The class uses double floating point precision for calculations.

Member Function Documentation

static void IODCIELabUtil::dicomlab2Lab ( double &  L,
double &  a,
double &  b,
double  LDicom,
double  aDicom,
double  bDicom 
)
static

Convert CIELab color representation as found in DICOM to CIELab representation.

See DICOM part 3 for details.

Parameters
LOutput CIELab luminance component with 0 <= L <= 100
aOutput CIELab "a" component (red<->green) with -127 <= a <= 128
bOutput CIELab "b" component (blue<->yellow) with -127 <= b <= 128
LDicomInput CIELab luminance component with 0 <= L <= 65535 as found in DICOM
aDicomInput CIELab "a" component (red<->green) with 0 <= a <= 65535 as found in DICOM
bDicomInput CIELab "b" component (blue<->yellow) with 0 <= b <= 65535 as found in DICOM
static void IODCIELabUtil::dicomLab2RGB ( double &  R,
double &  G,
double &  B,
double  LDicom,
double  aDicom,
double  bDicom 
)
static

Convert CIELab color representation as found in DICOM to sRGB value representation.

See DICOM part 3 for details.

Parameters
ROutput sRGB "R" component (red) with 0 <= R <= 1
GOutput sRGB "G" component (green) with 0 <= G <= 1
BOutput sRGB "R" component (blue) with 0 <= B <= 1
LDicomInput DICOM CIELab luminance component with 0 <= L <= 65535
aDicomInput DICOM CIELab "a" component (red<->green) with 0 <= a <= 65535
bDicomInput DIOCM CIELab "b" component (blue<->yellow) with 0 <= a <= 65535
static double IODCIELabUtil::gammaCorrection ( double  n)
staticprotected

Perform sRGB gamma correction, transforms R to R'.

Parameters
nThe value to correct
Returns
The gamma-corrected value
static double IODCIELabUtil::invGammaCorrection ( double  n)
staticprotected

Perform inverse sRGB gamma correction, transforms R' to R.

Parameters
nThe value to invert
Returns
The gamma-inverted value
static void IODCIELabUtil::lab2DicomLab ( double &  LDicom,
double &  aDicom,
double &  bDicom,
double  L,
double  a,
double  b 
)
static

Convert CIELab color representation to CIELab color representation found in DICOM.

See DICOM part 3 for details.

Parameters
LDicomOutput CIELab luminance component with 0 <= L <= 65535 as found in DICOM
aDicomOutput CIELab "a" component (red<->green) with 0 <= a <= 65535 as found in DICOM
bDicomOutput CIELab "b" component (blue<->yellow) with 0 <= b <= 65535 as found in DICOM
LInput CIELab luminance component with 0 <= L <= 100
aInput CIELab "a" component (red<->green) with -127 <= a <= 128
bInput CIELab "b" component (blue<->yellow) with -127 <= b <= 128
static void IODCIELabUtil::lab2Rgb ( double &  R,
double &  G,
double &  B,
double  L,
double  a,
double  b 
)
static

Convert CIELab color representation to sRGB representation.

Parameters
ROutput sRGB "R" component (red) with 0 <= R <= 1
GOutput sRGB "G" component (green) with 0 <= G <= 1
BOutput sRGB "R" component (blue) with 0 <= B <= 1
LInput CIELab luminance component with 0 <= L <= 100
aInput CIELab "a" component (red<->green) with -127 <= a <= 128
bInput CIELab "b" component (blue<->yellow) with -127 <= b <= 128
static void IODCIELabUtil::lab2Xyz ( double &  X,
double &  Y,
double &  Z,
double  L,
double  a,
double  b 
)
static

Convert CIELab color representation to CIE XYZ representation.

Parameters
XOutput CIELab XYZ "X" component with 0 <= X <= 1
YOutput CIELab XYZ "Y" component with 0 <= Y <= 1
ZOutput CIELab XYZ "Z" component with 0 <= Z <= 1
LInput CIELab luminance component with 0 <= L <= 100
aInput CIELab "a" component (red<->green) with -127 <= a <= 128
bInput CIELab "b" component (blue<->yellow) with -127 <= b <= 128
static double IODCIELabUtil::labf ( double  n)
staticprotected

CIE L*a*b* f function (used to convert XYZ to L*a*b*)

Parameters
nvalue to convert
Returns
The converted value
static double IODCIELabUtil::labfInv ( double  n)
staticprotected

CIE L*a*b* inverse f function.

Parameters
nThe value to compute the inverse for
Returns
The resulting inverse
static double IODCIELabUtil::min2 ( double  a,
double  b 
)
staticprotected

Get the minimum of two numbers.

Parameters
aFirst number
bSecond number
Returns
The minimum of a, b. a if a and b are equal.
static double IODCIELabUtil::min3 ( double  a,
double  b,
double  c 
)
staticprotected

Get the minimum of three numbers.

Parameters
aFirst number
bSecond number
cThird number
Returns
The minimum of a, b and c. If a value occurs more than once, then preference order then a is preferred if possible, b otherwise
static void IODCIELabUtil::rgb2DicomLab ( double &  LDicom,
double &  aDicom,
double &  bDicom,
double  R,
double  G,
double  B 
)
static

Convert sRGB color representation to CIELab color representation as found in DICOM.

See DICOM part 3 for details.

Parameters
LDicomOutput CIELab luminance component with 0 <= L <= 65535 as found in DICOM
aDicomOutput CIELab "a" component (red<->green) with 0 <= a <= 65535 as found in DICOM
bDicomOutput CIELab "b" component (blue<->yellow) with 0 <= b <= 65535 as found in DICOM
RInput sRGB "R" component (red) with 0 <= R <= 1
GInput sRGB "G" component (green) with 0 <= G <= 1
BInput sRGB "R" component (blue) with 0 <= B <= 1
static void IODCIELabUtil::rgb2Lab ( double &  L,
double &  a,
double &  b,
double  R,
double  G,
double  B 
)
static

Convert sRGB color representation to CIELab representation.

Parameters
LOutput CIELab luminance component with 0 <= L <= 100
aOutput CIELab "a" component (red<->green) with -127 <= a <= 128
bOutput CIELab "b" component (blue<->yellow) with -127 <= b <= 128
RInput sRGB "R" component (red) with 0 <= R <= 1
GInput sRGB "G" component (green) with 0 <= G <= 1
BInput sRGB "R" component (blue) with 0 <= B <= 1
static void IODCIELabUtil::rgb2Xyz ( double &  X,
double &  Y,
double &  Z,
double  R,
double  G,
double  B 
)
static

Convert sRGB color representation to CIE XYZ representation.

Parameters
XOutput CIELab XYZ "X" component with 0 <= X <= 1
YOutput CIELab XYZ "Y" component with 0 <= Y <= 1
ZOutput CIELab XYZ "Z" component with 0 <= Z <= 1
RInput sRGB "R" component (red) with 0 <= R <= 1
GInput sRGB "G" component (green) with 0 <= G <= 1
BInput sRGB "R" component (blue) with 0 <= B <= 1
static void IODCIELabUtil::xyz2Lab ( double &  L,
double &  a,
double &  b,
double  X,
double  Y,
double  Z 
)
static

Convert CIELAB XYZ color representation to CIELab representation.

Parameters
LOutput CIELab luminance component with 0 <= L <= 100
aOutput CIELab "a" component (red<->green) with -127 <= a <= 128
bOutput CIELab "b" component (blue<->yellow) with -127 <= b <= 128
XInput CIELab XYZ "X" component with 0 <= X <= 1
YInput CIELab XYZ "Y" component with 0 <= Y <= 1
ZInput CIELab XYZ "Z" component with 0 <= Z <= 1
static void IODCIELabUtil::xyz2Rgb ( double &  R,
double &  G,
double &  B,
double  X,
double  Y,
double  Z 
)
static

Convert CIE XYZ color representation to sRGB representation.

Parameters
ROutput sRGB "R" component (red) with 0 <= R <= 1
GOutput sRGB "G" component (green) with 0 <= G <= 1
BOutput sRGB "R" component (blue) with 0 <= B <= 1
XOutput CIELab XYZ "X" component with 0 <= X <= 1
YOutput CIELab XYZ "Y" component with 0 <= Y <= 1
ZOutput CIELab XYZ "Z" component with 0 <= Z <= 1

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


Generated on Tue Feb 28 2017 for DCMTK Version 3.6.1 20170228 by Doxygen 1.8.8