17#ifndef __image_adapter_median_h__
18#define __image_adapter_median_h__
29 template <
class ImageType>
31 public Base<Median<ImageType>,ImageType>
40 using base_type::size;
43 Median (
const ImageType& parent) :
55 for (
size_t i = 0; i < ext.size(); ++i)
56 if (! (ext[i] & uint32_t(1)))
57 throw Exception (
"expected odd number for extent");
58 if (ext.size() != 1 && ext.size() != 3)
59 throw Exception (
"unexpected number of elements specified in extent");
65 DEBUG (
"median adapter for image \"" +
name() +
"\" initialised with extent " +
str(
extent));
67 for (
size_t i = 0; i < 3; ++i)
76 const ssize_t from[3] = {
81 const ssize_t
to[3] = {
94 index(0) = old_pos[0];
95 index(1) = old_pos[1];
96 index(2) = old_pos[2];
VectorType::Scalar value(const VectorType &coefs, typename VectorType::Scalar cos_elevation, typename VectorType::Scalar cos_azimuth, typename VectorType::Scalar sin_azimuth, int lmax)
MR::default_type value_type
Container::value_type median(Container &list)
std::string str(const T &value, int precision=0)
T to(const std::string &string)