void initialise() { // Get the MDs for both untilted and tilted particles MDu.read(fn_unt); MDt.read(fn_til); if (MDu.numberOfObjects() != MDt.numberOfObjects()) REPORT_ERROR("Tiltpair plot ERROR: untilted and tilted STAR files have unequal number of entries."); // Get the symmetry point group int pgGroup, pgOrder; SL.isSymmetryGroup(fn_sym, pgGroup, pgOrder); SL.read_sym_file(fn_sym); // Make postscript header fh_eps.open(fn_eps.c_str(), std::ios::out); if (!fh_eps) REPORT_ERROR("Tiltpair plot ERROR: Cannot open " + fn_eps + " for output"); fh_eps << "%%!PS-Adobe-2.0\n"; fh_eps << "%% Creator: Tilt pair analysis \n"; fh_eps << "%% Pages: 1\n"; fh_eps << "0 setgray\n"; fh_eps << "0.1 setlinewidth\n"; // Draw circles on postscript: 250pixels=plot_max_tilt fh_eps << "300 400 83 0 360 arc closepath stroke\n"; fh_eps << "300 400 167 0 360 arc closepath stroke\n"; fh_eps << "300 400 250 0 360 arc closepath stroke\n"; fh_eps << "300 150 newpath moveto 300 650 lineto stroke\n"; fh_eps << "50 400 newpath moveto 550 400 lineto stroke\n"; }
void symmetriseMap(MultidimArray<DOUBLE> &img, FileName &fn_sym, bool do_wrap) { if (img.getDim() != 3) REPORT_ERROR("symmetriseMap ERROR: symmetriseMap can only be run on 3D maps!"); img.setXmippOrigin(); SymList SL; SL.read_sym_file(fn_sym); Matrix2D<DOUBLE> L(4, 4), R(4, 4); // A matrix from the list MultidimArray<DOUBLE> sum, aux; sum = img; aux.resize(img); for (int isym = 0; isym < SL.SymsNo(); isym++) { SL.get_matrices(isym, L, R); applyGeometry(img, aux, R, IS_INV, do_wrap); sum += aux; } // Overwrite the input img = sum / (SL.SymsNo() + 1); }