Filtering and combining

These classes and functions are related to filtering and combining of 2D and 3D images. More...

Data Structures

class  C2DFifoFilterPlugin
 The plug-in base class for the FIFO filters. More...
 
class  C2DFuzzyClusterSolver
 A solver for the fuzzy segmentation smoothness constraint. More...
 
class  C2DImageFifoFilter
 The class to provide filtering of series of 2D images as if they where 3D images. More...
 
class  C2DSolveCG
 solve_sCG – a class providing a CG solver More...
 
struct  FDeformer2D
 
class  solve_sCG
 a class providing a CG solver More...
 
class  TCST2DKernel< T >
 Base class for cos/sin transformation filters. More...
 
class  TDataFilter< D >
 Generic interface class to data filters. More...
 
class  TDataFilterPlugin< Image >
 Generic image filter plugin base. More...
 
class  TFifoFilter< T >
 Generic base class for out-of-core FIFO filters. More...
 
struct  TFilter< R >
 base class for all filer type functors. More...
 
class  TFilterChain< Handler >
 create and use a chain of filters More...
 
class  TImageCreator< T >
 The base class for generic image creation. More...
 
class  TWatershed< dim >
 templated version of the standard watershed algorithm More...
 
class  TWatershedFilterPlugin< dim >
 plugin for the templated version of the standard watershed algorithm More...
 

Typedefs

typedef THandlerSingleton< TFactoryPluginHandler< C2DFifoFilterPlugin > > C2DFifoFilterPluginHandler
 Plugin handler for the FIFO filters. More...
 
typedef TDataFilter< C2DImageC2DFilter
 
typedef TDataFilterPlugin< C2DImageC2DFilterPlugin
 
typedef THandlerSingleton< TFactoryPluginHandler< C2DFilterPlugin > > C2DFilterPluginHandler
 
typedef TImageCombiner< C2DImageC2DImageCombiner
 2D Image combiner More...
 
typedef TFilterChain< C2DFilterPluginHandlerC2DImageFilterChain
 
typedef TDataFilter< C3DImageC3DFilter
 Base class for 3D image filters. Filters are implemented as plug-ins. More...
 
typedef TDataFilterPlugin< C3DImageC3DFilterPlugin
 The 3D filter plugin type. More...
 
typedef THandlerSingleton< TFactoryPluginHandler< C3DFilterPlugin > > C3DFilterPluginHandler
 The 3D filter plugin handler. More...
 
typedef TImageCombiner< C3DImageC3DImageCombiner
 Base class for plug-ins that combine two 3D images in certain ways. More...
 
typedef TFilterChain< C3DFilterPluginHandlerC3DImageFilterChain
 3D filter chain to apply various filters in one run More...
 
typedef TFilterChain< CMeshFilterPluginHandlerCMeshFilterChain
 
typedef TDataFilterPlugin< CTriangleMeshCMeshFilterPlugin
 
typedef THandlerSingleton< TFactoryPluginHandler< CMeshFilterPlugin > > CMeshFilterPluginHandler
 
typedef std::shared_ptr< C2DFilterP2DFilter
 
typedef TFifoFilter< P2DImage >::Pointer P2DImageFifoFilter
 Pointer type for the FIFO filter. More...
 
typedef std::shared_ptr< C3DFilterP3DFilter
 The 3D filter shared pointer. More...
 
typedef std::shared_ptr< CMeshFilterPMeshFilter
 

Functions

template<typename F , typename B >
static F::result_type accumulate (F &f, const B &data)
 
template<typename F , typename A , typename B >
static F::result_type accumulate (F &f, const A &a, const B &b)
 */ More...
 
template<typename S >
std::vector< P3DFiltercreate_filter_chain (const std::vector< S > &chain)
 Convenience function to create a filter chain from a series of filter descriptions. More...
 
 DEFINE_Image_Creator (C3DImage)
 The 3D specialization of the TImageCreator template. More...
 
bool fborder (long index, long nx, long ny, long nz)
 function defining field borders More...
 
template<typename F , typename B >
static F::result_type filter (const F &f, const B &b)
 
template<typename F , typename A , typename B >
static F::result_type filter (const F &f, const A &a, const B &b)
 */ More...
 
template<typename F , typename B , typename O >
static F::result_type filter_and_output (const F &f, const B &a, O &b)
 
template<typename F , typename B >
static F::result_type filter_equal (const F &f, const B &a, const B &b)
 
template<typename F , typename B >
static void filter_equal_inplace (const F &f, const B &a, B &b)
 
template<typename F , typename B >
static F::result_type filter_inplace (const F &f, B &b)
 
EXPORT_2D P2DImage fuzzy_segment_2d (const C2DImage &src, size_t noOfClasses, const SFuzzySegParams &residuum, C2DImageVector &classes, P2DImage &gain)
 Run a fuzzy c-mean segmentation with gain field correction. More...
 
EXPORT_3D P3DImage fuzzy_segment_3d (const C3DImage &src, size_t noOfClasses, float residuum, C3DImageVector &classes)
 Fuzzy c-means segmentation with gain field estimation. More...
 
PTriangleMesh EXPORT_MESH run_filter (const CTriangleMesh &mesh, const char *filter)
 
PTriangleMesh run_filter (PTriangleMesh mesh, const char *filter)
 
P2DImage EXPORT_2D run_filter (const C2DImage &image, const char *filter)
 
P2DImage EXPORT_2D run_filter (P2DImage image, const char *filter)
 
P3DImage EXPORT_3D run_filter (const C3DImage &image, const char *filter)
 convenience function: create and run a filter on an image More...
 
PTriangleMesh EXPORT_MESH run_filter_chain (PTriangleMesh mesh, const std::vector< const char *> &filters)
 
P2DImage EXPORT_2D run_filter_chain (P2DImage image, size_t nfilters, const char *filters[]) __attribute__((deprecated))
 
P2DImage EXPORT_2D run_filter_chain (P2DImage image, const std::vector< const char *> &filters)
 
P3DImage EXPORT_3D run_filter_chain (P3DImage image, const std::vector< const char *> &filters)
 
template<typename PData , typename... Filters>
PData run_filters (PData image, Filters... filters)
 run a chain of filters on an input image More...
 

Detailed Description

These classes and functions are related to filtering and combining of 2D and 3D images.

Typedef Documentation

◆ C2DFifoFilterPluginHandler

Plugin handler for the FIFO filters.

Definition at line 162 of file 2dimagefifofilter.hh.

◆ C2DFilter

2D image filter

Definition at line 36 of file 2d/filter.hh.

◆ C2DFilterPlugin

2D image filter plugin

Definition at line 42 of file 2d/filter.hh.

◆ C2DFilterPluginHandler

2D filter plugin handler

Definition at line 54 of file 2d/filter.hh.

◆ C2DImageCombiner

2D Image combiner

A class to provides the base for operations that combine two images to create a new image

Definition at line 124 of file 2d/filter.hh.

◆ C2DImageFilterChain

2D filter chain to apply various filters in one run

Definition at line 73 of file 2d/filter.hh.

◆ C3DFilter

Base class for 3D image filters. Filters are implemented as plug-ins.

Definition at line 43 of file 3d/filter.hh.

◆ C3DFilterPlugin

The 3D filter plugin type.

Definition at line 49 of file 3d/filter.hh.

◆ C3DFilterPluginHandler

The 3D filter plugin handler.

Definition at line 55 of file 3d/filter.hh.

◆ C3DImageCombiner

Base class for plug-ins that combine two 3D images in certain ways.

This class is the base class for all combiners that are used to combine two 3D images. The result of the combination can be anything derived from CCombinerResult.

Definition at line 70 of file 3d/filter.hh.

◆ C3DImageFilterChain

3D filter chain to apply various filters in one run

Definition at line 116 of file 3d/filter.hh.

◆ CMeshFilterChain

2D filter chain to apply various filters in one run

Definition at line 71 of file mesh/filter.hh.

◆ CMeshFilterPlugin

2D image filter plugin

Definition at line 40 of file mesh/filter.hh.

◆ CMeshFilterPluginHandler

2D filter plugin handler

Definition at line 52 of file mesh/filter.hh.

◆ P2DFilter

typedef std::shared_ptr<C2DFilter > P2DFilter

shared pointer type for the C2DFilter class

Definition at line 48 of file 2d/filter.hh.

◆ P2DImageFifoFilter

Pointer type for the FIFO filter.

Definition at line 141 of file 2dimagefifofilter.hh.

◆ P3DFilter

typedef std::shared_ptr<C3DFilter> P3DFilter

The 3D filter shared pointer.

Definition at line 61 of file 3d/filter.hh.

◆ PMeshFilter

typedef std::shared_ptr<CMeshFilter > PMeshFilter

shared pointer type for the C2DFilter class

Definition at line 46 of file mesh/filter.hh.

Function Documentation

◆ accumulate() [1/2]

template<typename F , typename B >
static F::result_type accumulate ( F &  f,
const B &  data 
)
static

A accumulator function that handles data containers of different types. The data container is provided by a pointer or reference to its type independen base class. Data type dependency is introduced by using a templated derivative. The accumulator object is not const and can be used to accumulate data.

Parameters
fa accumulator to be applied to the data.
datathe input data to be filtered
Returns
whathever the filter f defines as return type and provides as a result of its operator ()

Definition at line 317 of file core/filter.hh.

References it_bit, it_double, it_float, it_sbyte, it_sint, it_slong, it_sshort, it_ubyte, it_uint, it_ulong, and it_ushort.

Referenced by kmeans().

◆ accumulate() [2/2]

template<typename F , typename A , typename B >
static F::result_type accumulate ( F &  f,
const A &  a,
const B &  b 
)
static

*/

A accumulatro type that handles data containers of different types. The data container is provided by a pointer or reference to its type independedn base class. Data type dependency is introduced by using a templated derivative. Input objects can be of different types

Parameters
fa filter to be applied to the data.
ainput data to be filtered
binput data to be filtered
Returns
whathever the filter f defines as return type and provides as a result of its operator ()

Definition at line 588 of file core/filter.hh.

References it_bit, it_double, it_float, it_sbyte, it_sint, it_slong, it_sshort, it_ubyte, it_uint, it_ulong, and it_ushort.

◆ create_filter_chain()

template<typename S >
std::vector<P3DFilter> create_filter_chain ( const std::vector< S > &  chain)

Convenience function to create a filter chain from a series of filter descriptions.

Parameters
chainthe descriptions
Returns
the filter chain as a vector
Remarks
obsolete, should use C3DImageFilterChain

Definition at line 94 of file 3d/filter.hh.

References cvdebug(), filter(), and THandlerSingleton< T >::instance().

◆ DEFINE_Image_Creator()

DEFINE_Image_Creator ( C3DImage  )

The 3D specialization of the TImageCreator template.

◆ fborder()

bool fborder ( long  index,
long  nx,
long  ny,
long  nz 
)

function defining field borders

Parameters
indexindex running from 0 to NoOfPixels
nxno of pixels in x
nyno of pixels in y
nzno of pixels in z

◆ filter() [1/2]

template<typename F , typename B >
static F::result_type filter ( const F &  f,
const B &  b 
)
static

A filter type that handles data containers of different types. The data container is provided by a pointer or reference to its type independedn base class. Data type dependency is introduced by using a templated derivative. The filter object is const.

Template Parameters
aFilter that must provide a type result_type, and an operator template < typename T > F::result_type F::operator()(const D<T>& b) const; with D<T> being a derived class of B
bthe data to be processed in form of a reference to the base class of a class template D<T>
Parameters
fa filter to be applied to the data.
bthe input data to be filtered
Returns
whathever the filter F defines as return type and provides as a result of its operator ()

Definition at line 250 of file core/filter.hh.

References it_bit, it_double, it_float, it_sbyte, it_sint, it_slong, it_sshort, it_ubyte, it_uint, it_ulong, and it_ushort.

Referenced by create_filter_chain(), normalize(), TWatershed< dim >::operator()(), FConvert3DImageToPixeltypeO< O >::operator()(), FConvert2DImageToPixeltypeO< O >::operator()(), produce_3dimage_filter(), TFilterChain< Handler >::push_back(), and TFilterChain< Handler >::push_front().

◆ filter() [2/2]

template<typename F , typename A , typename B >
static F::result_type filter ( const F &  f,
const A &  a,
const B &  b 
)
static

*/

A filter type that handles data containers of different types. The data container is provided by a pointer or reference to its type independedn base class. Data type dependency is introduced by using a templated derivative. Input objects can be of different types

Parameters
fa filter to be applied to the data.
ainput data to be filtered
binput data to be filtered
Returns
whathever the filter f defines as return type and provides as a result of its operator ()

Definition at line 529 of file core/filter.hh.

References it_bit, it_double, it_float, it_sbyte, it_sint, it_slong, it_sshort, it_ubyte, it_uint, it_ulong, and it_ushort.

◆ filter_and_output()

template<typename F , typename B , typename O >
static F::result_type filter_and_output ( const F &  f,
const B &  a,
O &  b 
)
static

A filter type that handles data containers of equal types. The data container is provided by a pointer or reference to its type independedn base class. Data type dependency is introduced by using a templated derivative. Both input objects need to use the same data type

Parameters
fa filter to be applied to the data.
ainput data to be filtered
boutput of filtered data

Definition at line 469 of file core/filter.hh.

References it_bit, it_double, it_float, it_sbyte, it_sint, it_slong, it_sshort, it_ubyte, it_uint, it_ulong, and it_ushort.

◆ filter_equal()

template<typename F , typename B >
static F::result_type filter_equal ( const F &  f,
const B &  a,
const B &  b 
)
static

A filter type that handles data containers of different types. The data container is provided by a pointer or reference to its type independedn base class. Data type dependency is introduced by using a templated derivative. Both input objects need to use the same data type

Parameters
fa filter to be applied to the data.
ainput data to be filtered
binput data to be filtered
Returns
whathever the filter f defines as return type and provides as a result of its operator ()

Definition at line 399 of file core/filter.hh.

References it_bit, it_double, it_float, it_sbyte, it_sint, it_slong, it_sshort, it_ubyte, it_uint, it_ulong, and it_ushort.

◆ filter_equal_inplace()

template<typename F , typename B >
static void filter_equal_inplace ( const F &  f,
const B &  a,
B &  b 
)
static

A filter type that handles data containers of equal types. The data container is provided by a pointer or reference to its type independedn base class. Data type dependency is introduced by using a templated derivative. Both input objects need to use the same data type

Parameters
fa filter to be applied to the data.
ainput data to be filtered
boutput of filtered data

Definition at line 434 of file core/filter.hh.

References it_bit, it_double, it_float, it_sbyte, it_sint, it_slong, it_sshort, it_ubyte, it_uint, it_ulong, and it_ushort.

◆ filter_inplace()

template<typename F , typename B >
static F::result_type filter_inplace ( const F &  f,
B &  b 
)
static

The in-place type of the function typename F::result_type filter(const F& f, const B& b). A filter type that handles data containers of different types. The data container is provided by a pointer or reference to its type independedn base class. Data type dependency is introduced by using a templated derivative. The filter object is const.

Parameters
fa filter to be applied to the data.
bthe input data to be filtered
Returns
whathever the filter f defines as return type and provides as a result of its operator ()

Definition at line 284 of file core/filter.hh.

References it_bit, it_double, it_float, it_sbyte, it_sint, it_slong, it_sshort, it_ubyte, it_uint, it_ulong, and it_ushort.

◆ fuzzy_segment_2d()

EXPORT_2D P2DImage fuzzy_segment_2d ( const C2DImage src,
size_t  noOfClasses,
const SFuzzySegParams residuum,
C2DImageVector classes,
P2DImage gain 
)

Run a fuzzy c-mean segmentation with gain field correction.

This function runs a fuzzy c-means segmentation with B-field correction in the input data set according to D.L. Pham and J.L.Prince, "An adaptive fuzzy C-means algorithm for image segmentation in the presence of intensity inhomogeneities", Pat. Rec. Let., 20:57-68,1999

Parameters
[in]srcthe input image
[in]noOfClassesnumber of segmentation classes
[in]residuumlimit for optimization
[out]classesprobability images after segmentation
[out]gainmultiplicative gain field
Returns
the B-field corrected image

Referenced by SFuzzySegParams::SFuzzySegParams().

◆ fuzzy_segment_3d()

EXPORT_3D P3DImage fuzzy_segment_3d ( const C3DImage src,
size_t  noOfClasses,
float  residuum,
C3DImageVector classes 
)

Fuzzy c-means segmentation with gain field estimation.

This function runs a fuzzy c-means segmentation with B-field correction in the input data set.

Parameters
[in]srcthe input image
[in]noOfClassesnumber of segmentation classes
[in]residuumlimit for optimization
[out]classesprobability images after segmentation
Returns
the B-field corrected image

◆ run_filter() [1/5]

PTriangleMesh EXPORT_MESH run_filter ( const CTriangleMesh mesh,
const char *  filter 
)

convenience function: create and run a filter on an mesh

Parameters
meshinput mesh
filterstring defining the filter to be applied
Returns
the filtered mesh

Referenced by run_filter().

◆ run_filter() [2/5]

PTriangleMesh run_filter ( PTriangleMesh  mesh,
const char *  filter 
)
inline

convenience function: create and run a filter on an mesh

Parameters
meshinput mesh
filterstring defining the filter to be applied
Returns
the filtered mesh

Definition at line 98 of file mesh/filter.hh.

References NS_MIA_END, and run_filter().

◆ run_filter() [3/5]

P2DImage EXPORT_2D run_filter ( const C2DImage image,
const char *  filter 
)

convenience function: create and run a filter on an image

Parameters
imageinput image
filterstring defining the filter to be applied
Returns
the filtered image

Referenced by run_filter().

◆ run_filter() [4/5]

P2DImage EXPORT_2D run_filter ( P2DImage  image,
const char *  filter 
)
inline

convenience function: create and run a filter on an image

Parameters
imageinput image
filterstring defining the filter to be applied
Returns
the filtered image

Definition at line 112 of file 2d/filter.hh.

References run_filter().

◆ run_filter() [5/5]

P3DImage EXPORT_3D run_filter ( const C3DImage image,
const char *  filter 
)

convenience function: create and run a filter on an image

Parameters
imageinput image
filterstring defining the filter to be applied
Returns
the filtered image

Referenced by produce_3dimage_filter().

◆ run_filter_chain() [1/4]

PTriangleMesh EXPORT_MESH run_filter_chain ( PTriangleMesh  mesh,
const std::vector< const char *> &  filters 
)

convenience function: run a filter chain on an mesh

Parameters
meshinput mesh
filtersvector of strings defining the filter to be applied
Returns
the filtered mesh

◆ run_filter_chain() [2/4]

P2DImage EXPORT_2D run_filter_chain ( P2DImage  image,
size_t  nfilters,
const char *  filters[] 
)

convenience function: run a filter chain on an image

Parameters
imageinput image
nfiltersnumber of filter definitions following
filtersarray of strings defining the filter to be applied
Returns
the filtered image

◆ run_filter_chain() [3/4]

P2DImage EXPORT_2D run_filter_chain ( P2DImage  image,
const std::vector< const char *> &  filters 
)

convenience function: run a filter chain on an image

Parameters
imageinput image
filtersvector of strings defining the filter to be applied
Returns
the filtered image

◆ run_filter_chain() [4/4]

P3DImage EXPORT_3D run_filter_chain ( P3DImage  image,
const std::vector< const char *> &  filters 
)

convenience function: run a filter chain on an image

Parameters
imageinput image
filtersvector of strings defining the filter to be applied
Returns
the filtered image

Referenced by produce_3dimage_filter().

◆ run_filters()

template<typename PData , typename... Filters>
PData run_filters ( PData  image,
Filters...  filters 
)

run a chain of filters on an input image

This template is used to run a chain of filters on an input image The filters can be described by strings, or given as already created filters

Template Parameters
PDatathe image pointer type of the image to be filtered
Filtersthe filter description types or filters

Definition at line 134 of file filter_chain.hh.