Uncategorized

## Data Structures

class | C2DMorphShape
| a class for advanced morphological filter masks More...
class | C2DPolygon
| A simple 2D polygon class. More...
class | C2DStackDistanceTransform
| A distance transform that stores distances to a 3D binary mask given as slices. More...
class | CCircularIndex
| A class to adress a circulat bufer of a fixed size. More...
class | CCWDSaver
| A Scope based helper class to save and restore the current working directory. More...
class | CFullStats
| This class is used to evaluate the statistics of a series of input data. More...
class | CLabelMap
| A simple class to add loadind and storeing to a map of labels. More...
class | CProbabilityVector
| A vector of probablility values. More...
class | CProgressCallback
| a class to provide a feedback mechanism to show progress More...
class | CWatch
| A class for measuring time. More...
class | FIntensityStatsAccumulator
| Functor to accumulate statistics of data. More...
struct | FMeanVariance
| Functor to be called by mia::filter to evaluate mean and variance of a series of data. More...
struct | FMedianMAD
| Functor to be called by mia::filter to evaluate median and median average distance (MAD) of a series of data. More...
class | Quaternion
| a class to implement a quaternion More...
class | range2d_iterator_with_boundary_flag< I >
| a 2D iterator that knows its position in the 2D grid ans supports iterating over sub-ranges More...
struct | SIntensityStats
| data structure to store te results of a statistical analyis of images More...
struct | T2DMatrix< T >
| A simple 2x2 matrix. More...
class | TCArrayWrapper< T >
| A wrapper around the c-array to provide an STL like interface for iterators. More...
class | THistogramFeeder< T >
| A class to normalize and quantizize input data to a given histogram range with its given number of bins. More...
class | TRefHolder< T >
| A class to make a const reference not so const. More...
class | TSparseSolver< F >
| solver for sparse systems of equations More...
struct | void_destructor< T >
| A helper class to make it possible to store a non-pointer object or a pointer that must not be freed in a shared pointer. More...

## Typedefs

typedef TShape< T3DVector, C3DBitImage > | C3DShape
| a 3D bit shape for morphological processing
typedef TFactory< C3DShape > | C3DShapePlugin
| Base class for the 3D shape plug-ins.
typedef THandlerSingleton< TFactoryPluginHandler< C3DShapePlugin > > | C3DShapePluginHandler
| Plugin handler for 3D shapes.
typedef TCArrayWrapper< double > | CDoubleVector
typedef std::shared_ptr< C3DShape > | P3DShape
| pointer to a 3D bit shape for morphological processing

## Functions

float EXPORT_2D | angle (const C2DFVector &a, const C2DFVector &b, const C2DFVector &s)
float EXPORT_2D | angle (const C2DFVector &ray_a, const C2DFVector &ray_b)
template<typename E, typename... T>
E | create_exception (T ...t)
| helper template to create exceptions with complex messages
EXPORT_CORE std::string | create_filename (const char *cformat, size_t num)
float EXPORT_2D | distance_point_line (const C2DFVector &point, const C2DFVector &a, const C2DFVector &b)
EXPORT_CORE size_t | fname_to_cformat (const char *fname, std::string &base, bool wildcard)
template<typename T>
bool | from_string (const char *s, T &result)
template<typename T>
bool | from_string (const std::string &s, T &result)
EXPORT_CORE std::vector< std::string > | get_consecutive_numbered_files (std::string const &in_filename)
EXPORT_CORE size_t | get_filename_number_pattern (std::string const &infilename, std::string &base, std::string &suffix)
EXPORT_CORE size_t | get_filename_number_pattern_width (std::string const &in_filename)
EXPORT_CORE const std::string | get_filename_pattern_and_range (std::string const &in_filename, size_t &min, size_t &max, size_t &format_width)
template<typename InputIterator, typename OutputIterator>
void | kmeans (InputIterator ibegin, InputIterator iend, OutputIterator obegin, std::vector< double > &classes)
template<typename ForwardIterator>
std::pair< double, double > | mean_var (ForwardIterator begin, ForwardIterator end)
template<typename T>
T | mia_round (double x)
template<typename T>
T | mia_round_clamped (double x)
EXPORT_CORE double | min_ax2_bx_c (double x2, double y0, double y1, double y2)
template<class F>
double | simpson (double from, double to, size_t intervals, const F &function)
void EXPORT_CORE | sincos (double x, double *sin, double *cos)
void EXPORT_CORE | sincosf (float x, float *sin, float *cos)
EXPORT_CORE void | split_filename_number_pattern (std::string const &in_filename, std::string &base, std::string &suffix, std::string &number)
template<typename T>
const std::string | to_string (typename boost::call_traits< T >::param_type v)

## Detailed Description

## Typedef Documentation

## C3DShape

typedef TShape<T3DVector, C3DBitImage> C3DShape

a 3D bit shape for morphological processing

See also
  TShape

Definition at line 35 of file 3d/shape.hh.

## C3DShapePlugin

typedef TFactory<C3DShape> C3DShapePlugin

Base class for the 3D shape plug-ins.

Definition at line 47 of file 3d/shape.hh.

## C3DShapePluginHandler

typedef THandlerSingleton<TFactoryPluginHandler<C3DShapePlugin> > C3DShapePluginHandler

Plugin handler for 3D shapes.

Definition at line 53 of file 3d/shape.hh.

## CDoubleVector

typedef TCArrayWrapper<double> CDoubleVector

STL vector like c-array wrapper for double floating point arrays

Definition at line 266 of file core/vector.hh.

## P3DShape

typedef std::shared_ptr<C3DShape > P3DShape

pointer to a 3D bit shape for morphological processing

See also
  TShape

Definition at line 41 of file 3d/shape.hh.

## Function Documentation

## angle() [1/2]

float EXPORT_2D angle | ( | const C2DFVector & | a,
|  | const C2DFVector & | b,
|  | const C2DFVector & | s )

Evaluate the angle between rays s-a and s-b, returned values are in radians, clockwise.

Parameters

  a |
  b |
  s |

References EXPORT_2D, and NS_MIA_END.

## angle() [2/2]

float EXPORT_2D angle | ( | const C2DFVector & | ray_a,
|  | const C2DFVector & | ray_b )

Evaluate the angle between rays ray_a and ray_b, returned values are in radians, clockwise.

Parameters

  ray_a |
  ray_b |

References EXPORT_2D.

Referenced by CAffinTransformMatrix::rotate_x(), CAffinTransformMatrix::rotate_y(), and CAffinTransformMatrix::rotate_z().

## create_exception()

template<typename E, typename... T>

E create_exception | ( | T ... | t | ) |

helper template to create exceptions with complex messages

This function template creates an exception of the given type. The exception message is created by feeding the arguments from left to right into a stringstream. An abitrary number of arguments can be given, but they all must support the operator << for writing to an output stream

Template Parameters

  E | the exception to be created
  T... | the variadic list of arguments

Parameters

  ...t | the arguments used to create the exception message

Definition at line 80 of file errormacro.hh.

Referenced by create_plugin< Handler, Chained, chainable >::apply(), create_plugin< Handler, ProductChained, true >::apply(), TDelayedParameter< T >::get(), CAttributedData::get_attribute_as(), TDictMap< T >::get_help(), TDictMap< T >::get_name(), kmeans(), operator>>(), TFilterChain< Handler >::push_back(), and TFilterChain< Handler >::push_front().

## create_filename()

EXPORT_CORE std::string create_filename | ( | const char * | cformat,
|  | size_t | num )

create a file name from a pattern and a number

Parameters

  cformat | format pattern string
  num | number

Returns
  an according string

References EXPORT_CORE.

## distance_point_line()

float EXPORT_2D distance_point_line | ( | const C2DFVector & | point,
|  | const C2DFVector & | a,
|  | const C2DFVector & | b )

Evaluate the distance between a point and a löine segment

Parameters

  point | the point
  a | start of line segment
  b | end of line segment

Returns
  distance

References EXPORT_2D, and NS_MIA_END.

## fname_to_cformat()

EXPORT_CORE size_t fname_to_cformat | ( | const char * | fname,
|  | std::string & | base,
|  | bool | wildcard )

split a filename with a number part into a c-format string or a wildcard string

Parameters

  | fname | input file name
  [out] | base | the resulting format string
  | wildcard | true to generate a wildcard string, false to generate a c-format string

Returns
  the width of the numbering pattern example fname = file000.png -> wildcard ? file???.png : file%03d.png

References EXPORT_CORE.

## from_string() [1/2]

template<typename T>

bool from_string | ( | const char * | s,
|  | T & | result )

Function to convert a streamable type from a string to a value. The string may contain whitespaces before and after the value but no other characters.

Template Parameters

  T | some type that supports the >> stream operator

Parameters

  | s | the c-string holding the value
  [out] | result | value of T corresponding to s

Returns
  true if s could be parsed sucessfully, and false if not

Definition at line 81 of file tools.hh.

Referenced by from_string().

## from_string() [2/2]

template<typename T>

bool from_string | ( | const std::string & | s,
|  | T & | result )

Function to convert a streamable type from a string to a value. The string may contain whitespaces before and after the value but no other characters.

Template Parameters

  T | some type that supports the >> stream operator

Parameters

  | s | the c-string holding the value
  [out] | result | value of T corresponding to s

Returns
  true if s could be parsed sucessfully, and false if not

Definition at line 113 of file tools.hh.

References from_string().

## get_consecutive_numbered_files()

EXPORT_CORE std::vector< std::string > get_consecutive_numbered_files | ( | std::string const & | in_filename | ) |

Based on an input pattern get a vector of all files that follow the same numbering pattern and are all numberd consecutive. Only the part of a numbering scheme is taken into account that is directly followed by the last "." in the filename.

Parameters

  in_filename | a file name pattern, e.g. file0000.png

Returns
  a vector of filenames that follow above pattern

References EXPORT_CORE.

## get_filename_number_pattern()

EXPORT_CORE size_t get_filename_number_pattern | ( | std::string const & | infilename,
|  | std::string & | base,
|  | std::string & | suffix )

Split the file name numbering pattern for names (e.g. "lala0000.bla") and get the number of digits

Parameters

  | infilename | the input file name
  [out] | base | the base of the filename (would be "lala")
  [out] | suffix | the file suffix (would be ".bla")

Returns
  the number of digits (would be 4)

References EXPORT_CORE.

## get_filename_number_pattern_width()

EXPORT_CORE size_t get_filename_number_pattern_width | ( | std::string const & | in_filename | ) |

Parameters

  in_filename | some filename of the pattern "bla/bla/nameXXXXX.bla" where X are digits

Returns
  the number of digits in the filename

References EXPORT_CORE.

## get_filename_pattern_and_range()

EXPORT_CORE const std::string get_filename_pattern_and_range | ( | std::string const & | in_filename,
|  | size_t & | min,
|  | size_t & | max,
|  | size_t & | format_width )

Based on an input pattern get a vector of all files that follow the same numbering pattern and are all numberd consecutive. Also obtain the begin and end numbers as well as the width of the number pattern

Parameters

  | in_filename | a file name pattern, e.g. file0000.png
  [out] | min | minimum file number
  [out] | max | maximum file number
  [out] | format_width | with of the numbering part (here 4)

Returns
  a vector of filenames that follow above pattern

References EXPORT_CORE.

## kmeans()

template<typename InputIterator, typename OutputIterator>

void kmeans | ( | InputIterator | ibegin,
|  | InputIterator | iend,
|  | OutputIterator | obegin,
|  | std::vector< double > & | classes )

Run a kmeans clustering on some input data and store the class centers and the class membership.

Template Parameters

  InputIterator | readable forward iterator,
  OutputIterator | writable forward iterator,

Parameters

  | ibegin | iterator indicating the start of the input data
  | iend | iterator indicating the end of the input data, expect an STL-like handling, i.e. iend points behind the last element to be accessed
  | obegin | begin of the output range where the class membership will be stored it is up to the caller to ensure that this range is at least as large as the input range
  [in,out] | classes | at input the size of the vector indicates the number of clusters to be used at output the vector elements contain the class centers in increasing order.

Definition at line 205 of file kmeans.hh.

References create_exception(), kmeans(), and kmeans_step().

Referenced by kmeans().

## mean_var()

template<typename ForwardIterator>

std::pair< double, double > mean_var | ( | ForwardIterator | begin,
|  | ForwardIterator | end )

Evaluate the mean and the variance of a series of scalars

Template Parameters

  ForwardIterator |

Parameters

  begin |
  end |

Returns
  mean as .first and variance as .second of the std::pair.

Todo
  could be extended to vector types

Definition at line 42 of file meanvar.hh.

## mia_round()

template<typename T>

T mia_round | ( | double | x | ) |

A simple class to round floating point numbers onyl if necessary. If the target is a floating point values then the result is just passed through, otherwise rint is used for rounding

Parameters

  x |

Returns
  rounded value or x

Definition at line 122 of file utils.hh.

## mia_round_clamped()

template<typename T>

T mia_round_clamped | ( | double | x | ) |

A simple class to round floating point numbers onyl if necessary. If the target is a floating point values then the result is just passed through, otherwise rint is used for rounding

Parameters

  x |

Returns
  rounded value or x

Definition at line 188 of file utils.hh.

## min_ax2_bx_c()

EXPORT_CORE double min_ax2_bx_c | ( | double | x2,
|  | double | y0,
|  | double | y1,
|  | double | y2 )

given three points (0.0, y0), (1.0, y,1), (x, y2) evaluate \( r = arg(min (ax^2 + bx + c)) \forall r \in [min(0.0, x), max(1.0, x)] \)

References EXPORT_CORE, and NS_MIA_END.

## simpson()

template<class F>

double simpson | ( | double | from,
|  | double | to,
|  | size_t | intervals,
|  | const F & | function )

Simpson integration of a 1D-function

Template Parameters

  F | a functor that defines the double operator ()(double x).

Parameters

  from | begin of integration interval
  to | end of integration interval
  intervals | number of intervals to use for integration
  function | funtion to integrate

Returns
  value of integral

Definition at line 36 of file simpson.hh.

## sincos()

void EXPORT_CORE sincos | ( | double | x,
|  | double * | sin,
|  | double * | cos )

Provide sincosf conveniance functions for sin and cos if the GNU GCC extension is not available.

References EXPORT_CORE.

## sincosf()

void EXPORT_CORE sincosf | ( | float | x,
|  | float * | sin,
|  | float * | cos )

Provide sincosf conveniance functions for sin and cos if the GNU GCC extension is not available.

References EXPORT_CORE.

## split_filename_number_pattern()

EXPORT_CORE void split_filename_number_pattern | ( | std::string const & | in_filename,
|  | std::string & | base,
|  | std::string & | suffix,
|  | std::string & | number )

Split the file name numbering pattern for names (e.g. "lala00210.bla")

Parameters

  | in_filename | the input file name
  [out] | base | the base of the filename (would be "lala")
  [out] | suffix | the file suffix (would be ".bla")
  [out] | number | the file suffix (would be "00210")

References EXPORT_CORE, and NS_MIA_END.

## to_string()

template<typename T>

const std::string to_string | ( | typename boost::call_traits< T >::param_type | v | ) |

Function to convert a streamable type from to a string

Template Parameters

  T | some type that supports the << stream operator

Parameters

  v | the value to be converted

Returns
  string that corresponds to v

Definition at line 128 of file tools.hh.