$extrastylesheet
Since examples are based on 2D images pixels are actually "points" however we
will call them "sites" which is the most generic name.
Here is also a list of common variable name conventions:
Object Variable name Site p Value v Neighboor n A site close to another site p q
Olena is organized in a namespace hierarchy. Everything is declared by Olena within the ’mln::’ namespace, and possibly a sub-namespace such as ’mln::arith::’ (arithmetic operations on images), ’mln::morpho::’ (morphological operations), etc. Usually, the namespace hierarchy is mapped to the mln directory tree. For the sake of simplicity, we will neglect the ’mln::’ prefix in all the code examples.
Methods provided by objects in the library are in constant time. If you need a specific method but you cannot find it, you may find an algorithm which can compute the information you need.
Before writing your first program, please be aware of these hints:
$ g++ -O2 -DNDEBUG -Ipath/to/mln my_program.cc
In case of a large project, Olena may be used in several source files. Even if compilation is fine, you may encounter the following linking error:
These multiple symbol definitions are due to some global variables used in Olena. They are built in each source file which includes Olena headers and are therefore duplicated, causing linking errors.
An easy way to override this issue is to compile all the source files of your project passing -DMLN_WO_GLOBAL_VARS. Then, at the top of one of the files which includes Olena headers, add:
Here is a small example.
This example can be compiled with the following command:
$ g++ -DNDEBUG -O2 -DMLN_WO_GLOBAL_VARS -Ipath/to/mln main.cc f1.cc f2.cc
Note that the file where MLN_WO_GLOBAL_VARS is undefined must include olena headers to declare and compile the global variables.