GooseEYE 0.9.1
|
Toolbox to compute statistics. More...
Namespaces | |
namespace | array_type |
Container type. | |
namespace | kernel |
Collect kernels. | |
Classes | |
class | ClusterLabeller |
(Incrementally) Label clusters (0 as background, 1..n as labels). More... | |
class | Ensemble |
Compute ensemble averaged statistics, by repetitively calling the member-function of a certain statistical measure with different data. More... | |
Enumerations | |
enum class | path_mode { Bresenham , actual , full } |
Different methods to compute a pixel-path. More... | |
Functions | |
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. | |
array_type::array< int > | dummy_circles (const std::vector< size_t > &shape, const array_type::tensor< int, 1 > &row, const array_type::tensor< int, 1 > &col, const array_type::tensor< int, 1 > &r, bool periodic=true) |
Dummy image with circles. | |
array_type::array< int > | dummy_circles (const std::vector< size_t > &shape, bool periodic=true, uint64_t seed=0) |
Dummy image with circles. | |
template<class T , class S , std::enable_if_t< std::is_integral< typename T::value_type >::value &&std::is_integral< typename S::value_type >::value, int > = 0> | |
T | dilate (const T &f, const S &kernel, const array_type::tensor< size_t, 1 > &iterations, bool periodic=true) |
Dilate image. | |
template<class T , std::enable_if_t< std::is_integral< typename T::value_type >::value, int > = 0> | |
T | dilate (const T &f, const array_type::tensor< size_t, 1 > &iterations, bool periodic=true) |
Dilate image. | |
template<class T , class S , std::enable_if_t< std::is_integral< typename T::value_type >::value &&std::is_integral< typename S::value_type >::value, int > = 0> | |
T | dilate (const T &f, const S &kernel, size_t iterations=1, bool periodic=true) |
Dilate image. | |
template<class T , std::enable_if_t< std::is_integral< typename T::value_type >::value, int > = 0> | |
T | dilate (const T &f, size_t iterations=1, bool periodic=true) |
Dilate image. | |
template<class T > | |
array_type::tensor< typename T::value_type, 2 > | labels_map (const T &a, const T &b) |
Get a map to relabel from a to b . | |
template<class L , class A > | |
L | labels_rename (const L &labels, const A &rename) |
Rename labels. | |
template<class T > | |
T | labels_prune (const T &labels) |
Prune labels: renumber labels to lowest possible label starting from 1. | |
template<class L , class A > | |
L | labels_reorder (const L &labels, const A &order) |
Reorder labels. | |
template<class T > | |
array_type::tensor< typename T::value_type, 2 > | labels_sizes (const T &labels) |
Size per label. | |
template<class T , class N > | |
array_type::tensor< typename T::value_type, 1 > | labels_sizes (const T &labels, const N &names) |
Size per label. | |
template<class T > | |
array_type::array< int > | clusters (const T &f, bool periodic=true) |
Compute clusters. | |
array_type::tensor< double, 1 > | center (const array_type::tensor< double, 1 > &shape, const array_type::tensor< double, 2 > &positions, bool periodic=true) |
Return the geometric center of a list of positions. | |
array_type::tensor< double, 1 > | center_of_mass (const array_type::tensor< double, 1 > &shape, const array_type::tensor< double, 2 > &positions, const array_type::tensor< double, 1 > &weights, bool periodic=true) |
Return the geometric center of a list of positions. | |
template<class T , class N > | |
array_type::tensor< double, 2 > | labels_centers (const T &labels, const N &names, bool periodic=true) |
Get the position of the center of each label. | |
template<class T , class W , class N > | |
array_type::tensor< double, 2 > | labels_centers_of_mass (const T &labels, const W &weights, const N &names, bool periodic=true) |
Get the position of the center of each label. | |
auto | distance (const std::vector< size_t > &roi) |
Get the relative distance of each pixel in the 'region-of-interest' to its center. | |
auto | distance (const std::vector< size_t > &roi, size_t axis) |
Get the relative distance of each pixel in the 'region-of-interest' to its center. | |
auto | distance (const std::vector< size_t > &roi, const std::vector< double > &h) |
Get the relative distance of each pixel in the 'region-of-interest' to its center. | |
auto | distance (const std::vector< size_t > &roi, const std::vector< double > &h, size_t axis) |
Get the relative distance of each pixel in the 'region-of-interest' to its center. | |
template<class T > | |
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)). | |
template<class T , class M > | |
auto | S2 (const std::vector< size_t > &roi, const T &f, const T &g, const M &fmask, const M &gmask, bool periodic=true) |
2-point correlation: P(f(i) * g(i + di)). | |
template<class T > | |
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)). | |
template<class T , class M > | |
auto | C2 (const std::vector< size_t > &roi, const T &f, const T &g, const M &fmask, const M &gmask, bool periodic=true) |
2-point cluster function: P(f(i) == g(i + di)). | |
template<class T > | |
auto | W2 (const std::vector< size_t > &roi, const T &w, const T &f, bool periodic=true) |
Weighted 2-point correlation. | |
template<class T , class M > | |
auto | W2 (const std::vector< size_t > &roi, const T &w, const T &f, const M &fmask, bool periodic=true) |
Weighted 2-point correlation. | |
template<class C , class T > | |
auto | W2c (const std::vector< size_t > &roi, const C &clusters, const C ¢ers, const T &f, path_mode mode=path_mode::Bresenham, bool periodic=true) |
Collapsed weighted 2-point correlation. | |
template<class C , class T , class M > | |
auto | W2c (const std::vector< size_t > &roi, const C &clusters, const C ¢ers, const T &f, const M &fmask, path_mode mode=path_mode::Bresenham, bool periodic=true) |
Collapsed weighted 2-point correlation. | |
template<class T > | |
auto | heightheight (const std::vector< size_t > &roi, const T &f, bool periodic=true) |
Height-height correlation. | |
template<class T , class M > | |
auto | heightheight (const std::vector< size_t > &roi, const T &f, const M &fmask, bool periodic=true) |
Height-height correlation. | |
template<class T > | |
auto | L (const std::vector< size_t > &roi, const T &f, bool periodic=true, path_mode mode=path_mode::Bresenham) |
Lineal-path function. | |
std::string | version () |
Return version string, e.g. | |
Toolbox to compute statistics.
|
strong |
Different methods to compute a pixel-path.
Enumerator | |
---|---|
Bresenham | Bresenham algorithm. |
actual | The actual path. |
full | Similar to actual selecting every voxel that is crossed. |
Definition at line 93 of file GooseEYE.h.
|
inline |
2-point cluster function: P(f(i) == g(i + di)).
roi | Region-of-interest. |
f | The image. |
g | The comparison image. |
periodic | Switch to assume image periodic. |
Definition at line 75 of file GooseEYE.hpp.
|
inline |
2-point cluster function: P(f(i) == g(i + di)).
roi | Region-of-interest. |
f | The image. |
g | The comparison image. |
fmask | Mask certain pixels of f (binary, 1: masked, 0: not masked). |
gmask | Mask certain pixels of g (binary, 1: masked, 0: not masked). |
periodic | Switch to assume image periodic. |
Definition at line 84 of file GooseEYE.hpp.
|
inline |
Return the geometric center of a list of positions.
positions = np.hstack((rows.reshape(-1, 1), cols.reshape(-1, 1)))
. You can also use positions = np.argwhere(condition)
. This means that the following two calls are equivalent: >>> centers(shape=labels.shape, positions=np.argwhere(labels == 1), periodic=True) >>> labels_centers(labels=labels, names=[1], periodic=True)[0, :]
For periodic algorithm, see: https://en.wikipedia.org/wiki/Center_of_mass#Systems_with_periodic_boundary_conditions
shape | Shape of the box to which the coordinates below (needed to apply periodicity). |
positions | List of positions (in array coordinates, e.g. [rows, columns] ). |
periodic | Switch to assume array periodic. |
[center_row, center_col]
). Definition at line 1246 of file GooseEYE.h.
|
inline |
Return the geometric center of a list of positions.
positions = np.hstack((rows.reshape(-1, 1), cols.reshape(-1, 1)))
. You can also use positions = np.argwhere(condition)
. This means that the following two calls are equivalent: >>> centers(shape=labels.shape, positions=np.argwhere(labels == 1), periodic=True) >>> labels_centers(labels=labels, names=[1], periodic=True)[0, :]
For periodic algorithm, see: https://en.wikipedia.org/wiki/Center_of_mass#Systems_with_periodic_boundary_conditions
shape | Shape of the box to which the coordinates below (needed to apply periodicity). |
positions | List of positions (in array coordinates, e.g. [rows, columns] ). |
periodic | Switch to assume array periodic. |
[center_row, center_col]
). weights | Weight for each position. |
Definition at line 1274 of file GooseEYE.h.
|
inline |
Compute clusters.
f | Image. |
periodic | Interpret image as periodic. |
Definition at line 1198 of file GooseEYE.h.
|
inline |
Dilate image.
Select "kernel::nearest" as kernel. See above for parameters.
Definition at line 388 of file GooseEYE.h.
|
inline |
Dilate image.
The input image can be binary (1), or have integer labels (>=1). In each case the background are 0.
f | The image (integer). |
kernel | The kernel with which to dilate (binary). |
iterations | Number of iterations per label. |
periodic | Switch to assume image periodic. |
Definition at line 299 of file GooseEYE.h.
|
inline |
Dilate image.
Fixed number of iterations for all labels. See above for parameters.
Definition at line 404 of file GooseEYE.h.
|
inline |
Dilate image.
Fixed number of iterations for all labels. Select "kernel::nearest" as kernel. See above for parameters.
Definition at line 415 of file GooseEYE.h.
|
inline |
Get the relative distance of each pixel in the 'region-of-interest' to its center.
roi | Region-of-interest. |
Definition at line 28 of file GooseEYE.hpp.
|
inline |
Get the relative distance of each pixel in the 'region-of-interest' to its center.
roi | Region-of-interest. |
h | The physical dimensions of one pixel (in each direction). |
Definition at line 40 of file GooseEYE.hpp.
|
inline |
Get the relative distance of each pixel in the 'region-of-interest' to its center.
roi | Region-of-interest. |
h | The physical dimensions of one pixel (in each direction). |
axis | Select axis. |
Definition at line 46 of file GooseEYE.hpp.
|
inline |
Get the relative distance of each pixel in the 'region-of-interest' to its center.
roi | Region-of-interest. |
axis | Select axis. |
Definition at line 34 of file GooseEYE.hpp.
|
inline |
Dummy image with circles.
The positions and radii of the circles are randomly generated.
shape | Shape of the output image. |
periodic | Switch to assume image periodic. |
seed | Seed for the random number generator. |
Definition at line 172 of file GooseEYE.h.
|
inline |
Dummy image with circles.
shape | Shape of the output image. |
row | The x-position of each circle. |
col | The y-position of each circle. |
r | The radius of each circle. |
periodic | Switch to assume image periodic. |
Definition at line 120 of file GooseEYE.h.
|
inline |
Height-height correlation.
roi | Region-of-interest. |
f | The image. |
periodic | Switch to assume image periodic. |
Definition at line 143 of file GooseEYE.hpp.
|
inline |
Height-height correlation.
roi | Region-of-interest. |
f | The image. |
fmask | Mask certain pixels of f (binary, 1: masked, 0: not masked). |
periodic | Switch to assume image periodic. |
Definition at line 151 of file GooseEYE.hpp.
|
inline |
Lineal-path function.
roi | Region-of-interest. |
f | The image. |
periodic | Switch to assume image periodic. |
mode | Method to use (see path_mode()). |
Definition at line 159 of file GooseEYE.hpp.
|
inline |
Get the position of the center of each label.
labels | An image with labels. |
names | List of labels to compute the center for. |
periodic | Switch to assume image periodic. |
Definition at line 1340 of file GooseEYE.h.
|
inline |
Get the position of the center of each label.
labels | An image with labels. |
names | List of labels to compute the center for. |
periodic | Switch to assume image periodic. |
weights | Weight for each pixel. |
Definition at line 1368 of file GooseEYE.h.
|
inline |
Get a map to relabel from a
to b
.
a | Image with labels. |
b | Image with labels. |
Definition at line 428 of file GooseEYE.h.
|
inline |
Prune labels: renumber labels to lowest possible label starting from 1.
Note that the background 0 is always kept 0.
labels | Image with labels. |
Definition at line 490 of file GooseEYE.h.
|
inline |
Rename labels.
labels | Image with labels. |
rename | Array with each row the pair (old_label, new_label). |
Definition at line 457 of file GooseEYE.h.
|
inline |
Reorder labels.
labels | Image with labels. |
order | List of new order of labels (unique(labels) in desired order). |
Definition at line 536 of file GooseEYE.h.
|
inline |
Size per label.
labels | Image with labels. |
Definition at line 588 of file GooseEYE.h.
|
inline |
Size per label.
labels | Image with labels. |
names | List of 'names' to extract. |
Definition at line 612 of file GooseEYE.h.
|
inline |
Compute a path between two pixels.
x0 | Pixel coordinate (e.g. {0, 0}). |
x1 | Pixel coordinate (e.g. {10, 5}). |
mode | Method to use (see "path_mode"). |
Definition at line 15 of file GooseEYE.hpp.
|
inline |
2-point correlation: P(f(i) * g(i + di)).
roi | Region-of-interest. |
f | The image. |
g | The comparison image. |
periodic | Switch to assume image periodic. |
Definition at line 53 of file GooseEYE.hpp.
|
inline |
2-point correlation: P(f(i) * g(i + di)).
roi | Region-of-interest. |
f | The image. |
g | The comparison image. |
fmask | Mask certain pixels of f (binary, 1: masked, 0: not masked). |
gmask | Mask certain pixels of g (binary, 1: masked, 0: not masked). |
periodic | Switch to assume image periodic. |
Definition at line 62 of file GooseEYE.hpp.
|
inline |
|
inline |
Weighted 2-point correlation.
roi | Region-of-interest. |
w | Weights. |
f | The image. |
periodic | Switch to assume image periodic. |
Definition at line 97 of file GooseEYE.hpp.
|
inline |
Weighted 2-point correlation.
roi | Region-of-interest. |
w | Weights. |
f | The image. |
fmask | Mask certain pixels of f (binary, 1: masked, 0: not masked). |
periodic | Switch to assume image periodic. |
Definition at line 106 of file GooseEYE.hpp.
|
inline |
Collapsed weighted 2-point correlation.
roi | Region-of-interest. |
clusters | The clusters. |
centers | The cluster-centers: label only at the center. |
f | The image. |
fmask | Mask certain pixels of f (binary, 1: masked, 0: not masked). |
mode | Method to use (see path_mode()). |
periodic | Switch to assume image periodic. |
Definition at line 129 of file GooseEYE.hpp.
|
inline |
Collapsed weighted 2-point correlation.
roi | Region-of-interest. |
clusters | The clusters. |
centers | The cluster-centers: label only at the center. |
f | The image. |
mode | Method to use (see path_mode()). |
periodic | Switch to assume image periodic. |
Definition at line 115 of file GooseEYE.hpp.