46 addUsageLine(
"Calculate histogram from a list of images/volumes");
47 addParamsLine(
" -i <input_file> : input metadata, image, volume or stack");
48 addParamsLine(
" [-o <text_file>] : output text file with histogram");
49 addParamsLine(
" [--range <m> <M>] : range for the histogram, automatic calculated if not provided");
54 addExampleLine(
"Create the histogram from an stack setting number of steps to 20",
false);
55 addExampleLine(
"xmipp_histogram -i input/images_some.stk -o hist.txt --steps 20");
56 addExampleLine(
"You can use the =hist.txt= file with =gnuplot= to produce graphical histogram",
false);
57 addExampleLine(
"After you enter =gnuplot= terminal you can use:",
false);
58 addExampleLine(
"gnuplot> plot \"kk.txt\" using 1:2 title \"Histogram\" with steps");
76 automatic_range =
true;
82 automatic_range =
false;
99 auto iterId = mdIn.
ids().begin();
101 image().setXmippOrigin();
112 else if (automatic_range)
113 image().computeDoubleMinMax(m, M);
126 const auto totalSize = mdIn.
ids().end();
127 while (++iterId != totalSize)
130 image().setXmippOrigin();
double getDoubleParam(const char *param, int arg=0)
#define REPORT_ERROR(nerr, ErrormMsg)
MultidimArray< int > maskArray
int readApplyGeo(const FileName &name, const MDRow &row, const ApplyGeoParams ¶ms=DefaultApplyGeoParams)
void computeStats_within_binary_mask(const MultidimArray< T1 > &mask, const MultidimArray< T > &m, double &min_val, double &max_val, double &avg, double &stddev)
void addSeeAlsoLine(const char *seeAlso)
static void defineParams(XmippProgram *program, int allowed_data_types=ALL_KINDS, const char *prefix=nullptr, const char *comment=nullptr, bool moreOptions=false)
const char * getParam(const char *param, int arg=0)
void compute_hist(const MultidimArrayGeneric &array, Histogram1D &hist, int no_steps)
void addExampleLine(const char *example, bool verbatim=true)
void readParams(XmippProgram *program)
void generate_mask(bool apply_geo=false)
void write(const FileName &fn, MDLabel=MDL_X, MDLabel=MDL_COUNT)
bool checkParam(const char *param)
void addUsageLine(const char *line, bool verbatim=false)
const MultidimArray< int > & get_binary_mask() const
int getIntParam(const char *param, int arg=0)
void compute_hist_within_binary_mask(const MultidimArray< int > &mask, MultidimArray< T > &v, Histogram1D &hist, int no_steps)
void addParamsLine(const String &line)