Xmipp
v3.23.11-Nereus
|
#include <angular_discrete_assign.h>
Public Member Functions | |
ProgAngularDiscreteAssign () | |
Empty constructor. More... | |
void | readParams () |
Read argument from command line. More... | |
void | show () |
Show. More... | |
void | defineParams () |
Usage. More... | |
void | preProcess () |
void | postProcess () |
void | produce_library () |
void | build_ref_candidate_list (const Image< double > &I, bool *candidate_list, std::vector< double > &cumulative_corr, std::vector< double > &sumxy) |
void | refine_candidate_list_with_correlation (int m, Matrix1D< double > &dwt, bool *candidate_list, std::vector< double > &cumulative_corr, Matrix1D< double > &x_power, std::vector< double > &sumxy, double th=50) |
double | evaluate_candidates (const std::vector< double > &vscore, const std::vector< int > &candidate_idx, std::vector< double > &candidate_rate, double weight) |
void | group_views (const std::vector< double > &vrot, const std::vector< double > &vtilt, const std::vector< double > &vpsi, const std::vector< int > &best_idx, const std::vector< int > &candidate_idx, std::vector< std::vector< int > > &groups) |
int | pick_view (int method, std::vector< std::vector< int > > &groups, std::vector< double > &vscore, const std::vector< int > &candidate_idx, const std::vector< double > &candidate_rates) |
double | predict_rot_tilt_angles (Image< double > &I, double &assigned_rot, double &assigned_tilt, int &best_ref_idx) |
void | processImage (const FileName &fnImg, const FileName &fnImgOut, const MDRow &rowIn, MDRow &rowOut) |
Public Member Functions inherited from XmippMetadataProgram | |
MetaData * | getInputMd () |
MetaDataVec & | getOutputMd () |
XmippMetadataProgram () | |
Empty constructor. More... | |
virtual int | tryRead (int argc, const char **argv, bool reportErrors=true) |
virtual void | init () |
virtual void | setup (MetaData *md, const FileName &o="", const FileName &oroot="", bool applyGeo=false, MDLabel label=MDL_IMAGE) |
virtual | ~XmippMetadataProgram () |
void | setMode (WriteModeMetaData _mode) |
void | setupRowOut (const FileName &fnImgIn, const MDRow &rowIn, const FileName &fnImgOut, MDRow &rowOut) const |
Prepare rowout. More... | |
virtual void | wait () |
Wait for the distributor to finish. More... | |
virtual void | checkPoint () |
For very long programs, it may be needed to write checkpoints. More... | |
virtual void | run () |
Run over all images. More... | |
Public Member Functions inherited from XmippProgram | |
const char * | getParam (const char *param, int arg=0) |
const char * | getParam (const char *param, const char *subparam, int arg=0) |
int | getIntParam (const char *param, int arg=0) |
int | getIntParam (const char *param, const char *subparam, int arg=0) |
double | getDoubleParam (const char *param, int arg=0) |
double | getDoubleParam (const char *param, const char *subparam, int arg=0) |
float | getFloatParam (const char *param, int arg=0) |
float | getFloatParam (const char *param, const char *subparam, int arg=0) |
void | getListParam (const char *param, StringVector &list) |
int | getCountParam (const char *param) |
bool | checkParam (const char *param) |
bool | existsParam (const char *param) |
void | addParamsLine (const String &line) |
void | addParamsLine (const char *line) |
ParamDef * | getParamDef (const char *param) const |
virtual void | quit (int exit_code=0) const |
virtual int | tryRun () |
void | initProgress (size_t total, size_t stepBin=60) |
void | setProgress (size_t value=0) |
void | endProgress () |
void | processDefaultComment (const char *param, const char *left) |
void | setDefaultComment (const char *param, const char *comment) |
void | setProgramName (const char *name) |
void | addUsageLine (const char *line, bool verbatim=false) |
void | clearUsage () |
void | addExampleLine (const char *example, bool verbatim=true) |
void | addSeeAlsoLine (const char *seeAlso) |
void | addKeywords (const char *keywords) |
const char * | name () const |
virtual void | usage (int verb=0) const |
virtual void | usage (const String ¶m, int verb=2) |
int | version () const |
virtual void | read (int argc, const char **argv, bool reportErrors=true) |
virtual void | read (int argc, char **argv, bool reportErrors=true) |
void | read (const String &argumentsLine) |
XmippProgram () | |
XmippProgram (int argc, const char **argv) | |
virtual | ~XmippProgram () |
Additional Inherited Members | |
Protected Member Functions inherited from XmippMetadataProgram | |
virtual void | initComments () |
virtual bool | getImageToProcess (size_t &objId, size_t &objIndex) |
void | show () const override |
virtual void | startProcessing () |
virtual void | finishProcessing () |
virtual void | writeOutput () |
virtual void | showProgress () |
virtual void | defineLabelParam () |
Protected Member Functions inherited from XmippProgram | |
void | defineCommons () |
Protected Attributes inherited from XmippMetadataProgram | |
WriteModeMetaData | mode |
Metadata writing mode: OVERWRITE, APPEND. More... | |
FileName | oext |
Output extension and root. More... | |
FileName | oroot |
MDLabel | image_label |
MDLabel to be used to read/write images, usually will be MDL_IMAGE. More... | |
bool | produces_an_output |
Indicate that a unique final output is produced. More... | |
bool | produces_a_metadata |
Indicate that the unique final output file is a Metadata. More... | |
bool | each_image_produces_an_output |
Indicate that an output is produced for each image in the input. More... | |
bool | allow_apply_geo |
bool | decompose_stacks |
Input Metadata will treat a stack file as a set of images instead of a unique file. More... | |
bool | delete_output_stack |
Delete previous output stack file prior to process images. More... | |
bool | get_image_info |
Get the input image file dimensions to further operations. More... | |
bool | save_metadata_stack |
Save the associated output metadata when output file is a stack. More... | |
bool | track_origin |
Include the original input image filename in the output stack. More... | |
bool | keep_input_columns |
Keep input metadata columns. More... | |
bool | remove_disabled |
Remove disabled images from the input selfile. More... | |
bool | allow_time_bar |
Show process time bar. More... | |
bool | input_is_metadata |
Input is a metadata. More... | |
bool | single_image |
Input is a single image. More... | |
bool | input_is_stack |
Input is a stack. More... | |
bool | output_is_stack |
Output is a stack. More... | |
bool | create_empty_stackfile |
bool | delete_mdIn |
size_t | time_bar_step |
Some time bar related counters. More... | |
size_t | time_bar_size |
size_t | time_bar_done |
Protected Attributes inherited from XmippProgram | |
int | errorCode |
ProgramDef * | progDef |
Program definition and arguments parser. More... | |
std::map< String, CommentList > | defaultComments |
int | argc |
Original command line arguments. More... | |
const char ** | argv |
Angular Predict parameters.
Definition at line 41 of file angular_discrete_assign.h.
ProgAngularDiscreteAssign::ProgAngularDiscreteAssign | ( | ) |
Empty constructor.
Definition at line 35 of file angular_discrete_assign.cpp.
void ProgAngularDiscreteAssign::build_ref_candidate_list | ( | const Image< double > & | I, |
bool * | candidate_list, | ||
std::vector< double > & | cumulative_corr, | ||
std::vector< double > & | sumxy | ||
) |
Build candidate list. Build a candidate list with all possible reference projections which are not further than the maximum allowed change from the given image.
The list size is the total number of reference images. For each image the list is true if it is still a candidate.
Definition at line 267 of file angular_discrete_assign.cpp.
|
virtual |
Usage.
Reimplemented from XmippMetadataProgram.
Reimplemented in BasicMpiMetadataProgram< ProgAngularDiscreteAssign >.
Definition at line 91 of file angular_discrete_assign.cpp.
double ProgAngularDiscreteAssign::evaluate_candidates | ( | const std::vector< double > & | vscore, |
const std::vector< int > & | candidate_idx, | ||
std::vector< double > & | candidate_rate, | ||
double | weight | ||
) |
Evaluate candidates by correlation. The evaluation is returned in candidate_rate. Furthermore, this function returns the threshold for passing in the "score exam", a 7
Definition at line 470 of file angular_discrete_assign.cpp.
void ProgAngularDiscreteAssign::group_views | ( | const std::vector< double > & | vrot, |
const std::vector< double > & | vtilt, | ||
const std::vector< double > & | vpsi, | ||
const std::vector< int > & | best_idx, | ||
const std::vector< int > & | candidate_idx, | ||
std::vector< std::vector< int > > & | groups | ||
) |
Group views. The input images are supposed to be ordered by rate. The groups are also sorted by rate.
Definition at line 514 of file angular_discrete_assign.cpp.
int ProgAngularDiscreteAssign::pick_view | ( | int | method, |
std::vector< std::vector< int > > & | groups, | ||
std::vector< double > & | vscore, | ||
const std::vector< int > & | candidate_idx, | ||
const std::vector< double > & | candidate_rates | ||
) |
Pick the best image from the groups. If method == 0 it takes the maximum of the first group (the one with best rate). If method==1, it takes the maximum of the most populated group.
Definition at line 596 of file angular_discrete_assign.cpp.
|
virtual |
Write output metadata
Reimplemented from XmippMetadataProgram.
Definition at line 210 of file angular_discrete_assign.cpp.
double ProgAngularDiscreteAssign::predict_rot_tilt_angles | ( | Image< double > & | I, |
double & | assigned_rot, | ||
double & | assigned_tilt, | ||
int & | best_ref_idx | ||
) |
Predict rotational and tilting angles. The function returns the two assigned angles and the corresponding correlation. The index of the best matching reference image is also returned. The function predict shift and psi angle calls this one for evaluating each possible combination.
Definition at line 359 of file angular_discrete_assign.cpp.
|
virtual |
Produce side info.
Reimplemented from XmippMetadataProgram.
Reimplemented in BasicMpiMetadataProgram< ProgAngularDiscreteAssign >.
Definition at line 138 of file angular_discrete_assign.cpp.
|
virtual |
Process one image. Predict angles and shift. This function searches in the shift-psi space and for each combination it correlates with the whole reference set.
Implements XmippMetadataProgram.
Definition at line 703 of file angular_discrete_assign.cpp.
void ProgAngularDiscreteAssign::produce_library | ( | ) |
Produce library.
Definition at line 217 of file angular_discrete_assign.cpp.
|
virtual |
Read argument from command line.
Reimplemented from XmippMetadataProgram.
Reimplemented in BasicMpiMetadataProgram< ProgAngularDiscreteAssign >.
Definition at line 42 of file angular_discrete_assign.cpp.
void ProgAngularDiscreteAssign::refine_candidate_list_with_correlation | ( | int | m, |
Matrix1D< double > & | dwt, | ||
bool * | candidate_list, | ||
std::vector< double > & | cumulative_corr, | ||
Matrix1D< double > & | x_power, | ||
std::vector< double > & | sumxy, | ||
double | th = 50 |
||
) |
Refine candidate list via correlation. Given a projection image and the list of alive candidates, this function correlates the input image with all alive candidates and leave to pass only th% of the images.
m is the subband being studied
Definition at line 297 of file angular_discrete_assign.cpp.
void ProgAngularDiscreteAssign::show | ( | ) |
Show.
Definition at line 71 of file angular_discrete_assign.cpp.
int ProgAngularDiscreteAssign::checkMirrors |
Check Mirrors
Definition at line 68 of file angular_discrete_assign.h.
ProgAngularDistance ProgAngularDiscreteAssign::distance_prm |
Definition at line 106 of file angular_discrete_assign.h.
bool ProgAngularDiscreteAssign::extended_usage |
Extended usage
Definition at line 80 of file angular_discrete_assign.h.
FileName ProgAngularDiscreteAssign::fn_ref |
Selfile with the reference images
Definition at line 45 of file angular_discrete_assign.h.
FileName ProgAngularDiscreteAssign::fn_sym |
Filename for the symmetry file
Definition at line 47 of file angular_discrete_assign.h.
std::vector<MultidimArray<double> > ProgAngularDiscreteAssign::library |
Definition at line 95 of file angular_discrete_assign.h.
std::vector<FileName> ProgAngularDiscreteAssign::library_name |
Definition at line 97 of file angular_discrete_assign.h.
MultidimArray<double> ProgAngularDiscreteAssign::library_power |
Definition at line 100 of file angular_discrete_assign.h.
MultidimArray<int> ProgAngularDiscreteAssign::Mask_no |
Definition at line 92 of file angular_discrete_assign.h.
double ProgAngularDiscreteAssign::max_proj_change |
Maximum projection change. -1 means all are allowed.
Definition at line 50 of file angular_discrete_assign.h.
double ProgAngularDiscreteAssign::max_psi_change |
Maximum psi change. -1 means all are allowed
Definition at line 53 of file angular_discrete_assign.h.
double ProgAngularDiscreteAssign::max_shift_change |
Maximum shift change
Definition at line 57 of file angular_discrete_assign.h.
int ProgAngularDiscreteAssign::pick |
Way to pick views. 0 maximum correlation of the first group. 1 average of the most populated group. 2 maximum correlation of the most populated group.
Definition at line 73 of file angular_discrete_assign.h.
double ProgAngularDiscreteAssign::psi_step |
Psi step
Definition at line 55 of file angular_discrete_assign.h.
std::vector<double> ProgAngularDiscreteAssign::rot |
Definition at line 102 of file angular_discrete_assign.h.
int ProgAngularDiscreteAssign::SBNo |
Definition at line 85 of file angular_discrete_assign.h.
Matrix1D<int> ProgAngularDiscreteAssign::SBsize |
Definition at line 87 of file angular_discrete_assign.h.
bool ProgAngularDiscreteAssign::search5D |
5D search, instead of 3D+2D
Definition at line 82 of file angular_discrete_assign.h.
MetaDataVec ProgAngularDiscreteAssign::SF_ref |
Definition at line 89 of file angular_discrete_assign.h.
double ProgAngularDiscreteAssign::shift_step |
Shift step
Definition at line 59 of file angular_discrete_assign.h.
int ProgAngularDiscreteAssign::smax |
Maximum scale. Coarsest level
Definition at line 66 of file angular_discrete_assign.h.
int ProgAngularDiscreteAssign::smin |
Minimum scale. Finest level
Definition at line 64 of file angular_discrete_assign.h.
int ProgAngularDiscreteAssign::tell |
Show level.
Definition at line 78 of file angular_discrete_assign.h.
double ProgAngularDiscreteAssign::th_discard |
Threshold for discarding images. If it is 20%, only the 20% of the images will be kept each round.
Definition at line 62 of file angular_discrete_assign.h.
std::vector<double> ProgAngularDiscreteAssign::tilt |
Definition at line 104 of file angular_discrete_assign.h.