52 "Compute deformation parameters according to a set of NMA modes");
55 "Metadata with output alignment and deformations");
58 " --pdb <PDB_filename> : PDB Model to compute NMA");
59 addParamsLine(
" [--odir <outputDir=\".\">] : Output directory");
63 " --modes <filename> : File with a list of mode filenames");
65 " [--defampsampling <s=200>] : Deformation sampling");
67 " [--maxdefamp <s=2000>] : Maximum deformation amplitude");
69 " [--translsampling <s=2>] : Translational sampling");
71 " [--maxtransl <max=10>] : Maximum translation");
73 " [--sampling_rate <Ts=1>] : in Angstroms/pixel");
75 " [--filterVol <cutoff=15.>] : Filter the volume after deforming. Default cut-off is 15 A.");
77 " [--centerPDB] : Center the PDB structure");
79 " [--fixed_Gaussian <std=-1>] : For pseudo atoms fixed_Gaussian must be used.");
81 " : Default standard deviation <std> is read from PDB file.");
84 " [--mask <m=\"\">] : 2D Mask applied to the reference images of the deformed volume");
86 " :+Note that wavelet assignment needs the input images to be of a size power of 2");
88 " [--minAngularSampling <ang=3>] : Minimum angular sampling rate");
90 " [--gaussian_Real <s=0.5>] : Weighting sigma in Real space");
92 " [--zerofreq_weight <s=0.>] : Zero-frequency weight");
95 " [--max_iter <N=60>] : Maximum number of iterations");
97 "xmipp_nma_alignment -i images.sel --pdb 2tbv.pdb --modes modelist.xmd --sampling_rate 6.4 -o output.xmd --resume");
131 std::cout <<
"Output directory: " <<
fnOutDir << std::endl
132 <<
"PDB: " <<
fnPDB << std::endl
133 <<
"Resume: " <<
resume << std::endl
136 <<
"Maximum amplitude: " <<
maxdefamp << std::endl
138 <<
"Max. Translation: " <<
maxtransl << std::endl
140 <<
"Mask: " <<
fnmask << std::endl
148 <<
"Sigma: " <<
sigma << std::endl
163 global_flexible_prog =
this;
179 const char *randStr = fnRandom.c_str();
180 program =
"xmipp_pdb_nma_deform";
182 "--pdb %s -o %s_deformedPDB.pdb --nma %s --deformations ",
195 int Xwidth,
int Ywidth,
double sigma)
201 auto psi_max = (int) (
sqrt(3) * Ywidth / 2);
204 double centre_Xwidth, centre_Ywidth;
207 proj_help_test.
initZeros(Xwidth, Ywidth);
208 std::vector<double> ksi_v(4,0);
209 for (
int i = 0;
i < dim + 5;
i++) {
210 global_flexible_prog->
trial(
i) = Parameters(
i);
218 const char *randStr = fnRandom.c_str();
220 program =
"xmipp_pdb_nma_deform";
222 "--pdb %s -o %s_deformedPDB.pdb --nma %s --deformations ",
223 global_flexible_prog->
fnPDB.c_str(), randStr,
226 float aaa = global_flexible_prog->
scdefamp * Parameters(
i);
232 centre_Xwidth = double(Xwidth - 1) / 2.0;
233 centre_Ywidth = double(Ywidth - 1) / 2.0;
235 const char *intensityColumn =
" ";
237 limitF, intensityColumn);
238 centerOfMass = (limit0 + limitF) / 2;
239 std::ifstream fh_deformedPDB;
240 fh_deformedPDB.open(deformed_pdb.c_str());
244 (std::string )
"Prog_PDBPhantom_Parameters::protein_geometry:" 245 "Cannot open " + deformed_pdb +
" for reading");
250 (std::string )
"Prog_PDBPhantom_Parameters::protein_geometry:" 251 "Cannot open " + deformed_pdb +
" for reading");
253 std::vector<double> ro_ksi_v(4,0);
258 std::vector<double> coord_gaussian(4,0);
259 std::vector<double> ro_coord_gaussian(4,0);
261 coord_gaussian[3] = 1.0;
263 std::vector<double> coord_img(4,0);
264 std::vector<double> ro_coord_img(4,0);
270 std::string atom_type;
275 FileName fileNameDeformedPdb(deformed_pdb.c_str());
276 pdb.
read(fileNameDeformedPdb);
279 while (!fh_deformedPDB.eof()) {
282 getline(fh_deformedPDB, line);
285 kind = line.substr(0, 4);
286 if (kind !=
"ATOM" && kind !=
"HETA")
292 const auto& atom = pdb.
atomList[nAtom];
293 atom_type = atom.atomType;
297 coord_gaussian[0] = (x - centerOfMass(0))
299 coord_gaussian[1] = (y - centerOfMass(1))
301 coord_gaussian[2] = (z - centerOfMass(2))
304 for (
int ksi = -psi_max; ksi <= psi_max; ksi++) {
305 ksi_v[2] = (double) ksi;
308 for (ky = 0; ky < Ywidth; ky++) {
309 coord_img[1] = (double) ky - centre_Ywidth;
310 for (kx = 0; kx < Xwidth; kx++) {
311 coord_img[0] = (double) kx - centre_Xwidth;
312 MatrixMultiply(Tr, coord_img.data(), ro_coord_img.data(), 4L, 4L, 1L);
314 a0 = ro_coord_img[0] + ro_ksi_v[0] + coord_gaussian[0];
315 a1 = ro_coord_img[1] + ro_ksi_v[1] + coord_gaussian[1];
316 a2 = ro_coord_img[2] + ro_ksi_v[2] + coord_gaussian[2];
317 proj_help_test(kx - Xwidth / 2, ky - Ywidth / 2) +=
319 -(a0 * a0 + a1 * a1 + a2 * a2)
328 test1() = proj_help_test;
331 fh_deformedPDB.close();
333 for (sum2 = 0.0, kx = 0; kx < Xwidth; kx++) {
334 for (ky = 0; ky < Ywidth; ky++) {
335 hlp = (double) (proj_help_test(kx - Xwidth / 2, ky - Ywidth / 2)
336 - P_esp_image(kx - Xwidth / 2, ky - Ywidth / 2));
337 hlp = (double) hlp * hlp;
338 sum2 += (double) hlp;
355 int Xwidth,
int Ywidth) {
357 double help, a0, a1, a2;
362 double centre_Xwidth, centre_Ywidth;
363 centre_Xwidth = (double) (Xwidth - 1) / 2.0;
364 centre_Ywidth = (double) (Ywidth - 1) / 2.0;
373 std::ifstream ModeFile;
375 std::string modefilename = global_flexible_prog->
modeList[0];
376 ModeFile.open(modefilename.c_str());
379 (std::string ) modefilename +
" for reading");
381 while (getline(ModeFile, line)) {
386 std::vector<double> ModeValues(3 * Line_number * dim);
389 for (
int i = 0;
i < dim;
i++) {
390 modefilename = global_flexible_prog->
modeList[
i];
391 ModeFile.open(modefilename.c_str());
393 while (getline(ModeFile, line)) {
394 x = line.substr(3, 10);
395 y = line.substr(14, 10);
396 z = line.substr(27, 10);
397 ModeValues[
i * 3 * Line_number + n * 3 + 0] = atof(x.c_str());
398 ModeValues[
i * 3 * Line_number + n * 3 + 1] = atof(y.c_str());
399 ModeValues[
i * 3 * Line_number + n * 3 + 2] = atof(z.c_str());
405 for (
int i = 0;
i < dim + 5;
i++) {
406 global_flexible_prog->
trial(
i) = Parameters(
i);
410 std::ifstream fh_deformedPDB;
411 fh_deformedPDB.open((fnRandom +
"_deformedPDB.pdb").c_str());
414 (std::string )
"Prog_PDBPhantom_Parameters::protein_geometry:" "Cannot open " 415 + fnRandom +
"_deformedPDB.pdb" +
" for reading");
418 std::vector<double> help_v(4,0);
423 std::vector<double> coord_gaussian(4,0);
424 coord_gaussian[3] = 1.0;
426 std::vector<double> coord_img(4,0);
433 FileName fileNameDeformedPdb((fnRandom +
"_deformedPDB.pdb").c_str());
434 pdb.
read(fileNameDeformedPdb);
438 while (!fh_deformedPDB.eof()) {
440 getline(fh_deformedPDB, line);
443 kind = line.substr(0, 4);
450 const auto& atom = pdb.
atomList[nAtom];
451 char atom_type = atom.atomType;
452 double xPos = atom.x;
453 double yPos = atom.y;
454 double zPos = atom.z;
457 coord_gaussian[0] = (xPos - centerOfMass(0))
459 coord_gaussian[1] = (yPos - centerOfMass(1))
461 coord_gaussian[2] = (zPos - centerOfMass(2))
470 for (
int ksi = -psi_max; ksi <= psi_max; ksi++) {
471 coord_img[3] = (double) ksi;
472 for (kx = 0; kx < Xwidth; kx++) {
473 for (ky = 0; ky < Ywidth; ky++) {
475 coord_img[0] = (double) kx - centre_Xwidth;
476 coord_img[1] = (double) ky - centre_Ywidth;
483 a0 = help_v[0] + coord_gaussian[0];
484 a1 = help_v[1] + coord_gaussian[1];
485 a2 = help_v[2] + coord_gaussian[2];
488 -(a0 * a0 + a1 * a1 + a2 * a2)
489 / (global_flexible_prog->
sigma 490 * global_flexible_prog->
sigma));
496 DP_Rz1(kx, ky) += help
497 * (a0 * help_v[0] + a1 * help_v[1]
503 DP_Ry(kx, ky) += help
504 * (a0 * help_v[0] + a1 * help_v[1]
510 DP_Rz2(kx, ky) += help
511 * (a0 * help_v[0] + a1 * help_v[1]
513 DP_x(kx, ky) += help * (a0 * R[0] + a1 * R[1] + a2 * R[2]);
514 DP_y(kx, ky) += help * (a0 * R[4] + a1 * R[5] + a2 * R[6]);
515 for (
int i = 0;
i < dim;
i++) {
516 DP_q(
i, kx, ky) += global_flexible_prog->
scdefamp * help
517 * (a0 * ModeValues[
i * 3 * Line_number + k * 3]
518 + a1 * ModeValues[
i * 3 * Line_number + k * 3 + 1]
519 + a2 * ModeValues[
i * 3 * Line_number + k * 3 + 2]);
527 fh_deformedPDB.close();
538 for (
int i = 0;
i < trialSize;
i++) {
539 Gradient[
i] += difference * helpgr[
i];
540 for (
int j = 0;
j <=
i;
j++) {
541 Hessian[
i * trialSize +
j] += helpgr[
j] * helpgr[
i];
554 int Xwidth,
int Ywidth) {
558 double SinPhi, CosPhi, SinPsi, CosPsi, SinTheta, CosTheta;
561 double sigmalocal = global_flexible_prog->
sigma;
562 int half_Xwidth = Xwidth / 2;
563 int half_Ywidth = Ywidth / 2;
567 for (
int i = 0; i < dim + 5; i++) {
568 global_flexible_prog->
trial(i) = Parameters(i);
571 theta = Parameters(1);
585 SinTheta = sin(theta);
586 CosTheta = cos(theta);
587 std::vector<double> Rz1(16,0);
588 std::vector<double> Ry(16,0);
589 std::vector<double> Rz2(16,0);
594 double *hlp = Rz2.data();
597 hlp += (std::ptrdiff_t) 3L;
609 hlp += (std::ptrdiff_t) 3L;
619 hlp += (std::ptrdiff_t) 2L;
621 hlp += (std::ptrdiff_t) 6L;
623 hlp += (std::ptrdiff_t) 2L;
626 std::vector<double> R(16,0);
632 std::vector<double> DRz1(16,0);
633 std::vector<double> DRy(16,0);
634 std::vector<double> DRz2(16,0);
639 hlp += (std::ptrdiff_t) 3L;
646 hlp += (std::ptrdiff_t) 3L;
652 hlp += (std::ptrdiff_t) 2L;
654 hlp += (std::ptrdiff_t) 6L;
656 hlp += (std::ptrdiff_t) 2L;
659 std::vector<double> DR0(16,0);
660 std::vector<double> DR1(16,0);
661 std::vector<double> DR2(16,0);
678 std::vector<double> Tr(16,0);
685 hlp += (std::ptrdiff_t) 3L;
687 hlp += (std::ptrdiff_t) 5L;
690 Xwidth, Ywidth, sigmalocal);
696 if (
partialpfunction(Parameters, centerOfMass, R.data(), Tr.data(), DR0.data(), DR1.data(), DR2.data(), DP_Rx,
697 DP_Ry, DP_Rz2, DP_x, DP_y, P_esp_image, Xwidth,
703 std::vector<double> helpgr(trialSize,0);
705 for (i = 0; i < trialSize; i++) {
707 for (j = 0; j < trialSize; j++) {
708 Hessian[i * trialSize +
j] = 0.0;
712 for (
int kx = 0; kx < Xwidth; kx++)
713 for (
int ky = 0; ky < Ywidth; ky++) {
714 difference = rg_projimage(kx - half_Xwidth, ky - half_Ywidth)
715 - P_esp_image(kx - half_Xwidth, ky - half_Ywidth);
716 helpgr[0] = DP_Rx(kx, ky);
717 helpgr[1] = DP_Ry(kx, ky);
718 helpgr[2] = DP_Rz2(kx, ky);
719 helpgr[3] = DP_x(kx, ky);
720 helpgr[4] = DP_y(kx, ky);
721 for (j = 0; j < dim; j++) {
722 helpgr[5 +
j] = DP_q(j, kx, ky);
727 for (
int i = 0; i < trialSize; i++) {
728 Hessian[i * trialSize +
i] += lambda * Hessian[i * trialSize +
i];
729 if (i + 1 < trialSize)
730 for (
int j = i + 1; j < trialSize; j++) {
731 Hessian[i * trialSize +
j] = Hessian[j * trialSize +
i];
742 double *
beta,
double *alpha,
745 double LambdaScale,
long *iter,
double tol_angle,
double tol_shift,
746 double tol_defamp,
int *IteratingStop,
size_t Xwidth,
size_t Ywidth) {
757 std::vector<double>
a(ma,0);
758 for (
size_t i = 0;
i < ma;
i++)
759 a[
i] = Parameters(
i);
761 std::vector<double> da(ma,0);
762 std::vector<double>
u(ma*ma,0);
763 std::vector<double> v(ma*ma,0);
764 std::vector<double>
w(ma,0);
766 double *t = u.data();
767 double *uptr = u.data();
768 for (
size_t i = 0L; (
i < ma); t += (std::ptrdiff_t) (ma + 1L),
i++) {
769 for (
size_t j = 0L; (
j < ma); alpha++,
j++) {
775 alpha -= (std::ptrdiff_t) (ma * ma);
778 double wmax = *std::max_element(w.begin(), w.end());
784 for (
size_t i = 0; (
i < ma);
i++) {
792 double *vptr = (
double*) memcpy(v.data(), a.data(), (size_t) ma *
sizeof(
double));
793 t = vptr + (std::ptrdiff_t) ma;
794 double *aptr = a.data()+(std::ptrdiff_t) ma;
795 double *daptr = da.data()+(std::ptrdiff_t) ma;
796 while (--t >= vptr) {
801 for (
size_t i = 0;
i < ma;
i++)
802 Parameters(
i) = v[
i];
805 P_esp_image, Xwidth, Ywidth);
809 for (max_defamp = 0.0, i = 0L; i < dim; i++) {
810 double hlp = fabs(a[i + 5] - v[i + 5]);
811 if (hlp > max_defamp)
812 max_defamp = fabs(a[i + 5] - v[i + 5]);
816 if (costchanged < OldCost) {
817 if ((fabs(a[0] - v[0]) < tol_angle) && (fabs(a[1] - v[1]) < tol_angle)
818 && (fabs(a[2] - v[2]) < tol_angle)) {
819 if ((fabs(a[3] - v[3]) < tol_shift)
820 && (fabs(a[4] - v[4]) < tol_shift)) {
821 if (max_defamp < tol_defamp) {
829 if (costchanged < OldCost) {
830 for (i = 0L; (i < ma); i++) {
831 for (j = 0L; (j < ma); j++)
832 alpha[i * ma + j] = u[i * ma + j];
842 for (i = 0L; (i < ma); i++) {
843 for (j = 0L; (j < ma); j++)
844 alpha[i * ma + j] = u[i * ma + j];
851 #define DBL_MIN 1e-26 854 #define DBL_MAX 1e+26 857 if (costchanged < OldCost) {
859 *lambda /= LambdaScale;
865 *lambda *= LambdaScale;
879 int DoDesProj, IteratingStop, FlagMaxIter;
880 long MaxIter, MaxIter1,
iter;
881 long MaxNumberOfFailures, SatisfNumberOfSuccesses, nSuccess, nFailure;
882 double LambdaScale = 2., OldCost, tol_angle, tol_shift, tol_defamp;
883 double OneIterInSeconds;
884 time_t *tp1 =
nullptr;
885 time_t *tp2 =
nullptr;
887 long MaxNoIter, MaxNoFailure, SatisfNoSuccess;
890 time_t time1 = time(tp1);
893 MaxNoFailure = (long) (0.3 * MaxNoIter);
894 SatisfNoSuccess = (long) (0.7 * MaxNoIter);
896 MaxIter1 = MaxIter - 1L;
898 MaxNumberOfFailures = MaxNoFailure;
899 SatisfNumberOfSuccesses = SatisfNoSuccess;
904 std::vector<double> Gradient(dim + 5,0);
905 std::vector<double> Hessian((dim + 5) * (dim + 5),0);
907 if (DoDesProj && (global_flexible_prog->
currentStage == 2)) {
918 cst_P_mu_image, P_esp_image, Xwidth, Ywidth) ==
ERROR) {
922 time_t time2 = time(tp2);
923 OneIterInSeconds = difftime(time2, time1);
924 if (DoDesProj && (global_flexible_prog->
currentStage == 2)) {
926 Itemp() = cst_P_mu_image;
927 Itemp.
write(
"test_refimage.spi");
930 if ((MaxIter == 0L) && (!DoDesProj))
937 FlagMaxIter = (MaxIter != 1L);
942 if (
levenberg_cst2(cst_P_mu_image, P_esp_image, centerOfMass, Gradient.data(),
943 Hessian.data(), Parameters, OldCost, &
lambda, LambdaScale, &iter,
944 tol_angle, tol_shift, tol_defamp, &IteratingStop, Xwidth,
953 if (nSuccess >= SatisfNumberOfSuccesses) {
963 }
while ((nFailure <= MaxNumberOfFailures) && (iter < MaxIter1)
971 int ModMaxdeDefamp, ModpowDim, help;
972 double SinPhi, CosPhi, SinPsi, CosPsi;
973 double S_muMin = 1e30;
978 const char *intensityColumn =
"Bfactor";
980 centerOfMass = (limit0 + limitF) / 2;
988 if (pyramidLevel != 0) {
997 imgtemp().setXmippOrigin();
999 P_mu_image.
resize(imgtemp());
1000 int Xwidth =
XSIZE(imgtemp());
1001 int Ywidth =
YSIZE(imgtemp());
1002 double reduce_rate = 1;
1005 ModpowDim = (int) pow(ModMaxdeDefamp, dim);
1007 std::vector<double> Rz1(16,0);
1008 std::vector<double> Ry(16,0);
1009 std::vector<double> Rz2(16,0);
1010 std::vector<double> R(16,0);
1011 std::vector<double> Tr(16,0);
1017 for (
int iphi = 0; iphi <= phiSteps; iphi++) {
1019 Parameters(0) = phi;
1021 SinPhi = sin(phi / 180 *
PI);
1022 CosPhi = cos(phi / 180 *
PI);
1026 double *hlp = Ry.data();
1028 hlp += (std::ptrdiff_t) 2L;
1030 hlp += (std::ptrdiff_t) 6L;
1032 hlp += (std::ptrdiff_t) 2L;
1035 for (
int itheta = 0; itheta <=thetaSteps; itheta++) {
1037 Parameters(1) =
theta;
1045 hlp += (std::ptrdiff_t) 3L;
1049 for (
int ipsi = 0; ipsi<=psiSteps; ipsi++) {
1051 Parameters(2) =
psi;
1053 SinPsi = sin(psi / 180 *
PI);
1054 CosPsi = cos(psi / 180 *
PI);
1061 hlp += (std::ptrdiff_t) 3L;
1067 for (
int ix0=0; ix0<=transSteps; ix0++) {
1069 Parameters(3) = x0 / reduce_rate;
1071 for (
int iy0=0; iy0<=transSteps; iy0++) {
1073 Parameters(4) = y0 / reduce_rate;
1078 hlp += (std::ptrdiff_t) 3L;
1080 hlp += (std::ptrdiff_t) 5L;
1085 for (
int i = 0;
i < ModpowDim;
i++) {
1087 for (
int j = dim - 1;
j >= 0;
j--) {
1088 Parameters(
j + 5) = (double) (help
1090 trial(
j + 5) = (double) (help % ModMaxdeDefamp)
1092 help = (int)
floor(help / ModMaxdeDefamp);
1097 P_mu_image, imgtemp(), Xwidth, Ywidth,
1102 for (
int k = 0;
k < dim + 5;
k++) {
1107 std::cout <<
"trial" <<
trial <<
" cost=" 1110 <<
" cost_best=" << S_muMin << std::endl;
1120 std::cout <<
"trial_best" <<
trial_best << S_muMin << std::endl;
1121 for (
int i = 0;
i < dim + 5;
i++) {
1127 size_t id = DF_out_discrete.
addObject();
1129 std::vector<double> aux;
1134 DF_out_discrete.
write(
"result_angular_discrete.xmd");
1146 std::string command;
1147 if (pyramidLevel == 0) {
1164 imgtemp().setXmippOrigin();
1166 P_esp_image = imgtemp();
1167 P_mu_image.
resize(imgtemp());
1168 int Xwidth =
XSIZE(imgtemp());
1169 int Ywidth =
YSIZE(imgtemp());
1172 const char *intensityColumn =
"Bfactor";
1176 centerOfMass = (limit0 + limitF) / 2;
1182 trial(3) *= pow(2.0, (
double) pyramidLevel);
1183 trial(4) *= pow(2.0, (
double) pyramidLevel);
1193 int pyramidLevelDisc = 1;
1203 std::cout <<
"Fitness" << std::endl;
1209 static size_t imageCounter = 0;
1217 (
long int) imageCounter);
1225 std::cerr << std::endl <<
"DEBUG: ===== Node: " <<
rangen 1226 <<
" processing image " << fnImg <<
"(" << objId <<
")" 1236 std::cerr << std::endl <<
"DEBUG: ===== Node: " <<
rangen 1237 <<
" processing image " << fnImg <<
"(" << objId <<
")" 1265 std::vector<double> vectortemp;
1267 for (
int j = 5;
j < 5 + dim;
j++)
void read(const FileName &fnPDB)
Read phantom from either a PDB of CIF file.
Just to locate unclassified errors.
virtual void finishProcessing()
ProgFlexibleAlignment * global_flexible_prog
virtual void processImage(const FileName &fnImg, const FileName &fnImgOut, const MDRow &rowIn, MDRow &rowOut)
int cstregistrationcontinuous(Matrix1D< double > ¢erOfMass, Matrix1D< double > &Parameters, MultidimArray< double > &cst_P_mu_image, MultidimArray< double > &P_esp_image, size_t Xwidth, size_t Ywidth)
void resize(size_t Ndim, size_t Zdim, size_t Ydim, size_t Xdim, bool copy=true)
void ProjectionRefencePoint(Matrix1D< double > &Parameters, int dim, double *R, double *Tr, MultidimArray< double > &proj_help_test, MultidimArray< double > &P_esp_image, int Xwidth, int Ywidth, double sigma)
double getDoubleParam(const char *param, int arg=0)
double weight_zero_freq
Weight for zero frequency.
__host__ __device__ float2 floor(const float2 v)
bool do_FilterPDBVol
Low-pass filter the volume from PDB.
#define REPORT_ERROR(nerr, ErrormMsg)
void readParams()
Read arguments from command line.
void performCompleteSearch(int pyramidLevel)
double beta(const double a, const double b)
void sqrt(Image< double > &op)
double gaussian_Real_sigma
Gaussian weight sigma in real space.
void write(const FileName &name="", size_t select_img=ALL_IMAGES, bool isStack=false, int mode=WRITE_OVERWRITE, CastWriteMode castMode=CW_CAST, int _swapWrite=0)
FileName fnmask
Mask file.
int MatrixTimesVector(double *A, double *B, double *X, long Lines, long Columns)
double maxtransl
Maximum translation.
double cutoff_LPfilter
Low-pass cut-off frequency.
void setFileName(const FileName &fn)
void initUniqueName(const char *templateStr="xmippTemp_XXXXXX", const String &fnDir="")
virtual void preProcess()
#define WRITE_ERROR(FunctionName, String)
void runSystem(const String &program, const String &arguments, bool useSystem)
String floatToString(float F, int _width, int _prec)
void gradhesscost_atpixel(double *Gradient, double *Hessian, double *helpgr, double difference)
double costfunctionvalue_cst
double minAngularSampling
Min angular sampling rate.
bool do_centerPDB
Center PDB.
Matrix1D< double > trial_best
int MatrixMultiply(double *A, double *B, double *X, long Lines, long CommonSize, long Columns)
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac
virtual void writeImageParameters(const FileName &fnImg)
virtual void createWorkFiles()
#define FOR_ALL_ELEMENTS_IN_MATRIX1D(v)
FileName createDeformedPDB() const
const FileName & getFileName() const
const char * getParam(const char *param, int arg=0)
if(fabs(c[*nmax+ *nmax *c_dim1])==0.e0)
double scdefamp
Scaling factor to scale deformation amplitude.
int levenberg_cst2(MultidimArray< double > &lc_P_mu_image, MultidimArray< double > &P_esp_image, Matrix1D< double > ¢erOfMass, double *beta, double *alpha, Matrix1D< double > &Parameters, double OldCost, double *lambda, double LambdaScale, long *iter, double tol_angle, double tol_shift, double tol_defamp, int *IteratingStop, size_t Xwidth, size_t Ywidth)
Matrix1D< double > parameters
void resize(size_t Xdim, bool copy=true)
void computePDBgeometry(const std::string &fnPDB, Matrix1D< double > ¢erOfMass, Matrix1D< double > &limit0, Matrix1D< double > &limitF, const std::string &intensityColumn)
std::vector< std::string > modeList
void addExampleLine(const char *example, bool verbatim=true)
int SingularValueBackSubstitution(double *U, double W[], double *V, long Lines, long Columns, double B[], double X[], int *Status)
ProgFlexibleAlignment()
Empty constructor.
int return_gradhesscost(Matrix1D< double > ¢erOfMass, double *Gradient, double *Hessian, Matrix1D< double > &Parameters, int dim, MultidimArray< double > &rg_projimage, MultidimArray< double > &P_esp_image, int Xwidth, int Ywidth)
Matrix1D< double > bestStage1
int max_no_iter
Max iteration number.
double sigmaGaussian
Fixed Gaussian standard deviation.
double psi(const double x)
double performContinuousAssignment(int pyramidLevel)
std::vector< Atom > atomList
List of atoms.
int SingularValueDecomposition(double *U, long Lines, long Columns, double W[], double *V, long MaxIterations, int *Status)
String formatString(const char *format,...)
int GetIdentitySquareMatrix(double *A, long Size)
double translsampling
Translation sampling.
double maxdefamp
Maximum deformation amplitude.
int multiply_3Matrices(double *A, double *B, double *C, double *X, long Lines, long CommonSizeH, long CommonSizeW, long Columns)
bool checkParam(const char *param)
FileName fnModeList
File zith a list of modes.
int read(const FileName &name, DataMode datamode=DATA, size_t select_img=ALL_IMAGES, bool mapData=false, int mode=WRITE_READONLY)
void defineParams()
Define params.
int partialpfunction(Matrix1D< double > &Parameters, Matrix1D< double > ¢erOfMass, double *R, double *Tr, double *DR0, double *DR1, double *DR2, MultidimArray< double > &DP_Rz1, MultidimArray< double > &DP_Ry, MultidimArray< double > &DP_Rz2, MultidimArray< double > &DP_x, MultidimArray< double > &DP_y, MultidimArray< double > &DP_q, int Xwidth, int Ywidth)
void addUsageLine(const char *line, bool verbatim=false)
void initZeros(const MultidimArray< T1 > &op)
FileName fnOutDir
Output directory.
bool useFixedGaussian
Use fixed Gaussian instead of scattering factors.
double sampling_rate
Sampling rate.
int getIntParam(const char *param, int arg=0)
double fitness(double *p)
void addParamsLine(const String &line)
std::map< String, CommentList > defaultComments
double defampsampling
Deformation sampling.