$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Debugging

Functions

template<typename I , typename G , typename F >
void mln::debug::draw_graph (Image< I > &ima, const p_vertices< G, F > &pv, typename I::value vcolor, typename I::value ecolor)
template<typename I , typename G , typename F , typename V , typename E >
void mln::debug::draw_graph (Image< I > &ima, const p_vertices< G, F > &pv, const Function< V > &vcolor_f, const Function< E > &ecolor_f, unsigned vwidth)
template<typename I , typename G , typename F , typename V , typename E >
void mln::debug::draw_graph (Image< I > &ima, const p_vertices< util::line_graph< G >, F > &pv, const Function< V > &vcolor_f, const Function< E > &ecolor_f)
std::string mln::debug::filename (const std::string &filename, int id)
template<typename T >
const Tmln::debug::format (const T &v)
char mln::debug::format (bool v)
signed short mln::debug::format (signed char v)
unsigned short mln::debug::format (unsigned char v)
template<typename T >
void mln::debug::histo (const mln::histo::array< T > &h, const std::string &filename)
template<typename I >
void mln::debug::iota (Image< I > &input, unsigned base_index)
template<typename I >
mln::trait::concrete< I >::ret mln::debug::mosaic (const util::array< I > &input, unsigned n_horizontal, const typename I::value &bg)
template<typename I >
void mln::debug::println (const Image< I > &input)
template<typename I >
void mln::debug::println (const std::string &msg, const Image< I > &input)
template<typename I >
void mln::debug::println_with_border (const Image< I > &input)
void mln::debug::put_word (image2d< char > &inout, const point2d &word_start, const std::string &word)
template<typename I >
image2d< typename I::value > mln::debug::slices_2d (const Image< I > &input, unsigned n_horizontal, unsigned n_vertical, const typename I::value &bg)
template<typename I >
image2d< typename I::value > mln::debug::slices_2d (const Image< I > &input, float ratio_hv, const typename I::value &bg)
template<typename I , typename J >
mln::trait::ch_value< I,
value::rgb8 >::ret 
mln::debug::superpose (const Image< I > &input_, const Image< J > &object_, const value::rgb8 &object_color)
template<typename I , typename J >
mln::trait::ch_value< I,
value::rgb8 >::ret 
mln::debug::superpose (const Image< I > &input, const Image< J > &object)
template<typename I >
void mln::debug::z_order (Image< I > &input)

Variables

std::string mln::debug::internal::filename_prefix
bool mln::debug::quiet

Detailed Description

All routines for debugging Milena based programs..

Function Documentation

template<typename I , typename G , typename F >
void mln::debug::draw_graph ( Image< I > &  ima,
const p_vertices< G, F > &  pv,
typename I::value  vcolor,
typename I::value  ecolor 
)

Draw an image ima from a mln::p_vertices pv.

Colors for vertices are defined through vcolor. Colors for edges are defined though ecolor. Background is set to 0.

Parameters
[in,out]imaThe image to be drawn.
[in]pvThe p_vertices which contains vertices positions.
[in]vcolorThe value to assign to pixels which contains vertices.
[in]ecolorThe value to assign to pixels which contains edges.
template<typename I , typename G , typename F , typename V , typename E >
void mln::debug::draw_graph ( Image< I > &  ima,
const p_vertices< G, F > &  pv,
const Function< V > &  vcolor_f,
const Function< E > &  ecolor_f,
unsigned  vwidth 
)

Draw an image ima from a mln::p_vertices pv.

Colors for vertices are defined through vcolor_f_. Colors for edges are defined though ecolor_f_. Vertices are drawn with squares of width vwidth.

Parameters
[in,out]imaThe image to be drawn.
[in]pvThe p_vertices which contains vertices positions.
[in]vcolor_fA function returning a color value for vertices.
[in]ecolor_fA function returning a color value for edges.
[in]vwidthWidth of the squares representing the vertices.
template<typename I , typename G , typename F , typename V , typename E >
void mln::debug::draw_graph ( Image< I > &  ima,
const p_vertices< util::line_graph< G >, F > &  pv,
const Function< V > &  vcolor_f,
const Function< E > &  ecolor_f 
)
inline

Draw an image ima from a mln::p_vertices pv.

Colors for vertices are defined through vcolor_f_. Colors for edges are defined though ecolor_f_.

Parameters
[in,out]imaThe image to be drawn.
[in]pvThe p_vertices which contains vertices positions.
[in]vcolor_fA function returning a color value for vertices.
[in]ecolor_fA function returning a color value for edges.
std::string mln::debug::filename ( const std::string &  filename,
int  id 
)

Constructs and returns a formatted output file name.

The file name is formatted as follow:

filename_prefix_id_filename

Where:

  • filename_prefix can be set through the global variable debug::internal::filename_prefix.
  • postfix_id is autoincremented by default. Its value can be forced.
  • filename is the given filename
template<typename T >
const T& mln::debug::format ( const T v)

Default version for formatting a value is a no-op.

char mln::debug::format ( bool  v)

Format a Boolean to print it nicely: "|" for true and "-" for false.

signed short mln::debug::format ( signed char  v)

Format a signed char to print it properly, i.e., like an integer value.

unsigned short mln::debug::format ( unsigned char  v)

Format an unsigned char to print it properly, i.e., like an integer value.

template<typename T >
void mln::debug::histo ( const mln::histo::array< T > &  h,
const std::string &  filename 
)

Save a histogram to a plot data file.

template<typename I >
void mln::debug::iota ( Image< I > &  input,
unsigned  base_index 
)

Fill the image input with successive values.

Parameters
[in,out]inputThe image in which values are assigned.
[in]base_indexStart numbering from this value.
template<typename I >
mln::trait::concrete< I >::ret mln::debug::mosaic ( const util::array< I > &  input,
unsigned  n_horizontal,
const typename I::value &  bg 
)

Create a single image from an array of image.

The size of the output image is defined by:

width = n_horizontal * max(input[i].ncols()) height = (input.size() / n_horizontal) * max(input[i].nrows())

Returns
a single image where all the input images are displayed as a mosaic.
template<typename I >
void mln::debug::println ( const Image< I > &  input)

Print the image input on the standard output.

template<typename I >
void mln::debug::println ( const std::string &  msg,
const Image< I > &  input 
)

Print the message msg and the image input on the standard output.

template<typename I >
void mln::debug::println_with_border ( const Image< I > &  input)

Print the image input on the standard output.

void mln::debug::put_word ( image2d< char > &  inout,
const point2d &  word_start,
const std::string &  word 
)
inline

Put the word starting at location word_start in the image inout.

template<typename I >
image2d<typename I ::value> mln::debug::slices_2d ( const Image< I > &  input,
unsigned  n_horizontal,
unsigned  n_vertical,
const typename I::value &  bg 
)

Create a 2D image of the slices of the 3D image input.

template<typename I >
image2d<typename I ::value> mln::debug::slices_2d ( const Image< I > &  input,
float  ratio_hv,
const typename I::value &  bg 
)

Create a 2D image of the slices of the 3D image input.

template<typename I , typename J >
mln::trait::ch_value< I , value::rgb8 >::ret mln::debug::superpose ( const Image< I > &  input_,
const Image< J > &  object_,
const value::rgb8 &  object_color 
)

Superpose two images.

Parameters
[in]input_An image. Its value type must be convertible toward value::rgb8 thanks to a conversion operator or convert::from_to.
[in]object_A scalar or labeled image. Objects used for superposition. have their pixel values different from 0.
[in]object_colorThe color used to draw the objects in object_.
Precondition
input_ and object_ must have the same domain.
Returns
A color image.
template<typename I , typename J >
mln::trait::ch_value< I , value::rgb8 >::ret mln::debug::superpose ( const Image< I > &  input,
const Image< J > &  object 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<typename I >
void mln::debug::z_order ( Image< I > &  input)

Fill the image input with Z-order (curve) values.

Parameters
[in,out]inputThe image in which values are assigned.

Reference: http://en.wikipedia.org/wiki/Z-order_(curve)

Variable Documentation

std::string mln::debug::internal::filename_prefix

Filename prefix used for debug images.

bool mln::debug::quiet

Global variable telling whether the debug should be printed or not.