Xmipp
v3.23.11-Nereus
|
Functions | |
double | denoiseTVenergy (double mu, const MultidimArray< double > &X, const MultidimArray< double > &Y, double s, double q, double lambda, double sigmag, double g) |
void | denoiseTVgradient (double mu, const MultidimArray< double > &X, const MultidimArray< double > &Y, double s, double q, double lambda, double sigmag, double g, MultidimArray< double > &gradientI) |
void | denoiseTVproj (const MultidimArray< double > &X, const MultidimArray< double > &Y, double theta, MultidimArray< double > &dold) |
void | denoiseTVFilter (MultidimArray< double > &xnew, int maxIter) |
void | substractBackgroundPlane (MultidimArray< double > &I) |
void | substractBackgroundRollingBall (MultidimArray< double > &I, int radius) |
void | detectBackground (const MultidimArray< double > &vol, MultidimArray< double > &mask, double alpha, double &final_mean) |
void | contrastEnhancement (Image< double > *I) |
void | regionGrowing2D (const MultidimArray< double > &I_in, MultidimArray< double > &I_out, int i, int j, float stop_colour=1, float filling_colour=1, bool less=true, int neighbourhood=8) |
void | distanceTransform (const MultidimArray< int > &in, MultidimArray< int > &out, bool wrap=false) |
int | labelImage2D (const MultidimArray< double > &I, MultidimArray< double > &label, int neighbourhood=8) |
int | labelImage3D (const MultidimArray< double > &V, MultidimArray< double > &label) |
void | removeSmallComponents (MultidimArray< double > &I, int size, int neighbourhood=8) |
void | keepBiggestComponent (MultidimArray< double > &I, double percentage=0, int neighbourhood=8) |
void | fillBinaryObject (MultidimArray< double > &I, int neighbourhood=8) |
void | varianceFilter (MultidimArray< double > &I, int kernelSize=10, bool relative=false) |
void | noisyZonesFilter (MultidimArray< double > &I, int kernelSize=10) |
double | giniCoeff (MultidimArray< double > &I, int varKernelSize=50) |
double | OtsuSegmentation (MultidimArray< double > &V) |
double | EntropySegmentation (MultidimArray< double > &V) |
double | EntropyOtsuSegmentation (MultidimArray< double > &V, double percentil=0.05, bool binarizeVolume=true) |
template<typename T > | |
double | correlation (const MultidimArray< T > &x, const MultidimArray< T > &y, const MultidimArray< int > *mask=nullptr, int l=0, int m=0, int q=0) |
template<typename T > | |
double | fastMaskedCorrelation (const MultidimArray< T > &x, const MultidimArray< T > &y, const MultidimArray< int > &mask) |
template<typename T > | |
double | fastCorrentropy (const MultidimArray< T > &x, const MultidimArray< T > &y, double sigma, const GaussianInterpolator &G) |
template<typename T > | |
double | correntropy (const MultidimArray< T > &x, const MultidimArray< T > &y, double sigma) |
double | bestShift (const MultidimArray< double > &I1, const MultidimArray< double > &I2, double &shiftX, double &shiftY, CorrelationAux &aux, const MultidimArray< int > *mask=nullptr, int maxShift=-1) |
void | bestShift (const MultidimArray< double > &I1, const MultidimArray< double > &I2, double &shiftX, double &shiftY, double &shiftZ, CorrelationAux &aux, const MultidimArray< int > *mask=nullptr) |
void | bestNonwrappingShift (const MultidimArray< double > &I1, const MultidimArray< double > &I2, double &shiftX, double &shiftY, CorrelationAux &aux) |
double | bestShiftRealSpace (const MultidimArray< double > &I1, MultidimArray< double > &I2, double &shiftX, double &shiftY, const MultidimArray< int > *mask=nullptr, int maxShift=5, double shiftStep=1.0) |
double | alignImages (const MultidimArray< double > &Iref, MultidimArray< double > &I, Matrix2D< double > &M, bool wrap=xmipp_transformation::WRAP) |
double | alignImages (const MultidimArray< double > &Iref, MultidimArray< double > &I, Matrix2D< double > &M, bool wrap, AlignmentAux &aux, CorrelationAux &aux2, RotationalCorrelationAux &aux3) |
double | bestRotationAroundZ (const MultidimArray< double > &Iref, const MultidimArray< double > &I, CorrelationAux &aux, VolumeAlignmentAux &aux2) |
double | alignImagesConsideringMirrors (const MultidimArray< double > &Iref, MultidimArray< double > &I, Matrix2D< double > &M, AlignmentAux &aux, CorrelationAux &aux2, RotationalCorrelationAux &aux3, bool wrap=xmipp_transformation::WRAP, const MultidimArray< int > *mask=NULL) |
void | estimateGaussian2D (const MultidimArray< double > &I, double &a, double &b, Matrix1D< double > &mu, Matrix2D< double > &sigma, bool estimateMu=true, int iterations=10) |
template<typename T > | |
double | euclidianDistance (const MultidimArray< T > &x, const MultidimArray< T > &y, const MultidimArray< int > *mask=nullptr) |
template<typename T > | |
double | mutualInformation (const MultidimArray< T > &x, const MultidimArray< T > &y, int nx=0, int ny=0, const MultidimArray< int > *mask=nullptr) |
template<typename T > | |
double | rms (const MultidimArray< T > &x, const MultidimArray< T > &y, const MultidimArray< int > *mask=nullptr, MultidimArray< double > *Contributions=nullptr) |
void | fourierBesselDecomposition (const MultidimArray< double > &img_in, double r2, int k1, int k2) |
template<typename T > | |
void | sort (T a, T b, T c, MultidimArray< T > &v) |
template<typename T > | |
void | medianFilter3x3 (MultidimArray< T > &m, MultidimArray< T > &out) |
void | smoothingShah (MultidimArray< double > &img, MultidimArray< double > &surface_strength, MultidimArray< double > &edge_strength, const Matrix1D< double > &W, int OuterLoops, int InnerLoops, int RefinementLoops, bool adjust_range=true) |
double | tomographicDiffusion (MultidimArray< double > &V, const Matrix1D< double > &alpha, double lambda) |
void | rotationalInvariantMoments (const MultidimArray< double > &img, const MultidimArray< int > *mask, MultidimArray< double > &v_out) |
void | inertiaMoments (const MultidimArray< double > &img, const MultidimArray< int > *mask, Matrix1D< double > &v_out, Matrix2D< double > &u) |
void | fillTriangle (MultidimArray< double > &img, int *tx, int *ty, double color) |
void | localThresholding (MultidimArray< double > &img, double C, double dimLocal, MultidimArray< int > &result, MultidimArray< int > *mask=nullptr) |
void | centerImageTranslationally (MultidimArray< double > &I, CorrelationAux &aux) |
void | centerImageRotationally (MultidimArray< double > &I, RotationalCorrelationAux &aux) |
Matrix2D< double > | centerImage (MultidimArray< double > &I, CorrelationAux &aux, RotationalCorrelationAux &aux2, int Niter=10, bool limitShift=true) |
void | forcePositive (MultidimArray< double > &V) |
template<typename T > | |
void | boundMedianFilter (MultidimArray< T > &V, const MultidimArray< char > &mask, int n=0) |
template<typename T > | |
void | pixelDesvFilter (MultidimArray< T > &V, double thresFactor) |
template<typename T > | |
void | logFilter (MultidimArray< T > &V, double a, double b, double c) |
void | SmoothResize (byte *srcpic8, byte *destpic8, size_t swide, size_t shigh, size_t dwide, size_t dhigh) |
Functions for all multidimensional arrays | |
template<typename T > | |
double | correlationIndex (const MultidimArray< T > &x, const MultidimArray< T > &y, const MultidimArray< int > *mask=NULL, MultidimArray< double > *Contributions=NULL) |
double alignImages | ( | const MultidimArray< double > & | Iref, |
MultidimArray< double > & | I, | ||
Matrix2D< double > & | M, | ||
bool | wrap = xmipp_transformation::WRAP |
||
) |
Align two images
This function modifies I to be aligned with Iref. Translational and rotational alignments are both considered. The matrix transforming I into Iref is returned.
The function returns the correlation between the two aligned images.
Definition at line 2141 of file filters.cpp.
double alignImages | ( | const MultidimArray< double > & | Iref, |
MultidimArray< double > & | I, | ||
Matrix2D< double > & | M, | ||
bool | wrap, | ||
AlignmentAux & | aux, | ||
CorrelationAux & | aux2, | ||
RotationalCorrelationAux & | aux3 | ||
) |
Fast version of align two images
Definition at line 2131 of file filters.cpp.
double alignImagesConsideringMirrors | ( | const MultidimArray< double > & | Iref, |
MultidimArray< double > & | I, | ||
Matrix2D< double > & | M, | ||
AlignmentAux & | aux, | ||
CorrelationAux & | aux2, | ||
RotationalCorrelationAux & | aux3, | ||
bool | wrap = xmipp_transformation::WRAP , |
||
const MultidimArray< int > * | mask = NULL |
||
) |
Align two images considering also the mirrors
This function modifies I to be aligned with Iref. Translational and rotational alignments are both considered. The correlation coefficient between I transformed and Iref is returned. A mask can be supplied for computing this correlation.
Definition at line 2189 of file filters.cpp.
void bestNonwrappingShift | ( | const MultidimArray< double > & | I1, |
const MultidimArray< double > & | I2, | ||
double & | shiftX, | ||
double & | shiftY, | ||
CorrelationAux & | aux | ||
) |
Translational search (non-wrapping)
This function returns the best interpolated shift for the alignment of two images. You can restrict the shift to a region defined by a mask (the maximum will be sought where the mask is 1).
Definition at line 1895 of file filters.cpp.
double bestRotationAroundZ | ( | const MultidimArray< double > & | Iref, |
const MultidimArray< double > & | I, | ||
CorrelationAux & | aux, | ||
VolumeAlignmentAux & | aux2 | ||
) |
Align two volumes by applying a rotation around Z. The rotation must be applied on I to get Iref.
Definition at line 2356 of file filters.cpp.
double bestShift | ( | const MultidimArray< double > & | I1, |
const MultidimArray< double > & | I2, | ||
double & | shiftX, | ||
double & | shiftY, | ||
CorrelationAux & | aux, | ||
const MultidimArray< int > * | mask = nullptr , |
||
int | maxShift = -1 |
||
) |
Translational search
This function returns the best interpolated shift for the alignment of two images. You can restrict the shift to a region defined by a mask (the maximum will be sought where the mask is 1).
To apply these results you must shift I1 by (-shiftX,-shiftY) or I2 by (shiftX, shiftY).
You can limit the maximum achievable shift by using maxShift. If it is set to -1, any shift is valid.
The function returns the maximum correlation found.
Definition at line 1735 of file filters.cpp.
void bestShift | ( | const MultidimArray< double > & | I1, |
const MultidimArray< double > & | I2, | ||
double & | shiftX, | ||
double & | shiftY, | ||
double & | shiftZ, | ||
CorrelationAux & | aux, | ||
const MultidimArray< int > * | mask = nullptr |
||
) |
Translational search (3D)
This function returns the best interpolated shift for the alignment of two volumes. You can restrict the shift to a region defined by a mask (the maximum will be sought where the mask is 1).
To apply these results you must shift I1 by (-shiftX,-shiftY,-shiftZ) or I2 by (shiftX, shiftY,shiftZ).
Definition at line 1755 of file filters.cpp.
double bestShiftRealSpace | ( | const MultidimArray< double > & | I1, |
MultidimArray< double > & | I2, | ||
double & | shiftX, | ||
double & | shiftY, | ||
const MultidimArray< int > * | mask = nullptr , |
||
int | maxShift = 5 , |
||
double | shiftStep = 1.0 |
||
) |
Translational search (non-wrapping).
Search is performed in real-space
Definition at line 1989 of file filters.cpp.
void boundMedianFilter | ( | MultidimArray< T > & | V, |
const MultidimArray< char > & | mask, | ||
int | n = 0 |
||
) |
Remove bad pixels.
A boundaries median filter is applied at those pixels given by the mask. The mask is set to zeros in the process of the tiltering. Keep a copy in case you further use it.
Definition at line 1309 of file filters.h.
Matrix2D<double> centerImage | ( | MultidimArray< double > & | I, |
CorrelationAux & | aux, | ||
RotationalCorrelationAux & | aux2, | ||
int | Niter = 10 , |
||
bool | limitShift = true |
||
) |
Center an image both translationally and rotationally
Given an image, this function returns the image that has been centered rotationally and translationally. For doing so, it compares this image with its mirrored (X, Y, XY) versions. The image is aligned translationally and then rotationally Niter times.
Definition at line 3277 of file filters.cpp.
void centerImageRotationally | ( | MultidimArray< double > & | I, |
RotationalCorrelationAux & | aux | ||
) |
Center an image rotationally
Given an image, this function returns the image that has been centered rotationally. For doing so, it compares this image with its mirrored (X) version.
Definition at line 3248 of file filters.cpp.
void centerImageTranslationally | ( | MultidimArray< double > & | I, |
CorrelationAux & | aux | ||
) |
Center an image translationally
Given an image, this function returns the image that has been centered translationally. For doing so, it compares this image with its mirrored (X, Y, XY) versions.
Definition at line 3212 of file filters.cpp.
void contrastEnhancement | ( | Image< double > * | I | ) |
Constrast enhancement
The minimum density value is brought to 0 and the maximum to 255.
Definition at line 327 of file filters.cpp.
double correlation | ( | const MultidimArray< T > & | x, |
const MultidimArray< T > & | y, | ||
const MultidimArray< int > * | mask = nullptr , |
||
int | l = 0 , |
||
int | m = 0 , |
||
int | q = 0 |
||
) |
double correlationIndex | ( | const MultidimArray< T > & | x, |
const MultidimArray< T > & | y, | ||
const MultidimArray< int > * | mask = NULL , |
||
MultidimArray< double > * | Contributions = NULL |
||
) |
correlationIndex nD
Definition at line 3974 of file multidim_array.h.
double correntropy | ( | const MultidimArray< T > & | x, |
const MultidimArray< T > & | y, | ||
double | sigma | ||
) |
Correntropy nD
Definition at line 381 of file filters.h.
double denoiseTVenergy | ( | double | mu, |
const MultidimArray< double > & | X, | ||
const MultidimArray< double > & | Y, | ||
double | s, | ||
double | q, | ||
double | lambda, | ||
double | sigmag, | ||
double | g | ||
) |
Compute energy.
X=current image Y=sensed image mu=regularization weight (on TV norm)
Definition at line 3959 of file filters.cpp.
void denoiseTVFilter | ( | MultidimArray< double > & | xnew, |
int | maxIter | ||
) |
Compute denoising.
Definition at line 4129 of file filters.cpp.
void denoiseTVgradient | ( | double | mu, |
const MultidimArray< double > & | X, | ||
const MultidimArray< double > & | Y, | ||
double | s, | ||
double | q, | ||
double | lambda, | ||
double | sigmag, | ||
double | g, | ||
MultidimArray< double > & | gradientI | ||
) |
Compute gradient.
X=current image Y=sensed image mu=regularization weight (on TV norm)
Definition at line 4017 of file filters.cpp.
void denoiseTVproj | ( | const MultidimArray< double > & | X, |
const MultidimArray< double > & | Y, | ||
double | theta, | ||
MultidimArray< double > & | dold | ||
) |
Function which makes projections on feasible set.
Definition at line 4108 of file filters.cpp.
void detectBackground | ( | const MultidimArray< double > & | vol, |
MultidimArray< double > & | mask, | ||
double | alpha, | ||
double & | final_mean | ||
) |
Detect background
This function receives a Matrix3D vol, and try to find the background assuming that all the outside planes contain background, and apply interval confidence, were alpha is the probabity to fail. Mask is of the same size of vol, and is the solution, mask have value 1 if background else value 0
Definition at line 197 of file filters.cpp.
void distanceTransform | ( | const MultidimArray< int > & | in, |
MultidimArray< int > & | out, | ||
bool | wrap = false |
||
) |
L1 distance transform
If wrap is set, the image borders are wrapped around. This is useful if the image coordinates represent angles
Definition at line 584 of file filters.cpp.
double EntropyOtsuSegmentation | ( | MultidimArray< double > & | V, |
double | percentil = 0.05 , |
||
bool | binarizeVolume = true |
||
) |
Segment an object using a combination of Otsu and Entropy method
The combination aims at minimizing Z(t)=-log10(sigma2B(t))/H(t) Minimizing the intraclass variance in Otsu is the same as maximizing sigma2B. H is the entropy of the two classes in the entropy method.
Then, the lowest percentil of Z is computed. The threshold applied to the volume is the first value in the curve Z(t) falling below this percentil.
The binarization threshold is returned
Definition at line 1145 of file filters.cpp.
double EntropySegmentation | ( | MultidimArray< double > & | V | ) |
Segment an object using Entropy method
Entropy method determines a threshold such that the entropy of the two classes is maximized
http://rsbweb.nih.gov/ij/plugins/download/Entropy_Threshold.java
Definition at line 1078 of file filters.cpp.
void estimateGaussian2D | ( | const MultidimArray< double > & | I, |
double & | a, | ||
double & | b, | ||
Matrix1D< double > & | mu, | ||
Matrix2D< double > & | sigma, | ||
bool | estimateMu = true , |
||
int | iterations = 10 |
||
) |
Fit Gaussian spot to an image.
The fitted Gaussian is a*G(r,mu,sigma)+b where G(r,mu,sigma)=exp(-0.5 * (r-mu)^t sigma^-1 (r-mu))
You can choose if the center is estimated or it is assumed to be 0. You can choose the number of iterations for the estiamtion.
Definition at line 2390 of file filters.cpp.
double euclidianDistance | ( | const MultidimArray< T > & | x, |
const MultidimArray< T > & | y, | ||
const MultidimArray< int > * | mask = nullptr |
||
) |
euclidian distance nD
Definition at line 672 of file filters.h.
double fastCorrentropy | ( | const MultidimArray< T > & | x, |
const MultidimArray< T > & | y, | ||
double | sigma, | ||
const GaussianInterpolator & | G | ||
) |
Fast Correntropy 1D
Definition at line 361 of file filters.h.
double fastMaskedCorrelation | ( | const MultidimArray< T > & | x, |
const MultidimArray< T > & | y, | ||
const MultidimArray< int > & | mask | ||
) |
Correlation nD
Definition at line 310 of file filters.h.
void fillBinaryObject | ( | MultidimArray< double > & | I, |
int | neighbourhood = 8 |
||
) |
Fill object
Everything that is not background is assumed to be object.
Definition at line 758 of file filters.cpp.
void fillTriangle | ( | MultidimArray< double > & | img, |
int * | tx, | ||
int * | ty, | ||
double | color | ||
) |
Fill a triangle defined by three points
The points are supplied as a pointer to three integer positions. They can be negative
Definition at line 3012 of file filters.cpp.
void forcePositive | ( | MultidimArray< double > & | V | ) |
Force positive.
A median filter is applied at those negative values. Positive values are untouched.
Force positive -----------------------------------------------------—
Definition at line 3506 of file filters.cpp.
void fourierBesselDecomposition | ( | const MultidimArray< double > & | img_in, |
double | r2, | ||
int | k1, | ||
int | k2 | ||
) |
Fourier-Bessel decomposition
The Fourier-Bessel decomposition of those pixels in img_in whose radius is between r1 and r2 is computed. r1 and r2 are supposed to fit in the image shape, and the image logical origin is used for the decomposition. k1 and k2 determines the harmonic coefficients to be computed.
Definition at line 2469 of file filters.cpp.
double giniCoeff | ( | MultidimArray< double > & | I, |
int | varKernelSize = 50 |
||
) |
Returns the Gini coefficient of an image. This is related to the Entropy. It also applies a variance filter to the input Image
Definition at line 972 of file filters.cpp.
void inertiaMoments | ( | const MultidimArray< double > & | img, |
const MultidimArray< int > * | mask, | ||
Matrix1D< double > & | v_out, | ||
Matrix2D< double > & | u | ||
) |
Inertia moments
They are measured with respect to the center of the image, and not with respect to the center of mass. For an image there are only two inertia moments. v_out contains the inertia moments while the columns of u contain the directions of the principal axes.
Definition at line 2970 of file filters.cpp.
void keepBiggestComponent | ( | MultidimArray< double > & | I, |
double | percentage = 0 , |
||
int | neighbourhood = 8 |
||
) |
Keep the biggest connected component
If the biggest component does not cover the percentage required (by default, 0), more big components are taken until this is accomplished.
Definition at line 713 of file filters.cpp.
int labelImage2D | ( | const MultidimArray< double > & | I, |
MultidimArray< double > & | label, | ||
int | neighbourhood = 8 |
||
) |
Label a binary image
This function receives a binary volume and labels all its connected components. The background is labeled as 0, and the components as 1, 2, 3 ...
Definition at line 648 of file filters.cpp.
int labelImage3D | ( | const MultidimArray< double > & | V, |
MultidimArray< double > & | label | ||
) |
Label a binary volume
This function receives a binary image and labels all its connected components. The background is labeled as 0, and the components as 1, 2, 3 ...
Definition at line 669 of file filters.cpp.
void localThresholding | ( | MultidimArray< double > & | img, |
double | C, | ||
double | dimLocal, | ||
MultidimArray< int > & | result, | ||
MultidimArray< int > * | mask = nullptr |
||
) |
Local thresholding
This function implements the local thresholding as described in http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm A mask can be supplied to limit the image area.
The procedure employed is the following:
Definition at line 3164 of file filters.cpp.
void logFilter | ( | MultidimArray< T > & | V, |
double | a, | ||
double | b, | ||
double | c | ||
) |
Compute logarithm.
apply transformation a+b*ln(x+c). i.e: 4.431-0.4018*LN(P1+336.6)
Definition at line 1411 of file filters.h.
void medianFilter3x3 | ( | MultidimArray< T > & | m, |
MultidimArray< T > & | out | ||
) |
Median_filter with a 3x3 selfWindow
Definition at line 1088 of file filters.h.
double mutualInformation | ( | const MultidimArray< T > & | x, |
const MultidimArray< T > & | y, | ||
int | nx = 0 , |
||
int | ny = 0 , |
||
const MultidimArray< int > * | mask = nullptr |
||
) |
mutual information nD
Return the mutual information: MI = sum [ P(x,y)*log2{P(x,y)/(P(x)*P(y))} ] in the common positions. P(x), P(y) are 1D-histograms of the values of matrix x and y. P(x,y) is the 2D-histogram, i.e. the count of times that a certain combination of values in matrices x and y has occurred. The sum runs over all histogram bins.
The histograms are calculated using the number of bins nx and ny. If no values (or zeros) are given, a Gaussian distribution of the values in the matrices is assumed, and the number of bins is calculated as: log2(n)+1. (according to: Tourassi et al. (2001) Med. Phys. 28 pp. 2394-2402.)
Definition at line 4291 of file filters.cpp.
void noisyZonesFilter | ( | MultidimArray< double > & | I, |
int | kernelSize = 10 |
||
) |
Transforms I to a binary mask with 0 where both variance and mean are high.
Definition at line 870 of file filters.cpp.
double OtsuSegmentation | ( | MultidimArray< double > & | V | ) |
Segment an object using Otsu's method
Otsu's method determines a threshold such that the variance of the two classes is minimized
http://www.biomecardio.com/matlab/otsu.html
Definition at line 1028 of file filters.cpp.
void pixelDesvFilter | ( | MultidimArray< T > & | V, |
double | thresFactor | ||
) |
Remove bad pixels.
A boundaries median filter is applied at those pixels whose value is out of range given by thresFactor * std.
Definition at line 1378 of file filters.h.
void regionGrowing2D | ( | const MultidimArray< double > & | I_in, |
MultidimArray< double > & | I_out, | ||
int | i, | ||
int | j, | ||
float | stop_colour = 1 , |
||
float | filling_colour = 1 , |
||
bool | less = true , |
||
int | neighbourhood = 8 |
||
) |
Region growing for images
Given a position inside an image, this function grows a region with (filling_colour) until it finds a border of value (stop_colour). If the point is outside the image then nothing is done.
If less is true the region is grown in sucha a way that all voxels in its border are greater than the region voxels. If less is false the region is grown so that all voxels on its border are smaller than the region voxels.
Valid neighbourhoods are 4 or 8.
Definition at line 340 of file filters.cpp.
void removeSmallComponents | ( | MultidimArray< double > & | I, |
int | size, | ||
int | neighbourhood = 8 |
||
) |
Remove connected components
Remove connected components smaller than a given size. They are set to 0.
Definition at line 689 of file filters.cpp.
double rms | ( | const MultidimArray< T > & | x, |
const MultidimArray< T > & | y, | ||
const MultidimArray< int > * | mask = nullptr , |
||
MultidimArray< double > * | Contributions = nullptr |
||
) |
RMS nD
Definition at line 725 of file filters.h.
void rotationalInvariantMoments | ( | const MultidimArray< double > & | img, |
const MultidimArray< int > * | mask, | ||
MultidimArray< double > & | v_out | ||
) |
Rotational invariant moments
The mask and the image are supposed to be of the same shape. If no mask is provided, the moments are computed on the whole image. The moments are measured with respect to the origin of the image.
These moments have been taken from http://www.cs.cf.ac.uk/Dave/Vision_lecture/node36.html (moments 1 to 5).
Definition at line 2900 of file filters.cpp.
void smoothingShah | ( | MultidimArray< double > & | img, |
MultidimArray< double > & | surface_strength, | ||
MultidimArray< double > & | edge_strength, | ||
const Matrix1D< double > & | W, | ||
int | OuterLoops, | ||
int | InnerLoops, | ||
int | RefinementLoops, | ||
bool | adjust_range = true |
||
) |
Mumford-Shah smoothing
This function simultaneously smooths and segments an image using non-linear diffusion. Mumford-&-Shah's functional minimization algorithm is used to detect region boundaries and relax image smoothness constraints near these discontinuities. The functional minimized is:
E = W0*(f-d)*(f-d) (data matching)
The program diffusion from KUIM (developed by J. Gaush, U. Kansas) was used as the "seed".
Paper: Teboul, et al. IEEE-Trans. on Image Proc. Vol. 7, 387-397.
Definition at line 2720 of file filters.cpp.
void SmoothResize | ( | byte * | srcpic8, |
byte * | destpic8, | ||
size_t | swide, | ||
size_t | shigh, | ||
size_t | dwide, | ||
size_t | dhigh | ||
) |
Resize of a 8-bit image
Definition at line 93 of file xvsmooth.cpp.
void sort | ( | T | a, |
T | b, | ||
T | c, | ||
MultidimArray< T > & | v | ||
) |
void substractBackgroundPlane | ( | MultidimArray< double > & | I | ) |
Subtract background
The background is computed as the plane which best fits all density values, then this plane is subtracted from the image.
Definition at line 40 of file filters.cpp.
void substractBackgroundRollingBall | ( | MultidimArray< double > & | I, |
int | radius | ||
) |
Subtract background
The background is computed as a rolling ball operation with a ball with this radius. The radius is typically Xdim/10.
This code has been implemented after the one of "Subtract background" in ImageJ.
Definition at line 75 of file filters.cpp.
double tomographicDiffusion | ( | MultidimArray< double > & | V, |
const Matrix1D< double > & | alpha, | ||
double | lambda | ||
) |
Tomographic diffusion
The direction of the tilt axis must be taken into account in the definition of the diffusion constants alpha.
The function returns the value of the regularization term.
Definition at line 2764 of file filters.cpp.
void varianceFilter | ( | MultidimArray< double > & | I, |
int | kernelSize = 10 , |
||
bool | relative = false |
||
) |
Applays a variance filter to an image
If relative=True, the filter is normalized to the mean (coeficient of variation)
Definition at line 775 of file filters.cpp.