DCMTK: DiCurveFitting< T1, T2, T3 > Class Template Reference

DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Static Public Member Functions | Static Private Member Functions | List of all members
DiCurveFitting< T1, T2, T3 > Class Template Reference

Template class for polynomial curve fitting algorithm. More...

## Static Public Member Functions
static int | calculateCoefficients (const T1 *x, const T2 *y, const unsigned int n, const unsigned int o, T3 *c)
| calculate coefficients for resulting polynomial function.
static int | calculateValues (const T1 xs, const T1 xe, T2 *y, const unsigned int n, const unsigned int o, const T3 *c)
| calculate y coordinates for the given range of x coordinates.

## Static Private Member Functions
static void | convertValue (const T3 input, Uint8 &output)
| helper routine: convert to unsigned 8 bit value
static void | convertValue (const T3 input, Sint8 &output)
| helper routine: convert to signed 8 bit value
static void | convertValue (const T3 input, Uint16 &output)
| helper routine: convert to unsigned 16 bit value
static void | convertValue (const T3 input, Sint16 &output)
| helper routine: convert to signed 16 bit value
static void | convertValue (const T3 input, double &output)
| helper routine: convert to floating point value (double precision)
static int | solve (T3 *a, T3 *b, const unsigned int n)
| solve the equation given by the two matrixes.

## Detailed Description

template<class T1, class T2, class T3 = double>
class DiCurveFitting< T1, T2, T3 >

Template class for polynomial curve fitting algorithm.

## Member Function Documentation

## ◆ calculateCoefficients()

template<class T1, class T2, class T3 = double>

int DiCurveFitting< T1, T2, T3 >::calculateCoefficients | ( | const T1 * | x,
|  | const T2 * | y,
|  | const unsigned int | n,
|  | const unsigned int | o,
|  | T3 * | c )
| inlinestatic

calculate coefficients for resulting polynomial function.

T1 = type of x coordinates T2 = type of y coordinates T3 = type of coefficients (and for internal calculations)

Parameters

  x | array with x coordinates of given points
  y | array with y coordinates of given points
  n | number of entries in array (= points)
  o | order of polynomial function
  c | array to store the resulting coefficients (o+1 entries !)

Returns
  true if successful, false otherwise

References solve().

## ◆ calculateValues()

template<class T1, class T2, class T3 = double>

int DiCurveFitting< T1, T2, T3 >::calculateValues | ( | const T1 | xs,
|  | const T1 | xe,
|  | T2 * | y,
|  | const unsigned int | n,
|  | const unsigned int | o,
|  | const T3 * | c )
| inlinestatic

calculate y coordinates for the given range of x coordinates.

The polynomial function is defined by the specified coefficients. T1 = type of x coordinates T2 = type of y coordinates T3 = type of coefficients (and for internal calculations)

Parameters

  xs | first x coordinate for computation
  xe | last x coordinate for computation
  y | array to store the resulting y coordinates (n entries !)
  n | number of entries in array (= points)
  o | order of polynomial function
  c | array of coefficients computed by the above method (o+1 entries !)

Returns
  true if successful, false otherwise

References convertValue().

## ◆ convertValue() [1/5]

template<class T1, class T2, class T3 = double>

void DiCurveFitting< T1, T2, T3 >::convertValue | ( | const T3 | input,
|  | double & | output )
| inlinestaticprivate

helper routine: convert to floating point value (double precision)

Parameters

  input | input value to be converted
  output | output value (double)

Returns
  output value

## ◆ convertValue() [2/5]

template<class T1, class T2, class T3 = double>

void DiCurveFitting< T1, T2, T3 >::convertValue | ( | const T3 | input,
|  | Sint16 & | output )
| inlinestaticprivate

helper routine: convert to signed 16 bit value

Parameters

  input | input value to be converted
  output | output value (range: -32768..32767)

Returns
  output value

## ◆ convertValue() [3/5]

template<class T1, class T2, class T3 = double>

void DiCurveFitting< T1, T2, T3 >::convertValue | ( | const T3 | input,
|  | Sint8 & | output )
| inlinestaticprivate

helper routine: convert to signed 8 bit value

Parameters

  input | input value to be converted
  output | output value (range: -128..127)

Returns
  output value

## ◆ convertValue() [4/5]

template<class T1, class T2, class T3 = double>

void DiCurveFitting< T1, T2, T3 >::convertValue | ( | const T3 | input,
|  | Uint16 & | output )
| inlinestaticprivate

helper routine: convert to unsigned 16 bit value

Parameters

  input | input value to be converted
  output | output value (range: 0..65535)

Returns
  output value

## ◆ convertValue() [5/5]

template<class T1, class T2, class T3 = double>

void DiCurveFitting< T1, T2, T3 >::convertValue | ( | const T3 | input,
|  | Uint8 & | output )
| inlinestaticprivate

helper routine: convert to unsigned 8 bit value

Parameters

  input | input value to be converted
  output | output value (range: 0..255)

Returns
  output value

Referenced by calculateValues().

## ◆ solve()

template<class T1, class T2, class T3 = double>

int DiCurveFitting< T1, T2, T3 >::solve | ( | T3 * | a,
|  | T3 * | b,
|  | const unsigned int | n )
| inlinestaticprivate

solve the equation given by the two matrixes.

T3 = type of coefficients (and for internal calculations)

Parameters

  a | first matrix (array of values)
  b | second matrix (array of values)
  n | number of entries in array

Returns
  true if successful, false otherwise

Referenced by calculateCoefficients().

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

- dcmimgle/include/dcmtk/dcmimgle/dicrvfit.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.16.1