#include <iostream>
#include <valarray>
#include <string>
#include <sstream>
#include "matrixutil.hpp"
#include "vc6compat.h"
Go to the source code of this file.
Classes | |
class | imgbase< s_x, s_y, T > |
Base class for images. More... | |
class | bild16 |
Class that deals with 16bit grayscale images from the X-ray device. More... | |
struct | bild16::header_t |
Header data structure of HIS files. More... | |
class | rawfloat |
Stream output manipulator for writing binary floats. More... | |
class | irawfloat |
Stream input manipulator for reading binary floats. More... | |
class | eichkurve |
Base class for calibration function. More... | |
class | expkurve |
Multi-exponential decay with 3 timescales. More... | |
class | exp4kurve |
Multi-exponential decay with 4 timescales. More... | |
class | tablekurve |
Simple table lookup eichkurve. More... | |
class | flatkurve |
linear transform eichkurve, deprecated More... | |
class | bildfloat |
Class that stores intensities as floats. More... | |
class | interpol |
Deprecated pixel by pixel interpolation between individual reference images. More... | |
class | QRfit |
Polynomial fit to correct pixel differences. More... | |
Defines | |
#define | TRACE(x) |
Trace macros not yet implemented. | |
#define | TRACEX(x, y) |
#define | STHROW(msg) |
Throw exceptions. | |
#define | THROWSPEC throw(std::string) |
#define | MAP(img) |
MAP iterates over an image. | |
#define | MAP_CIRCLE(img, radius) |
Iterate over the area of a circle centered in the image. | |
#define | MAP_REGION(region) MAP(region) if (region(y,x)) |
Iterate over the image, cover only points contained in region. | |
#define | MAP_CIRCLE_XY(img, radius, xm, ym) |
Iterate over the area of a circle centered at xm, ym. | |
#define | MAPF(img, Functor) MAP(img) { Functor(img(y,x)); } |
call a function or functor for every point in the image | |
#define | MAPFXY(img, Functor) MAP(img) { Functor(x, y, img(y,x)); } |
call a function or functor for every point in the image | |
Typedefs | |
typedef imgbase < 512, 512, unsigned short > | bild16_base |
Instantiation of imgbase for raw X-ray images (16bit). | |
typedef imgbase< 512, 512, bool > | region_base |
Base class for region_t. | |
typedef region_base | region_t |
Regions on an X-ray image. | |
typedef imgbase< 512, 512, float > | bildfloat_base |
bildfloat_base is the base class for bildfloat derived from imgbase | |
typedef std::valarray< float > | lut |
typedef imgbase< 512, 512, lut > | interpol_base |
Functions | |
template<typename T> | |
T | SQR (T x) |
Simple template function to square the input argument, used everywhere. | |
template<int s_x, int s_y, typename T> | |
T | average (const imgbase< s_x, s_y, T > &img) |
#define MAP | ( | img | ) |
Value:
for (int y=0; y<img.SIZEY; y++) \ for (int x=0; x<img.SIZEX; x++)
An often used pattern is to iterate over the hole image in scanline-order. This is accomplished by two nested for-loops. It makes the code somewhat clearer, if one uses these macros instead of directly writing out the loops.
Example:
Definition at line 55 of file imgclass.hpp.
Referenced by bildfloat::apply_eichkurve(), bild16::bild16(), bildcomplex::bildcomplex(), bildfloat::bildfloat(), bildcomplex::decompose(), execute_region(), bildfloat::from_bild16(), bild16::fromfloat(), getimage(), getimage_contrast(), bildcomplex::Hamming_unwindow(), bildcomplex::Hamming_window(), bildcomplex::norm(), imgbase< s_x, s_y, T >::operator*=(), imgbase< s_x, s_y, T >::operator+=(), imgbase< s_x, s_y, T >::operator-=(), imgbase< s_x, s_y, T >::operator/=(), and imgbase< s_x, s_y, T >::operator=().
#define MAP_CIRCLE | ( | img, | |||
radius | ) |
#define MAP_CIRCLE_XY | ( | img, | |||
radius, | |||||
xm, | |||||
ym | ) |
Value:
for (int y=ym-radius; y<=ym+radius; y++) \ for (int x=xm-radius; x<=xm+radius; x++) \ if ((x>=0) && (x<img.SIZEX) && (y>=0) && (y<img.SIZEY)) \ if (SQR(x-xm)+ SQR(y-ym) <= SQR(radius))
MAP_CIRCLE_XY does the same like MAP, except that it includes only points that are inside a circle of radius radius
Definition at line 72 of file imgclass.hpp.
#define MAP_REGION | ( | region | ) | MAP(region) if (region(y,x)) |
Iterate over the image, cover only points contained in region.
MAP_REGION does the same like MAP, except that it includes only points that are set in the region
Definition at line 67 of file imgclass.hpp.
#define MAPF | ( | img, | |||
Functor | ) | MAP(img) { Functor(img(y,x)); } |
call a function or functor for every point in the image
MAPF runs the Functor argument on every point in the image img This maybe useful with functors such as hydrodynamic sum or so.
Definition at line 83 of file imgclass.hpp.
#define MAPFXY | ( | img, | |||
Functor | ) | MAP(img) { Functor(x, y, img(y,x)); } |
call a function or functor for every point in the image
Same as MAPF, but hands the coordinates to the functor, too. The functor must accept three arguments: Coordinates x and y and the value of the image at that position
Definition at line 89 of file imgclass.hpp.
#define STHROW | ( | msg | ) |
Value:
{ \
std::ostringstream err;\
err<<msg; \
throw err.str(); }
This macro allows to conveniently throw exceptions with parameters. It inserts the argument into a strinstream so it is easy to compose the error message from parts. For example:
try { std::cerr<<"Da kommt jetzt was\n"; int a=5; STHROW("Something awkward happens for a="<<a<<" !"); } catch (std::string& s) { std::cerr<<"Error: "<<s<<std::endl; }
Definition at line 31 of file imgclass.hpp.
Referenced by bildfloat::convolve(), tablekurve::deichfun_dx(), bild16::drawx(), bild16::drawy(), tablekurve::eichfun(), Parabelzentrum::estimate(), QRfit::get_coeff(), getimage_contrast(), getminmax(), tablekurve::initguess(), bild16::kreuz(), Parabelzentrum::operator()(), QRfit::read(), bildfloat::read_gnuplot(), bild16::read_his(), bild16::read_pgm(), tablekurve::tablekurve(), Voronoischnitt::Voronoischnitt(), bild16::write_his(), and bild16::write_pgm8_bounds().
#define THROWSPEC throw(std::string) |
Definition at line 36 of file imgclass.hpp.
#define TRACE | ( | x | ) |
#define TRACEX | ( | x, | |||
y | ) |
typedef imgbase<512,512,unsigned short> bild16_base |
typedef imgbase<512, 512, float> bildfloat_base |
bildfloat_base is the base class for bildfloat derived from imgbase
Definition at line 656 of file imgclass.hpp.
typedef imgbase<512, 512, lut> interpol_base |
Definition at line 741 of file imgclass.hpp.
typedef std::valarray<float> lut |
Definition at line 740 of file imgclass.hpp.
typedef imgbase<512,512,bool> region_base |
typedef region_base region_t |
Regions on an X-ray image.
region_t is currently only a typedef to the basic imageclass holding booleans. Later on there may come additional member functions like file I/O. Regions are heavily used in image processing algorithm like floodfill. Another good application could be badpixel masks, which are currently implemented as bild16
Definition at line 654 of file imgclass.hpp.
T average | ( | const imgbase< s_x, s_y, T > & | img | ) | [inline] |
Template function that tries to average the whole image. It doesn't work for integer based imgbase (because the integer may overflow relatively fast) and should therefore not be used. Try a functor instead and use MAP:
Definition at line 331 of file imgclass.hpp.
T SQR | ( | T | x | ) | [inline] |
Simple template function to square the input argument, used everywhere.
Definition at line 95 of file imgclass.hpp.