Xmipp
v3.23.11-Nereus
|
Classes | |
class | Histogram1D |
class | CDF |
class | IrregularHistogram1D |
class | Histogram2D |
Functions related to histograms 1D | |
template<typename T > | |
void | compute_hist (const MultidimArray< T > &array, Histogram1D &hist, int no_steps) |
void | compute_hist (const MultidimArrayGeneric &array, Histogram1D &hist, int no_steps) |
template<typename T > | |
void | compute_hist (const std::vector< T > &v, Histogram1D &hist, int no_steps=100) |
template<typename T > | |
void | compute_hist (const MultidimArray< T > &v, Histogram1D &hist, double min, double max, int no_steps) |
void | compute_hist (const MultidimArrayGeneric &v, Histogram1D &hist, double min, double max, int no_steps) |
template<typename T > | |
void | compute_hist (const MultidimArray< T > &v, Histogram1D &hist, const Matrix1D< int > &corner1, const Matrix1D< int > &corner2, int no_steps=100) |
double | detectability_error (const Histogram1D &h1, const Histogram1D &h2) |
double | KLDistance (const Histogram1D &h1, const Histogram1D &h2) |
template<typename T > | |
double | effective_range (const T &v, double percentil_out=0.25) |
template<typename T > | |
void | reject_outliers (T &v, double percentil_out=0.25) |
template<typename T > | |
void | histogram_equalization (MultidimArray< T > &v, int bins=8) |
Functions related to histograms 2D | |
The vectors can be of any numerical type (short int, int, double, ...), but both of the same type. Vectors must be of the same shape, the first element of v1 and the first of v2 define the position were the first point will be inserted in the histogram, then the second of v1 and of v2, ... That is, the elements of v1 and v2 serve as coordinates within the histogram. The number of steps must always be given. | |
template<typename T > | |
void | compute_hist (const T &v1, const T &v2, Histogram2D &hist, int no_steps1, int no_steps2) |
template<typename T > | |
void | compute_hist (const MultidimArray< T > &v1, const MultidimArray< T > &v2, Histogram2D &hist, double m1, double M1, double m2, double M2, int no_steps1, int no_steps2) |
void compute_hist | ( | const MultidimArray< T > & | array, |
Histogram1D & | hist, | ||
int | no_steps | ||
) |
Compute histogram of a vector within its minimum and maximum value
Given an array as input, this function returns its histogram within the minimum and maximum of the array, in this way all the values in the array are counted. The array can be of any numerical type (short int, int, double, ...) and dimension. The number of steps must always be given.
Definition at line 430 of file histogram.h.
void compute_hist | ( | const MultidimArrayGeneric & | array, |
Histogram1D & | hist, | ||
int | no_steps | ||
) |
Compute histogram of a MultidimArrayGeneric within its minimum and maximum value
Definition at line 572 of file histogram.cpp.
void compute_hist | ( | const std::vector< T > & | v, |
Histogram1D & | hist, | ||
int | no_steps = 100 |
||
) |
void compute_hist | ( | const MultidimArray< T > & | v, |
Histogram1D & | hist, | ||
double | min, | ||
double | max, | ||
int | no_steps | ||
) |
Compute histogram of the array within two values
Given a array as input, this function returns its histogram within two values, the array values outside this range are not counted. This can be used to avoid the effect of outliers which causes a "compression" in the histogram. The array can be of any numerical type (short int, int, double, ...). The number of steps must always be given.
Definition at line 486 of file histogram.h.
void compute_hist | ( | const MultidimArrayGeneric & | v, |
Histogram1D & | hist, | ||
double | min, | ||
double | max, | ||
int | no_steps | ||
) |
Compute histogram of the MultidimArrayGeneric within two values
Definition at line 580 of file histogram.cpp.
void compute_hist | ( | const MultidimArray< T > & | v, |
Histogram1D & | hist, | ||
const Matrix1D< int > & | corner1, | ||
const Matrix1D< int > & | corner2, | ||
int | no_steps = 100 |
||
) |
Compute histogram within a region (2D or 3D)
The region is defined by its corners
Definition at line 522 of file histogram.h.
void compute_hist | ( | const T & | v1, |
const T & | v2, | ||
Histogram2D & | hist, | ||
int | no_steps1, | ||
int | no_steps2 | ||
) |
Compute histogram of two arrays within their minimum and maximum values
Given two arrays as input, this function returns their joint histogram within the minimum and maximum of the arrays, in this way all the values in the arrays are counted. Both arrays must have the same shape
Definition at line 966 of file histogram.h.
void compute_hist | ( | const MultidimArray< T > & | v1, |
const MultidimArray< T > & | v2, | ||
Histogram2D & | hist, | ||
double | m1, | ||
double | M1, | ||
double | m2, | ||
double | M2, | ||
int | no_steps1, | ||
int | no_steps2 | ||
) |
Compute histogram of two arrays within given values
Given two arrays as input, this function returns their joint histogram within the specified values, all the values lying outside are not counted
Definition at line 985 of file histogram.h.
double detectability_error | ( | const Histogram1D & | h1, |
const Histogram1D & | h2 | ||
) |
Compute the detectability error between two pdf's
The input histograms are expressed as probability density functions representing two different objects with the same parameter of variation, for instance, the protein and background both defined by a grey-level. The first histogram would be the histogram of the grey-levels associated to voxels which we know to belong to the protein area, while the second histogram is for the grey-level of voxels which we know to belong to the background. Then the intersection area between the both associated pdf's represents the probability of committing an error when classifying a voxel, ie, the probability of saying that a voxel is protein when it really is background and viceversa. This function allows you to compute this probability error when the two histograms are provided. Be careful that this probability usually has got a very low value.
Definition at line 324 of file histogram.cpp.
double effective_range | ( | const T & | v, |
double | percentil_out = 0.25 |
||
) |
Returns the effective range of a multidimensional array
The effective range is defined as the difference of those two values comprising a given central percentage of the array histogram. This function is used to compute the range removing outliers. The default central percentage is 99.75%, although this value should be increased as the number of values in the array decreases. For the default, for instance, the 0.125% of the smaller values are left out as well as the 0.125% of the higher values. The range is given always as a double number.
Definition at line 590 of file histogram.h.
void histogram_equalization | ( | MultidimArray< T > & | v, |
int | bins = 8 |
||
) |
Histogram equalization and re-quantization
This function equalizes the histogram of the input multidimensional array, and re-quantize the input array to a specified number of bins. The output array is defined between 0 and bins-1.
Definition at line 633 of file histogram.h.
double KLDistance | ( | const Histogram1D & | h1, |
const Histogram1D & | h2 | ||
) |
Compute the Kullback-Leibler distance between two pdf's
The input histograms are expressed as probability density functions.
Definition at line 377 of file histogram.cpp.
void reject_outliers | ( | T & | v, |
double | percentil_out = 0.25 |
||
) |
Clips the array values within the effective range
Look at the documentation of effective_rage
Definition at line 605 of file histogram.h.