$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mln::neighb1d Class Reference

#include <mln/core/alias/neighb1d.hh>

Public Member Functions

void change_window (const W &new_win)
unsigned delta () const
const W::dpsite & dp (unsigned i) const
W & hook_win_ ()
bool is_valid () const
unsigned size () const
const W & win () const

Public Types

typedef neighb_bkd_niter
< window1d
bkd_niter
typedef Neighborhood< void > category
typedef W::dpsite dpsite
typedef E exact_t
typedef neighb_fwd_niter
< window1d
fwd_niter
typedef fwd_niter niter
typedef W::psite psite
typedef W::site site
typedef W window

Related Functions

(Note that these are not member functions.)

template<typename I , typename N >
util::array< intnegative_offsets_wrt (const Image< I > &ima, const Neighborhood< N > &nbh)
template<typename I , typename N >
util::array< intoffsets_wrt (const Image< I > &ima, const Neighborhood< N > &nbh)
template<typename N >
std::ostream & operator<< (std::ostream &ostr, const Neighborhood< N > &nbh)
template<typename L , typename R >
bool operator== (const Neighborhood< L > &lhs, const Neighborhood< R > &rhs)
template<typename I , typename N >
util::array< intpositive_offsets_wrt (const Image< I > &ima, const Neighborhood< N > &nbh)

Detailed Description

Type alias for a neighborhood defined on the 1D square grid with integer coordinates.

A neigh1d can be constructed from a window1d. Compared to a window, a neighborhood does not include the central point.

window1d      neighb1d
 x x x   -->   x o x

Common 1D neighborhoods are predefined and can be used directly: mln::c2(). An exhaustive list can be found in section 1D neighborhoods.

The list of dpoint1d included in a neighb1d is accessible from window1d::std_vector() method or simply by iterating over this list:

neighb1d nbh = c2();
for (int i = 0; i < nbh.win().size(); ++i)
std::cout << nbh.win().dp(i) << std::endl;

Iterating over the neighbors of a specific point is performed thanks to n-iterators, as follows:

neighb1d nbh = c2();
mln_niter(neighb1d) n(nbh, p);
for_all(n)
// n is a point1d, neighbor of p.
std::cout << n << std::endl;

It also works while iterating the sites of an image domain:

image1d<bool> ima(4);
neighb1d nbh = c2();
mln_piter(image1d<bool>) p(ima.domain());
mln_niter(neighb1d) n(nbh, p);
for_all(p)
for_all(n)
// n is a point1d, neighbor of the current p.
std::cout << n << std::endl;
See Also
make::neighb1d, dpoint1d, window1d

Definition at line 6 of file neighb1d.dox.

Member Function Documentation

template<typename W, typename E>
void mln::internal::neighb_base< W, E >::change_window ( const W &  new_win)
inherited

Change the corresponding window.

template<typename W, typename E>
unsigned mln::internal::neighborhood_impl< W, E >::delta ( ) const
inherited

Give the maximum coordinate gap between the neighborhood center and a neighboring point.

template<typename W, typename E>
const W ::dpsite& mln::internal::neighborhood_impl< W, E >::dp ( unsigned  i) const
inherited

Give the maximum coordinate gap between the neighborhood center and a neighboring point.

template<typename W, typename E>
W& mln::internal::neighb_base< W, E >::hook_win_ ( )
inherited

INTERNAL_API

Hook to the window.

template<typename W, typename E>
bool mln::internal::neighborhood_base< W, E >::is_valid ( ) const
inherited

Return true by default.

template<typename W, typename E>
unsigned mln::internal::neighborhood_impl< W, E >::size ( ) const
inherited

Give the neighborhood size, i.e., the number of elements it contains.

template<typename W, typename E>
const W& mln::internal::neighb_base< W, E >::win ( ) const
inherited

Get the corresponding window.

Friends And Related Function Documentation

template<typename I , typename N >
util::array< int > negative_offsets_wrt ( const Image< I > &  ima,
const Neighborhood< N > &  nbh 
)
related
template<typename I , typename N >
util::array< int > offsets_wrt ( const Image< I > &  ima,
const Neighborhood< N > &  nbh 
)
related
template<typename N >
std::ostream & operator<< ( std::ostream &  ostr,
const Neighborhood< N > &  nbh 
)
related
template<typename L , typename R >
bool operator== ( const Neighborhood< L > &  lhs,
const Neighborhood< R > &  rhs 
)
related
template<typename I , typename N >
util::array< int > positive_offsets_wrt ( const Image< I > &  ima,
const Neighborhood< N > &  nbh 
)
related

Member Typedef Documentation

Backward site iterator associated type.

Definition at line 69 of file neighb.hh.

template<typename E>
typedef Neighborhood<void> mln::Neighborhood< E >::category
inherited

Definition at line 69 of file core/concept/neighborhood.hh.

template<typename W, typename E>
typedef W ::dpsite mln::internal::neighborhood_base< W, E >::dpsite
inherited

Dpsite associated type.

Definition at line 129 of file neighborhood_base.hh.

template<typename E>
typedef E mln::Object< E >::exact_t
inherited

Definition at line 105 of file object.hh.

Forward site iterator associated type.

Definition at line 66 of file neighb.hh.

typedef fwd_niter mln::neighb< window1d >::niter
inherited

Site iterator associated type.

Definition at line 72 of file neighb.hh.

template<typename W, typename E>
typedef W ::psite mln::internal::neighborhood_base< W, E >::psite
inherited

Psite associated type.

Definition at line 132 of file neighborhood_base.hh.

template<typename W, typename E>
typedef W ::site mln::internal::neighborhood_base< W, E >::site
inherited

Site associated type.

Definition at line 135 of file neighborhood_base.hh.

template<typename W, typename E>
typedef W mln::internal::neighborhood_base< W, E >::window
inherited

Window associated type.

Definition at line 126 of file neighborhood_base.hh.