67 "Enhances the visibility of the Thon rings in a Power Spectrum Density (PSD).");
69 addParamsLine(
"[--method <mth=filter>] : Choose enhancing method");
71 addParamsLine(
" filter <freq_low=0.05> <freq_high=0.2> <freq_decay=0.02>: Ad hoc filters. The algorithm is fully described at [[http://www.ncbi.nlm.nih.gov/pubmed/16987671][this article]]");
72 addParamsLine(
" : The frequency limits define a raised-cosine bandpass filter, frequencies are normalized to 0.5");
73 addParamsLine(
" spht <N0=1> <NF=10> : Spiral phase transform normalization.");
74 addParamsLine(
" : N0 and NF define the minimum and maximum number of fringes in the CTF");
76 addParamsLine(
" [--dont_center] : By default, the output is centered");
77 addParamsLine(
" [--dont_log] : Don't take log10 before working");
79 addParamsLine(
" [--m1 <freq_low=0.025>] : Low freq. for frequency mask, max 0.5");
80 addParamsLine(
" [--m2 <freq_high=0.3>] : High freq. for frequency mask, max 0.5");
81 addExampleLine(
"xmipp_ctf_enhance_psd -i myPSD.psd -o myPSD_enhanced.psd");
88 std::cout <<
"Filter w1: " <<
filter_w1 << std::endl <<
"Filter w2: " 90 << std::endl <<
"Mask w1: " <<
mask_w1 << std::endl
91 <<
"Mask w2: " <<
mask_w2 << std::endl;
100 if (
ZSIZE(PSD()) != 1)
143 limit0_2 = limit0_2 * limit0_2;
145 limitF_2 = limitF_2 * limitF_2;
149 double freqy2 =
YY(freq) *
YY(freq);
153 double freq2 =
XX(freq) *
XX(freq) + freqy2;
154 if (freq2 < limit0_2 || freq2 > limitF_2)
166 limit0_2 = limit0_2 * limit0_2;
168 limitF_2 = limitF_2 * limitF_2;
172 double freqy2 =
YY(freq) *
YY(freq);
176 double freq2 =
XX(freq) *
XX(freq) + freqy2;
177 A2D_ELEM(tighterMask,
i,
j) = freq2 > limit0_2 && freq2 < limitF_2;
183 double istddev = 1.0 / stddev;
190 limit0_2 = limit0_2 * limit0_2;
192 limitF_2 = limitF_2 * limitF_2;
196 double freqy2 =
YY(freq) *
YY(freq);
200 double freq2 =
XX(freq) *
XX(freq) + freqy2;
201 if (freq2 < limit0_2 || freq2 > limitF_2)
#define A2D_ELEM(v, i, j)
int N0
Minimum number of fringes.
void resize(size_t Ndim, size_t Zdim, size_t Ydim, size_t Xdim, bool copy=true)
double getDoubleParam(const char *param, int arg=0)
double filter_w2
Bandpass filter high frequency (in Fourier space, max 0.5)
#define REPORT_ERROR(nerr, ErrormMsg)
void resizeNoCopy(const MultidimArray< T1 > &v)
double mask_w1
Lower frequency for the mask (in Fourier space, max 0.5)
void write(const FileName &name="", size_t select_img=ALL_IMAGES, bool isStack=false, int mode=WRITE_OVERWRITE, CastWriteMode castMode=CW_CAST, int _swapWrite=0)
void computeAvgStdev_within_binary_mask(const MultidimArray< int > &mask, double &avg, double &stddev) const
#define FOR_ALL_ELEMENTS_IN_ARRAY2D(m)
void addSeeAlsoLine(const char *seeAlso)
double mask_w2
Higher frequency for the mask (in Fourier space, max 0.5)
void CenterFFT(MultidimArray< T > &v, bool forward)
const char * getParam(const char *param, int arg=0)
Problem with matrix dimensions.
void reject_outliers(T &v, double percentil_out=0.25)
void addExampleLine(const char *example, bool verbatim=true)
double decay_width
Decay width (raised cosine)
void log10(Image< double > &op)
__device__ float FFT_IDX2DIGFREQ(int idx, int size)
void processImage(const FileName &fnImg, const FileName &fnImgOut, const MDRow &rowIn, MDRow &rowOut)
double filter_w1
Bandpass filter low frequency (in Fourier space, max 0.5)
void medianFilter3x3(MultidimArray< T > &m, MultidimArray< T > &out)
void applyFilter(MultidimArray< double > &PSD)
int read(const FileName &name, DataMode datamode=DATA, size_t select_img=ALL_IMAGES, bool mapData=false, int mode=WRITE_READONLY)
void addUsageLine(const char *line, bool verbatim=false)
int getIntParam(const char *param, int arg=0)
void generateMask(MultidimArray< double > &v)
int NF
Maximum number of fringes.
void addParamsLine(const String &line)
void applyMaskSpace(MultidimArray< double > &v)
void applySPHT(MultidimArray< double > &PSD)
std::map< String, CommentList > defaultComments