2dimagefifofilter.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef __mia_2dfifofilterstack_hh
#define __mia_2dfifofilterstack_hh
#include <mia/2d/image.hh>
#include <mia/3d/image.hh>
#include <mia/core/factory.hh>
#include <mia/core/fifofilter.hh>
#include <mia/core/filter.hh>
#include <mia/2d/image.hh>
NS_MIA_BEGIN
struct EXPORT_3D image2d_stack {
static const char *data_descr;
};
template <>
struct __copy_create_ptr<C2DImage> {
static P2DImage apply(const C2DImage& x)
{
return P2DImage(x.clone());
}
};
class EXPORT_3D C2DImageFifoFilter: public TFifoFilter<P2DImage>, public CProductBase
{
public:
typedef image2d_stack plugin_data;
typedef filter_type plugin_type;
C2DImageFifoFilter(size_t filter_width, size_t min_fill, size_t read_start);
protected:
C3DImage *create_buffer(const C2DBounds& slice_sice, size_t depth, EPixelType type);
struct CShiftSlices: public TFilter<int> {
template <typename T>
int operator ()(T3DImage<T>& input) const
{
copy_backward(input.begin(), input.end() - input.get_size().x
* input.get_size().y, input.end());
return 0;
}
};
};
class EXPORT_3D C2DFifoFilterPlugin:
public TFactory<C2DImageFifoFilter>
{
protected:
C2DFifoFilterPlugin(char const *const name);
typedef std::vector<P2DImage> CImageStack;
bool call_test(const CImageStack& in_data, const CImageStack& test_data,
C2DImageFifoFilter& filter)const ;
};
typedef TFifoFilter<P2DImage>::Pointer P2DImageFifoFilter;
#ifdef __GNUC__
#pragma GCC diagnostic push
#ifndef __clang__
#pragma GCC diagnostic ignored "-Wattributes"
#endif
#endif
extern template class EXPORT_3D TFifoFilter<P2DImage>;
extern template class EXPORT_3D TFifoFilterSink<P2DImage>;
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
typedef THandlerSingleton<TFactoryPluginHandler<C2DFifoFilterPlugin>> C2DFifoFilterPluginHandler;
NS_MIA_END
#endif
image.hh
P2DImage
C2DImage::Pointer P2DImage
Shared pointer representation of the 2D Image.
Definition 2d/image.hh:120
C2DBounds
T2DVector< unsigned int > C2DBounds
unsigned int valued 2D vector - used as 2D size parameter
Definition 2d/vector.hh:540
image.hh
C2DFifoFilterPlugin::C2DFifoFilterPlugin
C2DFifoFilterPlugin(char const *const name)
C2DFifoFilterPlugin::CImageStack
std::vector< P2DImage > CImageStack
helper class to store a set of images
Definition 2dimagefifofilter.hh:126
C2DFifoFilterPlugin::call_test
bool call_test(const CImageStack &in_data, const CImageStack &test_data, C2DImageFifoFilter &filter) const
C2DImageFifoFilter
The class to provide filtering of series of 2D images as if they where 3D images.
Definition 2dimagefifofilter.hh:70
C2DImageFifoFilter::create_buffer
C3DImage * create_buffer(const C2DBounds &slice_sice, size_t depth, EPixelType type)
C2DImageFifoFilter::C2DImageFifoFilter
C2DImageFifoFilter(size_t filter_width, size_t min_fill, size_t read_start)
C2DImageFifoFilter::plugin_data
image2d_stack plugin_data
Definition 2dimagefifofilter.hh:72
C2DImageFifoFilter::plugin_type
filter_type plugin_type
Definition 2dimagefifofilter.hh:73
C2DImage
This is the base class for 2D images that can hold generic pixel data.
Definition 2d/image.hh:48
C2DImage::clone
virtual C2DImage * clone() const __attribute__((warn_unused_result))=0
C3DImage
The generic base type of a 3D image.
Definition 3d/image.hh:47
CProductBase
The base class for all plug-in created object.
Definition product_base.hh:41
type
T3DImage
Specific type of the 3D images that hold real pixel data.
Definition 3d/image.hh:150
TFactory< C2DImageFifoFilter >::TFactory
TFactory(char const *const name)
Definition factory.hh:173
TFifoFilterSink
Helper class for testing FIFO filter chains.
Definition fifofilter.hh:159
TFifoFilter
Generic base class for out-of-core FIFO filters.
Definition fifofilter.hh:53
TFifoFilter::Pointer
std::shared_ptr< TFifoFilter > Pointer
smart pointer representing this class
Definition fifofilter.hh:57
TFifoFilter< P2DImage >::TFifoFilter
TFifoFilter(size_t width, size_t min_fill, size_t read_start)
THandlerSingleton
the singleton that a plug-in handler really is
Definition handler.hh:159
CCmdOptionFlags::input
@ input
Definition cmdoptionflags.hh:31
filter.hh
EXPORT_3D
#define EXPORT_3D
Definition defines3d.hh:45
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
factory.hh
fifofilter.hh
P2DImageFifoFilter
TFifoFilter< P2DImage >::Pointer P2DImageFifoFilter
Pointer type for the FIFO filter.
Definition 2dimagefifofilter.hh:144
C2DFifoFilterPluginHandler
THandlerSingleton< TFactoryPluginHandler< C2DFifoFilterPlugin > > C2DFifoFilterPluginHandler
Plugin handler for the FIFO filters.
Definition 2dimagefifofilter.hh:165
filter
static F::result_type filter(const F &f, const B &b)
Definition core/filter.hh:258
EPixelType
EPixelType
Definition pixeltype.hh:33
TFilter
base class for all filer type functors.
Definition core/filter.hh:70