52 program->
addParamsLine(
" [--wavelet <DWT_type=DAUB12> <mode=remove_scale>] : Different types of filters using wavelets");
54 program->
addParamsLine(
" DAUB4 DAUB12 DAUB20 : Discrete Wavelet Transform");
57 program->
addParamsLine(
" bayesian <SNR0=0.1> <SNRF=0.2> : Smallest(SNR0) and largest(SNRF) SNR.");
63 program->
addParamsLine(
" [--output_scale+ <s=0>] : output_scale");
64 program->
addParamsLine(
" [--th+ <th=50>] : threshold of values (%) to remove");
65 program->
addParamsLine(
" [-R+ <r=-1>] : Radius to keep, by default half the size");
66 program->
addParamsLine(
" [--white_noise+] : Select if the noise is white. Used by Bayesian filter.");
76 if (mode ==
"remove_scale")
78 else if (mode ==
"soft_thresholding")
80 else if (mode ==
"bayesian")
86 else if (mode ==
"adaptive_soft")
88 else if (mode ==
"central")
121 std::cout <<
"DWT type: " <<
DWT_type << std::endl;
122 std::cout <<
"Denoising: ";
126 std::cout <<
" Remove scale " <<
scale << std::endl;
129 std::cout <<
" Soft thresholding " <<
threshold << std::endl;
132 std::cout <<
" Bayesian\n";
133 std::cout <<
" SNR between " <<
SNR0 <<
" and " <<
SNRF << std::endl
134 <<
" up to scale " <<
scale << std::endl;
136 std::cout <<
" Imposing white noise\n";
139 std::cout <<
" Adaptive soft thresholding\n";
142 std::cout <<
" Keeping central part " <<
R <<
" pixels\n";
145 std::cout <<
"Output scale: " <<
output_scale << std::endl;
158 if (
ABS(size2 -
ROUND(size2)) > 1e-6)
161 if (
ABS(size2 -
ROUND(size2)) > 1e-6)
198 if (
ABS(size2 -
ROUND(size2)) > 1e-6)
201 if (
ABS(size2 -
ROUND(size2)) > 1e-6)
204 if (
ABS(size2 -
ROUND(size2)) > 1e-6)
229 std::cout <<
"Adaptive soft-thresholding not implemented for imgumes\n";
232 std::cout <<
"Keep central part not implemented for volumes\n";
void resize(size_t Ndim, size_t Zdim, size_t Ydim, size_t Xdim, bool copy=true)
void set_DWT_type(int DWT_type)
static void defineParams(XmippProgram *program)
double getDoubleParam(const char *param, int arg=0)
#define REPORT_ERROR(nerr, ErrormMsg)
void resizeNoCopy(const MultidimArray< T1 > &v)
Just for debugging, situation that can't happens.
void clean_quadrant3D(MultidimArray< double > &I, int scale, const std::string &quadrant)
void readParams(XmippProgram *program)
void rangeAdjust(T minF, T maxF)
double percentil(double percent_mass)
Incorrect MultidimArray size.
void clean_quadrant2D(MultidimArray< double > &I, int scale, const std::string &quadrant)
Matrix1D< double > bayesian_wiener_filtering2D(MultidimArray< double > &WI, int allowed_scale, double SNR0, double SNRF, bool white_noise, int tell, bool denoise)
const char * getParam(const char *param, int arg=0)
void compute_hist(const MultidimArrayGeneric &array, Histogram1D &hist, int no_steps)
void DWT(const MultidimArray< T > &v, MultidimArray< double > &result, int isign=1)
void denoiseAvgBayesian(MultidimArray< double > &vol)
void adaptive_soft_thresholding2D(MultidimArray< double > &I, int scale)
void log10(Image< double > &op)
int verbose
Verbosity level.
void apply(MultidimArray< double > &img)
Matrix1D< double > bayesian_wiener_filtering3D(MultidimArray< double > &WI, int allowed_scale, double SNR0, double SNRF, bool white_noise, int tell, bool denoise)
DenoisingType denoising_type
void DWT_keep_central_part(MultidimArray< double > &I, double R)
void IDWT(const MultidimArray< double > &v, MultidimArray< double > &result)
bool checkParam(const char *param)
void soft_thresholding(MultidimArray< double > &I, double th)
int getIntParam(const char *param, int arg=0)
Incorrect value received.
void addParamsLine(const String &line)
Matrix1D< double > estimatedS