38 addUsageLine(
"Analyze image SSNR. For doing so, we estimate the SSNR of each particle defining as signal "\
39 "the part of the image within a certain radius, and as noise the part of the image outside.");
41 addParamsLine(
" [-R <r=-1>]: Particle radius, by default, half size of the image");
42 addParamsLine(
" [--Rwidth <r=3>]: Transition radius the mask is 1 till R-Rwidth, and zero from R+Rwidth");
43 addParamsLine(
" [--fmin <f=40>]: Minimum frequency (in Angstroms) to measure");
44 addParamsLine(
" [--fmax <f=3>]: Maximum frequency (in Angstroms) to measure");
45 addParamsLine(
" [--sampling <Ts=1>]: Sampling rate in Angstroms/pixel");
46 addParamsLine(
" [--ssnrcut <ssnr=-1>]: Disable images whose SSNR is below this value");
47 addParamsLine(
" [--ssnrpercent <p=-1>]: Disable images whose SSNR is below this percentage");
48 addParamsLine(
" [--normalizessnr]: Normalize the SSNR by dividing by the maximum SSNR");
49 addExampleLine(
"xmipp_image_ssnr -i images.xmd -o imagesOut.xmd ");
67 size_t Xdim, Ydim, Zdim, Ndim;
89 img().setXmippOrigin();
121 for (
size_t objId : mdOut.
ids())
132 double maxSSNR=-1e38;
133 for (
size_t objId : mdOut.
ids())
143 double imaxSSNR=1/maxSSNR;
144 for (
size_t objId : mdOut.
ids())
160 std::vector<double> ssnr;
void thresholdSSNR(MetaData &mdOut, double ssnrcut)
void min(Image< double > &op1, const Image< double > &op2)
double getDoubleParam(const char *param, int arg=0)
void normalizeSSNR(MetaData &mdOut)
#define FOR_ALL_DIRECT_ELEMENTS_IN_ARRAY1D(v)
MultidimArray< double > maskS
void getSpectrum(MultidimArray< double > &Min, MultidimArray< double > &spectrum, int spectrum_type)
#define DIRECT_A1D_ELEM(v, i)
T & getValue(MDLabel label)
void max(Image< double > &op1, const Image< double > &op2)
void addExampleLine(const char *example, bool verbatim=true)
void log10(Image< double > &op)
void processImage(const FileName &fnImg, const FileName &fnImgOut, const MDRow &rowIn, MDRow &rowOut)
void sort(struct DCEL_T *dcel)
void setValue(MDLabel label, const T &d, bool addLabel=true)
MultidimArray< double > maskN
bool checkParam(const char *param)
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)
void initZeros(const MultidimArray< T1 > &op)
void RaisedCosineMask(MultidimArray< double > &mask, double r1, double r2, int mode, double x0, double y0, double z0)
MultidimArray< double > spectrumN
MultidimArray< double > spectrumS
void addParamsLine(const String &line)