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 Private Member Functions | List of all members
DiCurveFitting< T1, T2 > 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. More...
 
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. More...
 

Static Private Member Functions

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

Detailed Description

template<class T1, class T2>
class DiCurveFitting< T1, T2 >

Template class for polynomial curve fitting algorithm.

Member Function Documentation

template<class T1 , class T2 >
static int DiCurveFitting< T1, T2 >::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
xarray with x coordinates of given points
yarray with y coordinates of given points
nnumber of entries in array (= points)
oorder of polynomial function
carray to store the resulting coefficients (o+1 entries !)
Returns
true if successful, false otherwise

References DiCurveFitting< T1, T2 >::solve().

template<class T1 , class T2 >
static int DiCurveFitting< T1, T2 >::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
xsfirst x coordinate for computation
xelast x coordinate for computation
yarray to store the resulting y coordinates (n entries !)
nnumber of entries in array (= points)
oorder of polynomial function
carray of coefficients computed by the above method (o+1 entries !)
Returns
true if successful, false otherwise

References DiCurveFitting< T1, T2 >::convertValue().

template<class T1 , class T2 >
static void DiCurveFitting< T1, T2 >::convertValue ( const T3_  input,
Uint8 &  output 
)
inlinestaticprivate

helper routine: convert to unsigned 8 bit value

Parameters
inputinput value to be converted
outputoutput value (range: 0..255)
Returns
output value

Referenced by DiCurveFitting< T1, T2 >::calculateValues().

template<class T1 , class T2 >
static void DiCurveFitting< T1, T2 >::convertValue ( const T3_  input,
Sint8 &  output 
)
inlinestaticprivate

helper routine: convert to signed 8 bit value

Parameters
inputinput value to be converted
outputoutput value (range: -128..127)
Returns
output value
template<class T1 , class T2 >
static void DiCurveFitting< T1, T2 >::convertValue ( const T3_  input,
Uint16 &  output 
)
inlinestaticprivate

helper routine: convert to unsigned 16 bit value

Parameters
inputinput value to be converted
outputoutput value (range: 0..65535)
Returns
output value
template<class T1 , class T2 >
static void DiCurveFitting< T1, T2 >::convertValue ( const T3_  input,
Sint16 &  output 
)
inlinestaticprivate

helper routine: convert to signed 16 bit value

Parameters
inputinput value to be converted
outputoutput value (range: -32768..32767)
Returns
output value
template<class T1 , class T2 >
static void DiCurveFitting< T1, T2 >::convertValue ( const T3_  input,
double &  output 
)
inlinestaticprivate

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

Parameters
inputinput value to be converted
outputoutput value (double)
Returns
output value
template<class T1 , class T2 >
static int DiCurveFitting< T1, T2 >::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
afirst matrix (array of values)
bsecond matrix (array of values)
nnumber of entries in array
Returns
true if successful, false otherwise

Referenced by DiCurveFitting< T1, T2 >::calculateCoefficients().


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