fifotestfixture.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_3d_fifotestfixture_hh
#define mia_3d_fifotestfixture_hh
#include <vector>
#include <mia/3d/2dimagefifofilter.hh>
NS_MIA_BEGIN
typedef std::vector<P2DImage> C2DImageStack;
struct EXPORT_3D fifof_Fixture {
template <typename A, typename B>
void prepare(const A *input_data, const B *test_data, const C2DBounds& size, size_t slices);
void call_test( C2DImageFifoFilter& filter)const ;
C2DImageStack m_in_data;
C2DImageStack m_test_data;
};
template <typename A, typename B>
void fifof_Fixture::prepare(const A *input_data, const B *test_data, const C2DBounds& size, size_t n_slices)
{
m_in_data.clear();
m_test_data.clear();
size_t slice_size = size.x * size.y;
cvdebug() << "the test image size is " << size << "\n";
for (size_t i = 0; i < n_slices; ++i, input_data += slice_size, test_data += slice_size) {
m_in_data.push_back(P2DImage(new T2DImage<A>(size, input_data)));
m_test_data.push_back(P2DImage(new T2DImage<B>(size, test_data)));
}
}
NS_MIA_END
#endif
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
2dimagefifofilter.hh
C2DImageFifoFilter
The class to provide filtering of series of 2D images as if they where 3D images.
Definition 2dimagefifofilter.hh:70
T2DImage
This is the template version of a 2D image that is used for holding real data.
Definition 2d/image.hh:140
T2DVector::y
T y
second element
Definition 2d/vector.hh:57
T2DVector::x
T x
first element
Definition 2d/vector.hh:54
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
C2DImageStack
NS_MIA_BEGIN typedef std::vector< P2DImage > C2DImageStack
Definition fifotestfixture.hh:29
filter
static F::result_type filter(const F &f, const B &b)
Definition core/filter.hh:258
cvdebug
CDebugSink & cvdebug()
Definition msgstream.hh:226
fifof_Fixture
a fixture to test FIFO filtering
Definition fifotestfixture.hh:42
fifof_Fixture::m_in_data
C2DImageStack m_in_data
Definition fifotestfixture.hh:47
fifof_Fixture::m_test_data
C2DImageStack m_test_data
Definition fifotestfixture.hh:48
fifof_Fixture::prepare
void prepare(const A *input_data, const B *test_data, const C2DBounds &size, size_t slices)
Definition fifotestfixture.hh:52
fifof_Fixture::call_test
void call_test(C2DImageFifoFilter &filter) const