scaler1d.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_core_scale1d_hh
#define mia_core_scale1d_hh
#include <cassert>
#include <vector>
#include <memory>
#include <mia/core/vector.hh>
#include <mia/core/msgstream.hh>
#include <mia/core/interpolator1d.hh>
#include <mia/core/spacial_kernel.hh>
NS_MIA_BEGIN
class EXPORT_CORE C1DScalar
{
public:
typedef std::vector<double> std_double_vector;
C1DScalar(const CSplineKernel& kernel, size_t in_size, size_t out_size);
C1DScalar(const CSplineKernel& kernel, size_t in_size, double scale);
void operator () (const std_double_vector& input, std_double_vector& output) const;
void run();
std_double_vector::iterator input_begin();
std_double_vector::iterator input_end();
std_double_vector::iterator output_begin();
std_double_vector::iterator output_end();
size_t get_output_size() const;
private:
void initialize(const CSplineKernel& kernel);
void upscale(const std_double_vector& input, std_double_vector& output) const;
void downscale(const std_double_vector& input, std_double_vector& output) const;
enum EStrategy {
scs_fill_output,
scs_upscale,
scs_copy,
scs_downscale,
scs_unknown
};
size_t m_in_size;
size_t m_support;
double m_scale;
std::vector<double> m_poles;
EStrategy m_strategy;
PSplineBoundaryCondition m_bc;
std_double_vector m_input_buffer;
size_t m_out_size;
std_double_vector m_output_buffer;
std::vector<CSplineKernel::VWeight> m_weights;
std::vector<CSplineKernel::VIndex> m_indices;
P1DSpacialKernel m_gauss;
};
NS_MIA_END
#endif
C1DScalar::std_double_vector
std::vector< double > std_double_vector
Definition scaler1d.hh:50
C1DScalar::input_end
std_double_vector::iterator input_end()
C1DScalar::output_begin
std_double_vector::iterator output_begin()
C1DScalar::input_begin
std_double_vector::iterator input_begin()
C1DScalar::run
void run()
C1DScalar::C1DScalar
C1DScalar(const CSplineKernel &kernel, size_t in_size, double scale)
C1DScalar::get_output_size
size_t get_output_size() const
C1DScalar::C1DScalar
C1DScalar(const CSplineKernel &kernel, size_t in_size, size_t out_size)
C1DScalar::output_end
std_double_vector::iterator output_end()
CSplineKernel
Base class for all spline based interpolation kernels.
Definition splinekernel.hh:46
CCmdOptionFlags::output
@ output
Definition cmdoptionflags.hh:32
CCmdOptionFlags::input
@ input
Definition cmdoptionflags.hh:31
vector.hh
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
EXPORT_CORE
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition defines.hh:101
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
PSplineBoundaryCondition
CSplineBoundaryCondition::Pointer PSplineBoundaryCondition
Definition boundary_conditions.hh:167
interpolator1d.hh
msgstream.hh
spacial_kernel.hh
P1DSpacialKernel
std::shared_ptr< C1DFoldingKernel > P1DSpacialKernel
Definition spacial_kernel.hh:169