mln::data Namespace Reference

Namespace of image processing routines related to pixel data. More...


Namespaces

namespace  approx
 Namespace of image processing routines related to pixel levels with approximation.
namespace  impl
 Implementation namespace of data namespace.
namespace  naive
 Namespace of image processing routines related to pixel levels with naive approach.

Functions

template<typename I , typename O >
void abs (const Image< I > &input, Image< O > &output)
template<typename I >
void abs_inplace (Image< I > &input)
template<typename I , typename F >
void apply (Image< I > &input, const Function_v2v< F > &f)
template<typename A , typename I >
A::result compute (const Accumulator< A > &a, const Image< I > &input)
 Compute an accumulator onto the pixel values of the image input.
template<typename V , typename I >
mln::trait::ch_value< I, V >::ret convert (const V &v, const Image< I > &input)
 Convert the image input by changing the value type.
template<typename I , typename W , typename O >
void fast_median (const Image< I > &input, const Window< W > &win, Image< O > &output)
template<typename I , typename D >
void fill (Image< I > &ima, const D &data)
template<typename I , typename J >
void fill_with_image (Image< I > &ima, const Image< J > &data)
 Fill the image ima with the values of the image data.
template<typename I , typename W >
mln::trait::concrete< I >::ret median (const Image< I > &input, const Window< W > &win)
template<typename A , typename I >
 mln_meta_accu_result (A, typename I::value) compute(const Meta_Accumulator< A > &a
 Compute an accumulator onto the pixel values of the image input.
template<typename I , typename J >
void paste (const Image< I > &input, Image< J > &output)
 Paste the contents of image input into the image output.
template<typename I , typename J >
void paste_without_localization (const Image< I > &input, Image< J > &output)
 Paste the contents of image input into the image output without taking into account the localization of sites.
template<typename I >
void replace (Image< I > &input, const typename I::value &old_value, const typename I::value &new_value)
template<typename I , typename V >
mln::trait::ch_value< I, V >::ret saturate (const Image< I > &input, const V &min, const V &max)
template<typename V , typename I >
mln::trait::ch_value< I, V >::ret saturate (V v, const Image< I > &input)
template<typename I >
void saturate_inplace (Image< I > &input, const typename I::value &min, const typename I::value &max)
template<typename I >
util::array< unsigned > sort_offsets_increasing (const Image< I > &input)
 Sort pixel offsets of the image input wrt increasing pixel values.
template<typename I >
p_array< typename I::psite > sort_psites_decreasing (const Image< I > &input)
template<typename I >
p_array< typename I::psite > sort_psites_increasing (const Image< I > &input)
template<typename V , typename I >
mln::trait::ch_value< I, V >::ret stretch (const V &v, const Image< I > &input)
 Generic implementation of data::stretch.
template<typename I , typename O >
void to_enc (const Image< I > &input, Image< O > &output)
template<typename I1 , typename I2 , typename F >
mln::trait::ch_value< I1,
typename F::result >::ret 
transform (const Image< I1 > &input1, const Image< I2 > &input2, const Function_vv2v< F > &f)
 Generic implementation of data::transform.
template<typename I , typename F >
mln::trait::ch_value< I,
typename F::result >::ret 
transform (const Image< I > &input, const Function_v2v< F > &f)
 Generic implementation of data::transform.
template<typename I1 , typename I2 , typename F >
void transform_inplace (Image< I1 > &ima, const Image< I2 > &aux, const Function_vv2v< F > &f)
 Generic implementation of transform_inplace.
template<typename I , typename F >
void transform_inplace (Image< I > &ima, const Function_v2v< F > &f)
 Generic implementation of transform_inplace.
template<typename A , typename I >
A::result update (Accumulator< A > &a, const Image< I > &input)
 Generic implementation of data::update.
template<typename I , typename V >
void fill_with_value (Image< I > &ima, const V &val)
 Fill the whole image ima with the single value v.


Detailed Description

Namespace of image processing routines related to pixel data.


Function Documentation

template<typename I , typename O >
void mln::data::abs ( const Image< I > &  input,
Image< O > &  output 
) [inline]

Apply the absolute value (abs) function to image pixel values.

Parameters:
[in] input The input image.
[out] output The output image.

References transform().

template<typename I >
void mln::data::abs_inplace ( Image< I > &  input  )  [inline]

Apply the absolute value (abs) function to image pixel values.

Parameters:
[in,out] input The input image.

References apply().

template<typename I , typename F >
void mln::data::apply ( Image< I > &  input,
const Function_v2v< F > &  f 
) [inline]

Apply a function-object to the image input.

Parameters:
[in,out] input The input image.
[in] f The function-object.
This routine runs:
for all p of input, input(p) = f( input(p) )

This routine is equivalent to data::tranform(input, f, input) but it is faster since a single iterator is required.

Referenced by abs_inplace(), and saturate_inplace().

template<typename A , typename I >
A::result mln::data::compute ( const Accumulator< A > &  ,
const Image< I > &  input_ 
) [inline]

Compute an accumulator onto the pixel values of the image input.

Parameters:
[in] a An accumulator.
[in] input The input image.
Returns:
The accumulator result.
It fully relies on data::update.

Compute an accumulator onto the pixel values of the image input.

Parameters:
[in] input The input image.
[in] a An accumulator.
This routine runs:
a.take(make::pix(input, p)); on all pixels on the images.

Warning:
This routine does not perform a.init().

Referenced by mln::estim::mean(), mln::estim::min_max(), and mln::estim::sum().

template<typename V , typename I >
mln::trait::ch_value< I, V >::ret mln::data::convert ( const V &  v,
const Image< I > &  input 
) [inline]

Convert the image input by changing the value type.

Parameters:
[in] v A value of the destination type.
[in] input The input image.

References mln::data::impl::generic::transform().

Referenced by mln::morpho::watershed::superpose(), and mln::debug::superpose().

template<typename I , typename W , typename O >
void mln::data::fast_median ( const Image< I > &  input,
const Window< W > &  win,
Image< O > &  output 
) [inline]

Compute in output the median filter of image input by the window win.

Parameters:
[in] input The image to be filtered.
[in] win The window.
[in,out] output The output image.
Precondition:
input and output have to be initialized.

template<typename I , typename D >
void mln::data::fill ( Image< I > &  ima,
const D &  data 
) [inline]

template<typename I , typename J >
void mln::data::fill_with_image ( Image< I > &  ima_,
const Image< J > &  data_ 
) [inline]

Fill the image ima with the values of the image data.

Parameters:
[in,out] ima The image to be filled.
[in] data The image.
Warning:
The definition domain of ima has to be included in the one of data.
Precondition:
ima.domain <= data.domain.
Fill the image ima with the values of the image data.

Parameters:
[in,out] ima_ The image to be filled.
[in] data_ The image.

template<typename I , typename V >
void mln::data::fill_with_value ( Image< I > &  ima_,
const V &  val 
) [inline]

Fill the whole image ima with the single value v.

Parameters:
[in,out] ima The image to be filled.
[in] val The value to assign to all sites.
Precondition:
ima has to be initialized.
Parameters:
[in,out] ima_ The image to be filled.
[in] val The value to assign to all sites.
Precondition:
ima has to be initialized.

Referenced by mln::p_image< I >::clear().

template<typename I , typename W >
mln::trait::concrete< I >::ret mln::data::median ( const Image< I > &  input,
const Window< W > &  win 
) [inline]

Compute in output the median filter of image input by the window win.

Parameters:
[in] input The image to be filtered.
[in] win The window.
Precondition:
input have to be initialized.

References mln::extension::adjust(), and mln::initialize().

template<typename A , typename I >
mln::data::mln_meta_accu_result ( ,
typename I::value   
) const [inline]

Compute an accumulator onto the pixel values of the image input.

Parameters:
[in] a A meta-accumulator.
[in] input The input image.
Returns:
The accumulator result.

template<typename I , typename J >
void mln::data::paste ( const Image< I > &  input_,
Image< J > &  output_ 
) [inline]

Paste the contents of image input into the image output.

Parameters:
[in] input The input image providing pixels values.
[in,out] output The image in which values are assigned.
This routine runs:
for all p of input, output(p) = input(p).

Warning:
The definition domain of input has to be included in the one of output; so using mln::safe_image does not make pasting outside the output domain work.
Precondition:
input.domain <= output.domain
Paste the contents of image input into the image output.

Parameters:
[in] input_ The input image providing pixels values.
[in,out] output_ The image in which values are assigned.

Referenced by mln::make::image3d(), mln::draw::line(), mln::geom::rotate(), and mln::debug::slices_2d().

template<typename I , typename J >
void mln::data::paste_without_localization ( const Image< I > &  input,
Image< J > &  output 
) [inline]

Paste the contents of image input into the image output without taking into account the localization of sites.

Parameters:
[in] input The input image providing pixels values.
[in,out] output The image in which values are assigned.

template<typename I >
void mln::data::replace ( Image< I > &  input,
const typename I::value &  old_value,
const typename I::value &  new_value 
) [inline]

Replace old_value by new_value in the image input

Parameters:
[in] input The input image.
[in] old_value The value to be replaced...
[in] new_value ...by this one.

template<typename I , typename V >
mln::trait::ch_value< I, V >::ret mln::data::saturate ( const Image< I > &  input,
const V &  min,
const V &  max 
) [inline]

Apply the saturate function to image pixel values.

Parameters:
[in] input The input image.
[in] min The minimum output value.
[in] max The maximum output value.

References transform().

template<typename V , typename I >
mln::trait::ch_value< I, V >::ret mln::data::saturate ( v,
const Image< I > &  input 
) [inline]

Apply the saturate function to image pixel values.

Parameters:
[in] v A value of the output type.
[in] input The input image.
The saturation is based on the min and max values of the output value type. This assumes that the range of values in the input image is larger than the one of the output image.

References transform().

template<typename I >
void mln::data::saturate_inplace ( Image< I > &  input,
const typename I::value &  min,
const typename I::value &  max 
) [inline]

Apply the saturate function to image pixel values.

Parameters:
[in,out] input The input image.
[in] min The minimum output value.
[in] max The maximum output value

References apply().

template<typename I >
util::array< unsigned > mln::data::sort_offsets_increasing ( const Image< I > &  input  )  [inline]

Sort pixel offsets of the image input wrt increasing pixel values.

References mln::util::array< T >::append(), and mln::util::array< T >::reserve().

template<typename I >
p_array< typename I::psite > mln::data::sort_psites_decreasing ( const Image< I > &  input  )  [inline]

Sort psites the image input through a function f to set the output image in decreasing way.

Parameters:
[in] input The input image.
Precondition:
input.is_valid

template<typename I >
p_array< typename I::psite > mln::data::sort_psites_increasing ( const Image< I > &  input  )  [inline]

Sort psites the image input through a function f to set the output image in increasing way.

Parameters:
[in] input The input image.
Precondition:
input.is_valid

template<typename V , typename I >
mln::trait::ch_value< I, V >::ret mln::data::stretch ( const V &  v,
const Image< I > &  input 
) [inline]

Generic implementation of data::stretch.

Stretch the values of input so that they can be stored in output.

Parameters:
[in] v A value to set the output value type.
[in] input The input image.
Returns:
A stretch image with values of the same type as v.
Precondition:
input.is_valid
Parameters:
[in] v A value to set the output value type.
[in] input The input image.
Returns:
A stretch image with values of the same type as v.

References mln::initialize(), mln::estim::min_max(), mln::data::impl::stretch(), and transform().

Referenced by stretch().

template<typename I , typename O >
void mln::data::to_enc ( const Image< I > &  input,
Image< O > &  output 
) [inline]

Set the output image with the encoding values of the image input pixels.

Parameters:
[in] input The input image.
[out] output The result image.
Precondition:
output.domain >= input.domain

References transform().

template<typename I1 , typename I2 , typename F >
mln::trait::ch_value< I1, typename F::result >::ret mln::data::transform ( const Image< I1 > &  input1_,
const Image< I2 > &  input2_,
const Function_vv2v< F > &  f_ 
) [inline]

Generic implementation of data::transform.

Transform two images input1 input2 through a function f.

Parameters:
[in] input1 The 1st input image.
[in] input2 The 2nd input image.
[in] f The function.
This routine runs:
for all p of input, output(p) = f( input1(p), input2(p) ).

Parameters:
[in] input1_ The 1st input image.
[in] input2_ The 2nd input image.
[in] f_ The function.

References mln::initialize().

template<typename I , typename F >
mln::trait::ch_value< I, typename F::result >::ret mln::data::transform ( const Image< I > &  input_,
const Function_v2v< F > &  f_ 
) [inline]

Generic implementation of data::transform.

Transform the image input through a function f.

Parameters:
[in] input The input image.
[in] f The function.
This routine runs:
for all p of input, output(p) = f( input(p) ).

Parameters:
[in] input_ The input image.
[in] f_ The function.

References mln::initialize().

Referenced by abs(), mln::logical::and_not(), mln::labeling::colorize(), mln::data::impl::generic::convert(), mln::arith::diff_abs(), mln::linear::mln_ch_convolve_grad(), mln::labeling::pack(), mln::labeling::pack_inplace(), mln::labeling::relabel(), saturate(), mln::data::impl::stretch(), to_enc(), and mln::labeling::wrap().

template<typename I1 , typename I2 , typename F >
void mln::data::transform_inplace ( Image< I1 > &  ima_,
const Image< I2 > &  aux_,
const Function_vv2v< F > &  f_ 
) [inline]

Generic implementation of transform_inplace.

Transform inplace the image ima with the image aux through a function f.

Parameters:
[in] ima The image to be transformed.
[in] aux The auxiliary image.
[in] f The function.
This routine runs:
for all p of ima, ima(p) = f( ima(p), aux(p) ).

Parameters:
[in] ima_ The image to be transformed.
[in] aux_ The auxiliary image.
[in] f_ The function.

template<typename I , typename F >
void mln::data::transform_inplace ( Image< I > &  ima_,
const Function_v2v< F > &  f_ 
) [inline]

Generic implementation of transform_inplace.

Transform inplace the image ima through a function f.

Parameters:
[in,out] ima The image to be transformed.
[in] f The function.
This routine runs:
for all p of ima, ima(p) = f( ima(p) ).

Parameters:
[in,out] ima_ The image to be transformed.
[in] f_ The function.

Referenced by mln::logical::and_inplace(), mln::logical::and_not_inplace(), mln::logical::not_inplace(), mln::logical::or_inplace(), mln::labeling::relabel_inplace(), and mln::logical::xor_inplace().

template<typename A , typename I >
A::result mln::data::update ( Accumulator< A > &  a_,
const Image< I > &  input_ 
) [inline]

Generic implementation of data::update.

Update an accumulator with the pixel values of the image input.

Parameters:
[in] a The accumulator.
[in] input The input image.
Returns:
The accumulator result.
Parameters:
[in] a_ The accumulator.
[in] input_ The input image.
Returns:
The accumulator result.


Generated on Tue Jul 14 16:32:53 2009 for Milena (Olena) by  doxygen 1.5.9