DCMTK
Version 3.6.1 20170228
OFFIS DICOM Toolkit
|
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... | |
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.
|
static |
Convert CIELab color representation as found in DICOM to CIELab representation.
See DICOM part 3 for details.
L | Output CIELab luminance component with 0 <= L <= 100 |
a | Output CIELab "a" component (red<->green) with -127 <= a <= 128 |
b | Output CIELab "b" component (blue<->yellow) with -127 <= b <= 128 |
LDicom | Input CIELab luminance component with 0 <= L <= 65535 as found in DICOM |
aDicom | Input CIELab "a" component (red<->green) with 0 <= a <= 65535 as found in DICOM |
bDicom | Input CIELab "b" component (blue<->yellow) with 0 <= b <= 65535 as found in DICOM |
|
static |
Convert CIELab color representation as found in DICOM to sRGB value representation.
See DICOM part 3 for details.
R | Output sRGB "R" component (red) with 0 <= R <= 1 |
G | Output sRGB "G" component (green) with 0 <= G <= 1 |
B | Output sRGB "R" component (blue) with 0 <= B <= 1 |
LDicom | Input DICOM CIELab luminance component with 0 <= L <= 65535 |
aDicom | Input DICOM CIELab "a" component (red<->green) with 0 <= a <= 65535 |
bDicom | Input DIOCM CIELab "b" component (blue<->yellow) with 0 <= a <= 65535 |
|
staticprotected |
Perform sRGB gamma correction, transforms R to R'.
n | The value to correct |
|
staticprotected |
Perform inverse sRGB gamma correction, transforms R' to R.
n | The value to invert |
|
static |
Convert CIELab color representation to CIELab color representation found in DICOM.
See DICOM part 3 for details.
LDicom | Output CIELab luminance component with 0 <= L <= 65535 as found in DICOM |
aDicom | Output CIELab "a" component (red<->green) with 0 <= a <= 65535 as found in DICOM |
bDicom | Output CIELab "b" component (blue<->yellow) with 0 <= b <= 65535 as found in DICOM |
L | Input CIELab luminance component with 0 <= L <= 100 |
a | Input CIELab "a" component (red<->green) with -127 <= a <= 128 |
b | Input CIELab "b" component (blue<->yellow) with -127 <= b <= 128 |
|
static |
Convert CIELab color representation to sRGB representation.
R | Output sRGB "R" component (red) with 0 <= R <= 1 |
G | Output sRGB "G" component (green) with 0 <= G <= 1 |
B | Output sRGB "R" component (blue) with 0 <= B <= 1 |
L | Input CIELab luminance component with 0 <= L <= 100 |
a | Input CIELab "a" component (red<->green) with -127 <= a <= 128 |
b | Input CIELab "b" component (blue<->yellow) with -127 <= b <= 128 |
|
static |
Convert CIELab color representation to CIE XYZ representation.
X | Output CIELab XYZ "X" component with 0 <= X <= 1 |
Y | Output CIELab XYZ "Y" component with 0 <= Y <= 1 |
Z | Output CIELab XYZ "Z" component with 0 <= Z <= 1 |
L | Input CIELab luminance component with 0 <= L <= 100 |
a | Input CIELab "a" component (red<->green) with -127 <= a <= 128 |
b | Input CIELab "b" component (blue<->yellow) with -127 <= b <= 128 |
|
staticprotected |
CIE L*a*b* f function (used to convert XYZ to L*a*b*)
n | value to convert |
|
staticprotected |
CIE L*a*b* inverse f function.
n | The value to compute the inverse for |
|
staticprotected |
Get the minimum of two numbers.
a | First number |
b | Second number |
|
staticprotected |
Get the minimum of three numbers.
a | First number |
b | Second number |
c | Third number |
|
static |
Convert sRGB color representation to CIELab color representation as found in DICOM.
See DICOM part 3 for details.
LDicom | Output CIELab luminance component with 0 <= L <= 65535 as found in DICOM |
aDicom | Output CIELab "a" component (red<->green) with 0 <= a <= 65535 as found in DICOM |
bDicom | Output CIELab "b" component (blue<->yellow) with 0 <= b <= 65535 as found in DICOM |
R | Input sRGB "R" component (red) with 0 <= R <= 1 |
G | Input sRGB "G" component (green) with 0 <= G <= 1 |
B | Input sRGB "R" component (blue) with 0 <= B <= 1 |
|
static |
Convert sRGB color representation to CIELab representation.
L | Output CIELab luminance component with 0 <= L <= 100 |
a | Output CIELab "a" component (red<->green) with -127 <= a <= 128 |
b | Output CIELab "b" component (blue<->yellow) with -127 <= b <= 128 |
R | Input sRGB "R" component (red) with 0 <= R <= 1 |
G | Input sRGB "G" component (green) with 0 <= G <= 1 |
B | Input sRGB "R" component (blue) with 0 <= B <= 1 |
|
static |
Convert sRGB color representation to CIE XYZ representation.
X | Output CIELab XYZ "X" component with 0 <= X <= 1 |
Y | Output CIELab XYZ "Y" component with 0 <= Y <= 1 |
Z | Output CIELab XYZ "Z" component with 0 <= Z <= 1 |
R | Input sRGB "R" component (red) with 0 <= R <= 1 |
G | Input sRGB "G" component (green) with 0 <= G <= 1 |
B | Input sRGB "R" component (blue) with 0 <= B <= 1 |
|
static |
Convert CIELAB XYZ color representation to CIELab representation.
L | Output CIELab luminance component with 0 <= L <= 100 |
a | Output CIELab "a" component (red<->green) with -127 <= a <= 128 |
b | Output CIELab "b" component (blue<->yellow) with -127 <= b <= 128 |
X | Input CIELab XYZ "X" component with 0 <= X <= 1 |
Y | Input CIELab XYZ "Y" component with 0 <= Y <= 1 |
Z | Input CIELab XYZ "Z" component with 0 <= Z <= 1 |
|
static |
Convert CIE XYZ color representation to sRGB representation.
R | Output sRGB "R" component (red) with 0 <= R <= 1 |
G | Output sRGB "G" component (green) with 0 <= G <= 1 |
B | Output sRGB "R" component (blue) with 0 <= B <= 1 |
X | Output CIELab XYZ "X" component with 0 <= X <= 1 |
Y | Output CIELab XYZ "Y" component with 0 <= Y <= 1 |
Z | Output CIELab XYZ "Z" component with 0 <= Z <= 1 |