void read(int argc, char **argv) { parser.setCommandLine(argc, argv); int general_section = parser.addSection("General options"); fn1 = parser.getOption("--i1", "1st input STAR file "); fn2 = parser.getOption("--i2", "2nd input STAR file "); fn_both = parser.getOption("--both", "Output STAR file with entries from both input STAR files ", ""); fn_only1 = parser.getOption("--only1", "Output STAR file with entries that only occur in the 1st input STAR files ", ""); fn_only2 = parser.getOption("--only2", "Output STAR file with entries that only occur in the 2nd input STAR files ", ""); fn_label1 = parser.getOption("--label1", "1st metadata label for the comparison (may be string, int or DOUBLE)", ""); fn_label2 = parser.getOption("--label2", "2nd metadata label for the comparison (DOUBLE only) for 2D/3D-distance)", ""); fn_label3 = parser.getOption("--label3", "3rd metadata label for the comparison (DOUBLE only) for 3D-distance)", ""); eps = textToFloat(parser.getOption("--max_dist", "Maximum distance to consider a match (for int and DOUBLE only)", "0.")); // Check for errors in the command-line option if (parser.checkForErrors()) REPORT_ERROR("Errors encountered on the command line, exiting..."); }
void read(int argc, char **argv) { parser.setCommandLine(argc, argv); int general_section = parser.addSection("General options"); fn_star = parser.getOption("--i", "Input STAR file with the images (as rlnImageName) to be saved in a stack"); fn_root = parser.getOption("--o", "Output rootname","output"); do_spider = parser.checkOption("--spider_format", "Write out in SPIDER stack format (by default MRC stack format)"); do_split_per_micrograph = parser.checkOption("--split_per_micrograph", "Write out separate stacks for each micrograph (needs rlnMicrographName in STAR file)"); do_apply_trans = parser.checkOption("--apply_transformation", "Apply the inplane-transformations (needs _rlnOriginX/Y and _rlnAnglePsi in STAR file)"); fn_ext = (do_spider) ? ".spi" : ".mrcs"; // Check for errors in the command-line option if (parser.checkForErrors()) REPORT_ERROR("Errors encountered on the command line, exiting..."); }
void read(int argc, char **argv) { parser.setCommandLine(argc, argv); int general_section = parser.addSection("General Options"); fn_unt = parser.getOption("--u", "STAR file with the untilted xy-coordinates"); fn_til = parser.getOption("--t", "STAR file with the untilted xy-coordinates"); size = textToInteger(parser.getOption("--size", "Largest dimension of the micrograph (in pixels), e.g. 4096")); dim = textToInteger(parser.getOption("--dim", "Dimension of boxed particles (for EMAN .box files in pixels)", "200")); acc = textToFloat(parser.getOption("--acc", "Allowed accuracy (in pixels), e.g. half the particle diameter")); tilt = textToFloat(parser.getOption("--tilt", "Fix tilt angle (in degrees)", "99999.")); rot = textToFloat(parser.getOption("--rot", "Fix direction of the tilt axis (in degrees), 0 = along y, 90 = along x", "99999.")); do_opt = !parser.checkOption("--dont_opt", "Skip optimization of the transformation matrix"); mind2 = ROUND(acc * acc); int angle_section = parser.addSection("Specified tilt axis and translational search ranges"); tilt0 = textToFloat(parser.getOption("--tilt0", "Minimum tilt angle (in degrees)","0.")); tiltF = textToFloat(parser.getOption("--tiltF", "Maximum tilt angle (in degrees)","99999.")); if (tiltF == 99999.) tiltF = tilt0; tiltStep = textToFloat(parser.getOption("--tiltStep", "Tilt angle step size (in degrees)","1.")); rot0 = textToFloat(parser.getOption("--rot0", "Minimum rot angle (in degrees)","0.")); rotF = textToFloat(parser.getOption("--rotF", "Maximum rot angle (in degrees)","99999.")); if (rotF == 99999.) rotF = rot0; rotStep = textToFloat(parser.getOption("--rotStep", "Rot angle step size (in degrees)","1.")); x0 = textToInteger(parser.getOption("--x0", "Minimum X offset (pixels)","-99999")); xF = textToInteger(parser.getOption("--xF", "Maximum X offset (pixels)","99999")); xStep = textToInteger(parser.getOption("--xStep", "X offset step size (pixels)","-1")); y0 = textToInteger(parser.getOption("--y0", "Minimum Y offset (pixels)","-99999")); yF = textToInteger(parser.getOption("--yF", "Maximum Y offset (pixels)","99999")); yStep = textToInteger(parser.getOption("--yStep", "Y offset step size (pixels)","-1")); // Check for errors in the command-line option if (parser.checkForErrors()) REPORT_ERROR("Errors encountered on the command line, exiting..."); // If tilt and rot were given: do not search those if (tilt != 99999.) { tilt0 = tiltF = tilt; tiltStep = 1.; } if (rot != 99999.) { rot0 = rotF = rot; rotStep = 1.; } // By default search the entire micrograph x0 = XMIPP_MAX(x0, -size); xF = XMIPP_MIN(xF, size); // By default use a xStep of one third the accuracy if (xStep < 0) xStep = acc / 3; // By default treat y search in the same way as the x-search if (y0 == -99999) y0 = x0; if (yF == 99999) yF = xF; if (yStep < 0) yStep = xStep; // Done reading, now fill p_unt and p_til MDunt.read(fn_unt); MDtil.read(fn_til); // Check for the correct labels if (!MDunt.containsLabel(EMDL_IMAGE_COORD_X) || !MDunt.containsLabel(EMDL_IMAGE_COORD_Y)) REPORT_ERROR("ERROR: Untilted STAR file does not contain the rlnCoordinateX or Y labels"); if (!MDtil.containsLabel(EMDL_IMAGE_COORD_X) || !MDtil.containsLabel(EMDL_IMAGE_COORD_Y)) REPORT_ERROR("ERROR: Tilted STAR file does not contain the rlnCoordinateX or Y labels"); double x, y; p_unt.clear(); FOR_ALL_OBJECTS_IN_METADATA_TABLE(MDunt) { MDunt.getValue(EMDL_IMAGE_COORD_X, x); MDunt.getValue(EMDL_IMAGE_COORD_Y, y); p_unt.push_back((int)x); p_unt.push_back((int)y); } p_til.clear(); FOR_ALL_OBJECTS_IN_METADATA_TABLE(MDtil) { MDtil.getValue(EMDL_IMAGE_COORD_X, x); MDtil.getValue(EMDL_IMAGE_COORD_Y, y); p_til.push_back((int)x); p_til.push_back((int)y); } // Initialize best transformation params best_x = best_y = 9999; best_rot = best_tilt = 9999.; }
void usage() { parser.writeUsage(std::cerr); }
void read(int argc, char **argv) { parser.setCommandLine(argc, argv); int general_section = parser.addSection("General options"); fn_unt = parser.getOption("--u", "Input STAR file with untilted particles"); fn_til = parser.getOption("--t", "Input STAR file with tilted particles"); fn_eps = parser.getOption("--o", "Output EPS file ", "tiltpair.eps"); fn_sym = parser.getOption("--sym", "Symmetry point group", "C1"); exp_tilt = textToFloat(parser.getOption("--exp_tilt", "Choose symmetry operator that gives tilt angle closest to this value", "0.")); exp_beta = textToFloat(parser.getOption("--exp_beta", "Choose symmetry operator that gives beta angle closest to this value", "0.")); dist_from_alpha = textToFloat(parser.getOption("--dist_from_alpha", "Direction (alpha angle) of tilt axis from which to calculate distance", "0.")); dist_from_tilt = textToFloat(parser.getOption("--dist_from_tilt", "Tilt angle from which to calculate distance", "0.")); plot_max_tilt = textToFloat(parser.getOption("--max_tilt", "Maximum tilt angle to plot in the EPS file", "90.")); plot_spot_radius = textToInteger(parser.getOption("--spot_radius", "Radius in pixels of the spots in the tiltpair plot", "3")); // Check for errors in the command-line option if (parser.checkForErrors()) REPORT_ERROR("Errors encountered on the command line, exiting..."); }