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, C3DBitImageC3DShape
 a 3D bit shape for morphological processing More...
 
typedef TFactory< C3DShapeC3DShapePlugin
 Base class for the 3D shape plug-ins. More...
 
typedef THandlerSingleton< TFactoryPluginHandler< C3DShapePlugin > > C3DShapePluginHandler
 Plugin handler for 3D shapes. More...
 
typedef TCArrayWrapper< double > CDoubleVector
 
typedef std::shared_ptr< C3DShapeP3DShape
 pointer to a 3D bit shape for morphological processing More...
 

Functions

float EXPORT_2D angle (const C2DFVector &ray_a, const C2DFVector &ray_b)
 
float EXPORT_2D angle (const C2DFVector &a, const C2DFVector &b, const C2DFVector &s)
 
template<typename E , typename... T>
create_exception (T ...t)
 helper template to create exceptions with complex messages More...
 
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 >
mia_round (double x)
 
template<typename 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

a 3D bit shape for morphological processing

See also
TShape

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

◆ C3DShapePlugin

Base class for the 3D shape plug-ins.

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

◆ C3DShapePluginHandler

Plugin handler for 3D shapes.

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

◆ CDoubleVector

typedef TCArrayWrapper<double> CDoubleVector

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

Definition at line 255 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 39 of file 3d/shape.hh.

Function Documentation

◆ angle() [1/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

◆ angle() [2/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

◆ 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
Ethe exception to be created
T...the variadic list of arguments
Parameters
...tthe arguments used to create the exception message

Definition at line 80 of file errormacro.hh.

References __create_message().

◆ 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
cformatformat pattern string
numnumber
Returns
an according string

◆ 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
pointthe point
astart of line segment
bend of line segment
Returns
distance

◆ 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
fnameinput file name
[out]basethe resulting format string
wildcardtrue 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

◆ 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
Tsome type that supports the >> stream operator
Parameters
sthe c-string holding the value
[out]resultvalue of T corresponding to s
Returns
true if s could be parsed sucessfully, and false if not

Definition at line 78 of file tools.hh.

Referenced by from_string(), and CAttrTranslator::~CAttrTranslator().

◆ 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
Tsome type that supports the >> stream operator
Parameters
sthe c-string holding the value
[out]resultvalue of T corresponding to s
Returns
true if s could be parsed sucessfully, and false if not

Definition at line 107 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_filenamea file name pattern, e.g. file0000.png
Returns
a vector of filenames that follow above pattern

◆ 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
infilenamethe input file name
[out]basethe base of the filename (would be "lala")
[out]suffixthe file suffix (would be ".bla")
Returns
the number of digits (would be 4)

◆ get_filename_number_pattern_width()

EXPORT_CORE size_t get_filename_number_pattern_width ( std::string const &  in_filename)
Parameters
in_filenamesome filename of the pattern "bla/bla/nameXXXXX.bla" where X are digits
Returns
the number of digits in the filename

◆ 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_filenamea file name pattern, e.g. file0000.png
[out]minminimum file number
[out]maxmaximum file number
[out]format_widthwith of the numbering part (here 4)
Returns
a vector of filenames that follow above pattern

◆ 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
InputIteratorreadable forward iterator,
OutputIteratorwritable forward iterator,
Parameters
ibeginiterator indicating the start of the input data
ienditerator indicating the end of the input data, expect an STL-like handling, i.e. iend points behind the last element to be accessed
obeginbegin 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]classesat 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 192 of file kmeans.hh.

References accumulate(), kmeans_step(), and NS_MIA_END.

◆ 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.

References NS_MIA_END.

◆ 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 118 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 180 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)] \)

◆ simpson()

template<class F >
double simpson ( double  from,
double  to,
size_t  intervals,
const F &  function 
)

Simpson integration of a 1D-function

Template Parameters
Fa functor that defines the double operator ()(double x).
Parameters
frombegin of integration interval
toend of integration interval
intervalsnumber of intervals to use for integration
functionfuntion to integrate
Returns
value of integral

Definition at line 36 of file simpson.hh.

References NS_MIA_END.

◆ 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.

◆ 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.

◆ 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_filenamethe input file name
[out]basethe base of the filename (would be "lala")
[out]suffixthe file suffix (would be ".bla")
[out]numberthe file suffix (would be "00210")

◆ 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
Tsome type that supports the << stream operator
Parameters
vthe value to be converted
Returns
string that corresponds to v

Definition at line 122 of file tools.hh.