2d/filter.hh
Go to the documentation of this file.
1 /* -*- mia-c++ -*-
2  *
3  * This file is part of MIA - a toolbox for medical image analysis
4  * Copyright (c) Leipzig, Madrid 1999-2013 Gert Wollny
5  *
6  * MIA is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with MIA; if not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 #ifndef mia_2d_filter_hh
22 #define mia_2d_filter_hh
23 
24 #include <mia/2d/image.hh>
25 #include <mia/core/factory.hh>
26 #include <mia/core/filter.hh>
28 
30 
36 
42 
47 typedef std::shared_ptr<C2DFilter > P2DFilter;
48 
54 
59 struct EXPORT_2D C2DFilterPluginHandlerTestPath {
60  C2DFilterPluginHandlerTestPath();
61 };
63 
67 
71 inline P2DFilter produce_2dimage_filter(const char* descr)
72 {
73  return C2DFilterPluginHandler::instance().produce(descr);
74 }
75 
76 
91 P2DImage EXPORT_2D run_filter_chain(P2DImage image, size_t nfilters, const char *filters[])
92  __attribute__((deprecated));
93 
102 P2DImage EXPORT_2D run_filter_chain(P2DImage image, const std::vector<const char *>& filters);
103 
111 P2DImage EXPORT_2D run_filter(const C2DImage& image, const char *filter);
112 
120 inline P2DImage EXPORT_2D run_filter(P2DImage image, const char *filter)
121 {
122  return run_filter(*image, filter);
123 }
124 
125 
132 class EXPORT_2D C2DImageCombiner : public TFilter< P2DImage > ,
133  public CProductBase {
134 public:
138  typedef combiner_type plugin_type;
139 
140  virtual ~C2DImageCombiner();
148  result_type combine( const C2DImage& a, const C2DImage& b) const;
149 private:
150  virtual result_type do_combine( const C2DImage& a, const C2DImage& b) const = 0;
151 };
152 
153 
154 
156 
158 
163 
165 
166 
167 #endif
THandlerSingleton< TFactoryPluginHandler< C2DFilterPlugin > > C2DFilterPluginHandler
Definition: 2d/filter.hh:53
the singleton that a plug-in handler really is
Definition: handler.hh:143
C2DImage::Pointer P2DImage
Shared pointer representation of the 2D Image.
Definition: 2d/image.hh:98
TDataFilter< C2DImage > C2DFilter
Definition: 2d/filter.hh:35
P2DImage EXPORT_2D run_filter(const C2DImage &image, const char *filter)
base class for all filer type functors.
Definition: core/filter.hh:68
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:43
static F::result_type filter(const F &f, const B &b)
Definition: core/filter.hh:196
combiner_type plugin_type
plug-in type for plug-in serachpath component
Definition: 2d/filter.hh:138
#define EXPORT_2D
Definition: defines2d.hh:37
FACTORY_TRAIT(C2DImageCombinerPluginHandler)
C2DImage plugin_data
data type for plug-in serachpath component
Definition: 2d/filter.hh:136
TDataFilterPlugin< C2DImage > C2DFilterPlugin
Definition: 2d/filter.hh:41
This is tha base of all plugins that create "things", like filters, cost functions time step operator...
Definition: factory.hh:49
2D Image combiner
Definition: 2d/filter.hh:132
P2DFilter produce_2dimage_filter(const char *descr)
*/
Definition: 2d/filter.hh:71
Generic image filter plugin base.
Definition: core/filter.hh:129
P2DImage result_type
defines the return type of the filter function
Definition: core/filter.hh:70
TFilterChain< C2DFilterPluginHandler > C2DImageFilterChain
Definition: 2d/filter.hh:81
P2DImage EXPORT_2D run_filter_chain(P2DImage image, size_t nfilters, const char *filters[]) __attribute__((deprecated))
create and use a chain of filters
Definition: filter_chain.hh:40
std::shared_ptr< C2DFilter > P2DFilter
Definition: 2d/filter.hh:47
The base class for all plug-in created object.
Definition: product_base.hh:40
static const T & instance()
This is the base class for 2D images that can hold generic pixel data.
Definition: 2d/image.hh:46
Generic interface class to data filters.
Definition: core/filter.hh:84
TFactory< C2DImageCombiner > C2DImageCombinerPlugin
Base class for image combiners.
Definition: 2d/filter.hh:157
THandlerSingleton< TFactoryPluginHandler< C2DImageCombinerPlugin > > C2DImageCombinerPluginHandler
Plugin handler for image combiner plugins.
Definition: 2d/filter.hh:161
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:46