eichkurve Class Reference

#include <imgclass.hpp>

Inheritance diagram for eichkurve:

Inheritance graph
base refererrect $classexp4kurve.html 6,93 78,117rect $classexpkurve.html 102,93 169,117rect $classflatkurve.html 193,93 252,117rect $classtablekurve.html 276,93 348,117
[legend]

List of all members.


Detailed Description

Base class for calibration function.

An eichkurve stores a 64k lookup table to do fast conversion from intensities to other quantities, such as height or concentration. It is an abstract base class that implements Newtons method and basic memory management as well as writing the lookup table to a file [table_write()]. Use the derived class tablekurve to read and use such datafiles.

If you derive this class and want to use the Newton iteration for the inversion of the calibration function, you need to implement

and call table_init() to start the iteration. Because this can take some time, you may want to store the lookup table in a file by calling table_write() from an instance and then use tablekurve for subsequent conversions which should load considerably faster.

Definition at line 488 of file imgclass.hpp.


Public Member Functions

 eichkurve ()
virtual ~eichkurve ()
double operator() (bild16::data_t val) const
 Conversion operator.
virtual double eichfun (double x) const =0
 Calibration function, which will be inverted.
virtual double deichfun_dx (double x) const =0
 Derivative of the calibration function.
virtual double initguess (bild16::data_t val) const =0
 Starting point for the iteration.
void table_write (const char *name) const
 Write the lookup table to a file.

Protected Member Functions

double fsolve (bild16::data_t val, double hmin, double hmax) const
void table_init (double hmin, double hmax)

Protected Attributes

double * lookup

Static Protected Attributes

static const char magic [] = "EICHTABELLE"

Constructor & Destructor Documentation

eichkurve::eichkurve (  ) 

Definition at line 367 of file imgclass.cpp.

References lookup.

eichkurve::~eichkurve (  )  [virtual]

Definition at line 373 of file imgclass.cpp.

References lookup.


Member Function Documentation

double eichkurve::operator() ( bild16::data_t  val  )  const [inline]

Conversion operator.

The function evaluation operator looks up an element in the lookup table and returns it. Initially, it was meant for usage such as:

        tablekurve tk("somecalib.data");
        bild16 bild("someimage.his");
        bildfloat bfl;

        MAP(bild) {
          bfl(y,x)=tk(bild(y,x));
        }

But because of point-wise float corrections necessary to overcome the deficiencies of the detector, it must now be applied to floating point images. bildfloat features a special member function for this purpose.

Definition at line 530 of file imgclass.hpp.

References lookup.

virtual double eichkurve::eichfun ( double  x  )  const [pure virtual]

Calibration function, which will be inverted.

Implemented in expkurve, exp4kurve, tablekurve, and flatkurve.

Referenced by fsolve().

virtual double eichkurve::deichfun_dx ( double  x  )  const [pure virtual]

Derivative of the calibration function.

Implemented in expkurve, exp4kurve, tablekurve, and flatkurve.

virtual double eichkurve::initguess ( bild16::data_t  val  )  const [pure virtual]

Starting point for the iteration.

The implementation of initguess must return a starting value that triggers convergence to the solution. Otherwise table_init may hang.

Implemented in expkurve, exp4kurve, tablekurve, and flatkurve.

void eichkurve::table_write ( const char *  name  )  const

Write the lookup table to a file.

Definition at line 462 of file imgclass.cpp.

References lookup, and magic.

double eichkurve::fsolve ( bild16::data_t  val,
double  hmin,
double  hmax 
) const [protected]

Definition at line 388 of file imgclass.cpp.

References abs(), eichfun(), and signum().

Referenced by table_init().

void eichkurve::table_init ( double  hmin,
double  hmax 
) [protected]

Definition at line 380 of file imgclass.cpp.

References fsolve(), and lookup.

Referenced by exp4kurve::exp4kurve(), and expkurve::expkurve().


Member Data Documentation

const char eichkurve::magic = "EICHTABELLE" [static, protected]

Definition at line 506 of file imgclass.hpp.

Referenced by table_write(), and tablekurve::tablekurve().

double* eichkurve::lookup [protected]


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

Generated on Fri Jul 24 12:49:18 2009 for Xgrayimg Library by  doxygen 1.5.5