DCMTK: DiGSDFunction Class Reference

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
DiGSDFunction Class Reference

Class to manage GSDF LUTs (for calibration) More...

Inheritance diagram for DiGSDFunction:

## Public Member Functions
| DiGSDFunction (const char *filename, const E_DeviceType deviceType=EDT_Monitor, const signed int ord=-1)
| constructor, read device characteristics file.
| DiGSDFunction (const double *val_tab, const unsigned long count, const Uint16 max=255, const E_DeviceType deviceType=EDT_Monitor, const signed int ord=0)
| constructor, use given array of luminance/OD values.
| DiGSDFunction (const Uint16 *ddl_tab, const double *val_tab, const unsigned long count, const Uint16 max=255, const E_DeviceType deviceType=EDT_Monitor, const signed int ord=0)
| constructor, use given array of DDL and luminance/OD values.
| DiGSDFunction (const double val_min, const double val_max, const unsigned long count=256, const E_DeviceType deviceType=EDT_Monitor, const signed int ord=0)
| constructor, compute luminance/OD values automatically within the specified range.
virtual | ~DiGSDFunction ()
| destructor
int | writeCurveData (const char *filename, const OFBool mode=OFTrue)
| write curve data to a text file
int | setAmbientLightValue (const double value)
| set (reflected) ambient light value.
int | setIlluminationValue (const double value)
| set illumination value.
int | setMinDensityValue (const double value)
| set minimum optical density value "Dmin".
int | setMaxDensityValue (const double value)
| set maximum optical density value "Dmax".
Public Member Functions inherited from DiDisplayFunction
| DiDisplayFunction (const char *filename, const E_DeviceType deviceType=EDT_Monitor, const signed int ord=-1)
| constructor, read device characteristics file.
| DiDisplayFunction (const double *val_tab, const unsigned long count, const Uint16 max=255, const E_DeviceType deviceType=EDT_Monitor, const signed int ord=0)
| constructor, use given array of luminance/OD values.
| DiDisplayFunction (const Uint16 *ddl_tab, const double *val_tab, const unsigned long count, const Uint16 max=255, const E_DeviceType deviceType=EDT_Monitor, const signed int ord=0)
| constructor, use given array of DDL and luminance/OD values.
| DiDisplayFunction (const double val_min, const double val_max, const unsigned long count=256, const E_DeviceType deviceType=EDT_Monitor, const signed int ord=0)
| constructor, compute luminance/OD values automatically within the specified range.
virtual | ~DiDisplayFunction ()
| destructor
int | isValid () const
| check whether DisplayFunction is valid
E_DeviceType | getDeviceType () const
| get output device type (monitor, camera, printer or scanner)
Uint16 | getMaxDDLValue () const
| get maximum DDL value.
double | getMinValue () const
| get minimum luminance/OD value from the characteristic curve.
double | getMaxValue () const
| get maximum luminance/OD value from the characteristic curve.
double | getValueforDDL (const Uint16 ddl) const
| get the luminance/OD value for a given DDL.
Uint16 | getDDLforValue (const double value) const
| get the DDL for a given luminance/OD value.
const DiDisplayLUT * | getLookupTable (const int bits, unsigned long count=0)
| create look-up table with specified number of entries
int | deleteLookupTable (const int bits)
| delete specified LUT
double | getAmbientLightValue () const
| get (reflected) ambient light value.
double | getIlluminationValue () const
| get illumination value.
double | getMinDensityValue () const
| get minimum optical density value "Dmin".
double | getMaxDensityValue () const
| get maximum optical density value "Dmax".
double | getMinLuminanceValue () const
| get minimum luminance value "Lmin".
double | getMaxLuminanceValue () const
| get maximum luminance value "Lmax".
signed int | getPolynomialOrder () const
| get order of the polynomial curve fitting algorithm.
double | convertODtoLum (const double value, const OFBool useAmb=OFTrue) const
| convert the given OD value to luminance.

## Static Public Member Functions
static double | getJNDIndex (const double lum)
| calculate the JND index for a given luminance value
Static Public Member Functions inherited from DiDisplayFunction
static double | convertODtoLum (const double value, const double ambient, const double illum)
| convert the given OD value to luminance.

## Protected Member Functions
DiDisplayLUT * | getDisplayLUT (unsigned long count)
| create GSDF LUT with specified number of entries
int | calculateGSDF ()
| calculate GSDF (array of 1023 luminance/OD values)
int | calculateGSDFSpline ()
| calculate helper function for GSDF interpolation
int | calculateJNDBoundaries ()
| calculate 'JNDMin' and 'JNDMax' for the given luminance/OD range
Protected Member Functions inherited from DiDisplayFunction
int | readConfigFile (const char *filename)
| read the given device characteristics file
int | createSortedTable (const Uint16 *ddl_tab, const double *val_tab)
| create a sorted (by DDL) table from the given DDL and luminance/OD tables
double * | convertODtoLumTable (const double *od_tab, const unsigned long count, const OFBool useAmb)
| create a table with luminance values from the given OD table.
int | interpolateValues ()
| interpolate device characteristic curve by means of a cubic spline interpolation
int | calculateMinMax ()
| calculate minimum and maximum luminance/OD values
int | checkMinMaxDensity () const
| check whether Dmin and Dmax are properly specified.

## Private Attributes
double | JNDMin
| minimum JND index value for the given display system
double | JNDMax
| maximum JND index value for the given display system
double * | GSDFValue
| array of luminance/OD values defining the GSDF
double * | GSDFSpline
| array of values used for the interpolation of the GSDF

## Static Private Attributes
static const unsigned int | GSDFCount
| constant defining the number JND indexes for the maximum luminance/OD range (1023)

## Additional Inherited Members
Public Types inherited from DiDisplayFunction
enum | E_DeviceType { EDT_Monitor , EDT_Camera , EDT_Printer , EDT_Scanner }
| output device type More...
Protected Attributes inherited from DiDisplayFunction
int | Valid
| status flag, indicating whether display function is valid
const E_DeviceType | DeviceType
| output device type (monitor, camera, printer or scanner)
unsigned long | ValueCount
| number of DDL and luminance/OD values
Uint16 | MaxDDLValue
| maximum DDL value (usually 255)
signed int | Order
| order of the polynomial curve fitting algorithm
double | AmbientLight
| (reflected) ambient light value
double | Illumination
| illumination value
double | MinDensity
| minimum optical density (-1 if unset)
double | MaxDensity
| maximum optical density (-1 if unset)
Uint16 * | DDLValue
| pointer to array of DDL values
double * | LODValue
| pointer to array of corresponding luminance/OD values
double | MinValue
| minimum luminance/OD value
double | MaxValue
| maximum luminance/OD value
DiDisplayLUT * | LookupTable [MAX_NUMBER_OF_TABLES]
| array with pointer to the different lookup tables (here: 8-16 bits)
Static Protected Attributes inherited from DiDisplayFunction
static const int | MinBits
| constant defining minimum value for number of bits for LUT input (here: 8)
static const int | MaxBits
| constant defining maximum value for number of bits for LUT input (here: 16)

## Detailed Description

Class to manage GSDF LUTs (for calibration)

## Constructor & Destructor Documentation

## ◆ DiGSDFunction() [1/4]

DiGSDFunction::DiGSDFunction | ( | const char * | filename,
|  | const E_DeviceType | deviceType = EDT_Monitor,
|  | const signed int | ord = -1 )

constructor, read device characteristics file.

Keywords: "max" for maximum DDL (Digital Driving Level, required at first position) "amb" for ambient light and "lum" for illumination (both optional) "ord" for the order of the polynomial curve fitting algorithm used to interpolate the given base points (0 or absent = use cubic spline interpolation)

Parameters

  filename | name of the characteristics file (luminance/OD for each DDL)
  deviceType | type of the output device (default: monitor)
  ord | order of the polynomial curve fitting algorithm used to interpolate the given base points (-1 = use file setting, 0 = cubic spline)

References DiDisplayFunction::EDT_Monitor.

## ◆ DiGSDFunction() [2/4]

DiGSDFunction::DiGSDFunction | ( | const double * | val_tab,
|  | const unsigned long | count,
|  | const Uint16 | max = 255,
|  | const E_DeviceType | deviceType = EDT_Monitor,
|  | const signed int | ord = 0 )

constructor, use given array of luminance/OD values.

UNTESTED Values must be sorted and complete (i.e. there must be an entry for each DDL). The given arrays are copied internally.

Parameters

  val_tab | pointer to array with luminance/OD values
  count | number of array elements (should be equal to 'max + 1')
  max | maximum DDL (digital driving level)
  deviceType | type of the output device (default: monitor)
  ord | order of the polynomial curve fitting algorithm used to interpolate the given base points (0 or negative = use cubic spline interpolation)

References DiDisplayFunction::EDT_Monitor.

## ◆ DiGSDFunction() [3/4]

DiGSDFunction::DiGSDFunction | ( | const Uint16 * | ddl_tab,
|  | const double * | val_tab,
|  | const unsigned long | count,
|  | const Uint16 | max = 255,
|  | const E_DeviceType | deviceType = EDT_Monitor,
|  | const signed int | ord = 0 )

constructor, use given array of DDL and luminance/OD values.

UNTESTED Values will be automatically sorted and missing values will be interpolated. The given arrays are copied internally.

Parameters

  ddl_tab | pointer to array with DDL values (must be with the interval 0..max)
  val_tab | pointer to array with luminance/OD values
  count | number of array elements (2..65536)
  max | maximum DDL (digital driving level)
  deviceType | type of the output device (default: monitor)
  ord | order of the polynomial curve fitting algorithm used to interpolate the given base points (0 or negative = use cubic spline interpolation)

References DiDisplayFunction::EDT_Monitor.

## ◆ DiGSDFunction() [4/4]

DiGSDFunction::DiGSDFunction | ( | const double | val_min,
|  | const double | val_max,
|  | const unsigned long | count = 256,
|  | const E_DeviceType | deviceType = EDT_Monitor,
|  | const signed int | ord = 0 )

constructor, compute luminance/OD values automatically within the specified range.

Parameters

  val_min | minimum luminance/OD value
  val_max | maximum luminance/OD value
  count | number of DDLs (digital driving level, 1..65536))
  deviceType | type of the output device (default: monitor)
  ord | order of the polynomial curve fitting algorithm used to interpolate the given base points (0 or negative = use cubic spline interpolation)

References DiDisplayFunction::EDT_Monitor.

## Member Function Documentation

## ◆ calculateGSDF()

int DiGSDFunction::calculateGSDF | ( |  | ) |
| protected

calculate GSDF (array of 1023 luminance/OD values)

Returns
  status, true if successful, false otherwise

## ◆ calculateGSDFSpline()

int DiGSDFunction::calculateGSDFSpline | ( |  | ) |
| protected

calculate helper function for GSDF interpolation

Returns
  status, true if successful, false otherwise

## ◆ calculateJNDBoundaries()

int DiGSDFunction::calculateJNDBoundaries | ( |  | ) |
| protected

calculate 'JNDMin' and 'JNDMax' for the given luminance/OD range

Returns
  status, true if successful, false otherwise

## ◆ getDisplayLUT()

DiDisplayLUT * DiGSDFunction::getDisplayLUT | ( | unsigned long | count | ) |
| protectedvirtual

create GSDF LUT with specified number of entries

Parameters

  count | number of LUT entries

Returns
  pointer to created LUT if successful, NULL otherwise

Implements DiDisplayFunction.

## ◆ getJNDIndex()

static double DiGSDFunction::getJNDIndex | ( | const double | lum | ) |
| static

calculate the JND index for a given luminance value

Parameters

  lum | luminance value

Returns
  JND index if successful, -1 otherwise

## ◆ setAmbientLightValue()

int DiGSDFunction::setAmbientLightValue | ( | const double | value | ) |
| virtual

set (reflected) ambient light value.

measured in cd/m^2. applicable to softcopy and hardcopy devices. typical values: 0.5-5 for softcopy devices, 10 for transmissive hardcopy printer and 0 for reflective hardcopy printers.

Parameters

  value | ambient light value to be set (>= 0)

Returns
  status, true if successful, false otherwise

Reimplemented from DiDisplayFunction.

## ◆ setIlluminationValue()

int DiGSDFunction::setIlluminationValue | ( | const double | value | ) |
| virtual

set illumination value.

measured in cd/m^2. applicable to hardcopy devices only. typical values: 2000 for transmissive hardcopy printer and 150 for reflective hardcopy printers.

Parameters

  value | illumination value to be set (>= 0)

Returns
  status, true if successful, false otherwise

Reimplemented from DiDisplayFunction.

## ◆ setMaxDensityValue()

int DiGSDFunction::setMaxDensityValue | ( | const double | value | ) |
| virtual

set maximum optical density value "Dmax".

measured in optical density (OD). applicable to printers only. typical value: 3.0

Parameters

  value | Dmax value to be set (or < 0 to unset)

Returns
  status, true if successful (1 = Dmax set, 2 = Dmax unset), false otherwise

Reimplemented from DiDisplayFunction.

## ◆ setMinDensityValue()

int DiGSDFunction::setMinDensityValue | ( | const double | value | ) |
| virtual

set minimum optical density value "Dmin".

measured in optical density (OD). applicable to printers only. typical value: 0.2

Parameters

  value | Dmin value to be set (or < 0 to unset)

Returns
  status, true if successful (1 = Dmax set, 2 = Dmax unset), false otherwise

Reimplemented from DiDisplayFunction.

## ◆ writeCurveData()

int DiGSDFunction::writeCurveData | ( | const char * | filename,
|  | const OFBool | mode = OFTrue )
| virtual

write curve data to a text file

Parameters

  filename | name of the text file to which the data should be written
  mode | write CC and PSC to file if OFTrue

Returns
  status, true if successful, false otherwise

Implements DiDisplayFunction.

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

- dcmimgle/include/dcmtk/dcmimgle/digsdfn.h

Generated on Wed Apr 30 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2