GooseEYE 0.9.1
Loading...
Searching...
No Matches
GooseEYE.hpp
Go to the documentation of this file.
1
7#ifndef GOOSEEYE_HPP
8#define GOOSEEYE_HPP
9
10#include "GooseEYE.h"
11
12namespace GooseEYE {
13
16{
17 if (mode == path_mode::Bresenham) {
18 return detail::path::bresenham(x0, x1);
19 }
20 else if (mode == path_mode::actual) {
21 return detail::path::actual(x0, x1);
22 }
23 else {
24 return detail::path::full(x0, x1);
25 }
26}
27
28inline auto distance(const std::vector<size_t>& roi)
29{
30 Ensemble ensemble(roi);
31 return ensemble.distance();
32}
33
34inline auto distance(const std::vector<size_t>& roi, size_t dim)
35{
36 Ensemble ensemble(roi);
37 return ensemble.distance(dim);
38}
39
40inline auto distance(const std::vector<size_t>& roi, const std::vector<double>& h)
41{
42 Ensemble ensemble(roi);
43 return ensemble.distance(h);
44}
45
46inline auto distance(const std::vector<size_t>& roi, const std::vector<double>& h, size_t dim)
47{
48 Ensemble ensemble(roi);
49 return ensemble.distance(h, dim);
50}
51
52template <class T>
53inline auto S2(const std::vector<size_t>& roi, const T& f, const T& g, bool periodic)
54{
55 Ensemble ensemble(roi, periodic);
56 ensemble.S2(f, g);
57 return ensemble.result();
58}
59
60template <class T, class M>
61inline auto
62S2(const std::vector<size_t>& roi,
63 const T& f,
64 const T& g,
65 const M& fmask,
66 const M& gmask,
67 bool periodic)
68{
69 Ensemble ensemble(roi, periodic);
70 ensemble.S2(f, g, fmask, gmask);
71 return ensemble.result();
72}
73
74template <class T>
75inline auto C2(const std::vector<size_t>& roi, const T& f, const T& g, bool periodic)
76{
77 Ensemble ensemble(roi, periodic);
78 ensemble.C2(f, g);
79 return ensemble.result();
80}
81
82template <class T, class M>
83inline auto
84C2(const std::vector<size_t>& roi,
85 const T& f,
86 const T& g,
87 const M& fmask,
88 const M& gmask,
89 bool periodic)
90{
91 Ensemble ensemble(roi, periodic);
92 ensemble.C2(f, g, fmask, gmask);
93 return ensemble.result();
94}
95
96template <class T>
97inline auto W2(const std::vector<size_t>& roi, const T& w, const T& f, bool periodic)
98{
99 Ensemble ensemble(roi, periodic);
100 ensemble.W2(w, f);
101 return ensemble.result();
102}
103
104template <class T, class M>
105inline auto
106W2(const std::vector<size_t>& roi, const T& w, const T& f, const M& fmask, bool periodic)
107{
108 Ensemble ensemble(roi, periodic);
109 ensemble.W2(w, f, fmask);
110 return ensemble.result();
111}
112
113template <class C, class T>
114inline auto
115W2c(const std::vector<size_t>& roi,
116 const C& clusters,
117 const C& centers,
118 const T& f,
119 path_mode mode,
120 bool periodic)
121{
122 Ensemble ensemble(roi, periodic);
123 ensemble.W2c(clusters, centers, f, mode);
124 return ensemble.result();
125}
126
127template <class C, class T, class M>
128inline auto
129W2c(const std::vector<size_t>& roi,
130 const C& clusters,
131 const C& centers,
132 const T& f,
133 const M& fmask,
134 path_mode mode,
135 bool periodic)
136{
137 Ensemble ensemble(roi, periodic);
138 ensemble.W2c(clusters, centers, f, fmask, mode);
139 return ensemble.result();
140}
141
142template <class T>
143inline auto heightheight(const std::vector<size_t>& roi, const T& f, bool periodic)
144{
145 Ensemble ensemble(roi, periodic);
146 ensemble.heightheight(f);
147 return ensemble.result();
148}
149
150template <class T, class M>
151inline auto heightheight(const std::vector<size_t>& roi, const T& f, const M& fmask, bool periodic)
152{
153 Ensemble ensemble(roi, periodic);
154 ensemble.heightheight(f, fmask);
155 return ensemble.result();
156}
157
158template <class T>
159inline auto L(const std::vector<size_t>& roi, const T& f, bool periodic, path_mode mode)
160{
161 Ensemble ensemble(roi, periodic);
162 ensemble.L(f, mode);
163 return ensemble.result();
164}
165
166} // namespace GooseEYE
167
168#endif
Compute ensemble averaged statistics, by repetitively calling the member-function of a certain statis...
Definition GooseEYE.h:1402
void L(const T &f, path_mode mode=path_mode::Bresenham)
Add realization to lineal-path function.
void S2(const T &f, const T &g)
Add realization to 2-point correlation: P(f(i) * g(i + di)).
void heightheight(const T &f)
Add realization to height-height correlation.
void W2c(const C &clusters, const C &centers, const T &f, path_mode mode=path_mode::Bresenham)
Add realization to collapsed weighted 2-point correlation.
void W2(const T &w, const T &f)
Add realization to weighted 2-point correlation.
array_type::array< double > distance() const
Get the relative distance of each pixel in the 'region-of-interest' to its center.
Definition Ensemble.hpp:103
array_type::array< double > result() const
Get ensemble average.
Definition Ensemble.hpp:26
void C2(const T &f, const T &g)
Add realization to 2-point cluster function: P(f(i) == g(i + di)).
xt::xtensor< T, N > tensor
Fixed (static) rank array.
Definition config.h:155
Toolbox to compute statistics.
Definition config.h:128
path_mode
Different methods to compute a pixel-path.
Definition GooseEYE.h:93
@ Bresenham
Bresenham algorithm.
@ actual
The actual path.
auto L(const std::vector< size_t > &roi, const T &f, bool periodic=true, path_mode mode=path_mode::Bresenham)
Lineal-path function.
Definition GooseEYE.hpp:159
auto W2c(const std::vector< size_t > &roi, const C &clusters, const C &centers, const T &f, path_mode mode=path_mode::Bresenham, bool periodic=true)
Collapsed weighted 2-point correlation.
Definition GooseEYE.hpp:115
auto C2(const std::vector< size_t > &roi, const T &f, const T &g, bool periodic=true)
2-point cluster function: P(f(i) == g(i + di)).
Definition GooseEYE.hpp:75
array_type::array< int > clusters(const T &f, bool periodic=true)
Compute clusters.
Definition GooseEYE.h:1198
auto W2(const std::vector< size_t > &roi, const T &w, const T &f, bool periodic=true)
Weighted 2-point correlation.
Definition GooseEYE.hpp:97
array_type::tensor< int, 2 > path(const array_type::tensor< int, 1 > &x0, const array_type::tensor< int, 1 > &x1, path_mode mode=path_mode::Bresenham)
Compute a path between two pixels.
Definition GooseEYE.hpp:15
auto distance(const std::vector< size_t > &roi)
Get the relative distance of each pixel in the 'region-of-interest' to its center.
Definition GooseEYE.hpp:28
auto S2(const std::vector< size_t > &roi, const T &f, const T &g, bool periodic=true)
2-point correlation: P(f(i) * g(i + di)).
Definition GooseEYE.hpp:53
auto heightheight(const std::vector< size_t > &roi, const T &f, bool periodic=true)
Height-height correlation.
Definition GooseEYE.hpp:143