Bsoft  1.9
Bernard's software package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
img_ampweigh.cpp
Go to the documentation of this file.
1 
9 #include "img_ampweigh.h"
10 #include "img_fourier.h"
11 #include "ctf.h"
12 #include "Complex.h"
13 #include "Matrix.h"
14 #include "utilities.h"
15 
16 // Declaration of global variables
17 extern int verbose; // Level of output to the screen
18 
25 {
26  if ( !p->FOM() ) return -1;
27 
28  size_t i, n = p->data_size();
29  double v;
30  float* fom = p->FOM();
31 
32  if ( verbose & VERB_LABEL )
33  cout << "Weighing image by its FOM" << endl << endl;
34 
35  for ( i=0; i<n; i++ ) {
36  v = fom[i] * (*p)[i];
37  p->set(i, v);
38  }
39 
40  return 0;
41 }
42 
50 int img_divide_by_fom(Bimage* p, double wiener)
51 {
52 
53  if ( !p->FOM() ) return -1;
54 
55  if ( wiener < 1e-10 ) wiener = 1e-10;
56 
57  if ( verbose & VERB_PROCESS )
58  cout << "Dividing the image by its FOM" << endl << endl;
59 
60  size_t i, n = p->data_size();
61  double v;
62  float* fom = p->FOM();
63 
64  for ( i=0; i<n; i++ ) {
65  if ( fom[i] < wiener ) v = (*p)[i]/wiener;
66  else v = (*p)[i]/fom[i];
67  p->set(i, v);
68  }
69 
70  return 0;
71 }
72 
79 {
80  if ( p->fourier_type() != NoTransform ) {
81  cerr << "Error: File " << p->file_name() << " must be a real space map!" << endl;
82  return -1;
83  }
84 
85  p->fft(FFTW_FORWARD);
86 
87  if ( verbose & VERB_PROCESS )
88  cout << "Changing the amplitudes to their square roots" << endl << endl;
89 
90  size_t i, n = p->data_size()/2;
91  double d;
92  Complex<float> cv;
93 
94  for ( i=0; i<n; i++ ) {
95  cv = p->complex(i);
96  d = sqrt(cv.amp());
97  p->set(i, cv/d);
98  }
99 
100  p->fft(FFTW_BACKWARD);
101 
102  return 0;
103 }
104 
111 {
112  if ( p->fourier_type() != NoTransform ) {
113  cerr << "Error: File " << p->file_name() << " must be a real space map!" << endl;
114  return -1;
115  }
116 
117  p->fft(FFTW_FORWARD);
118 
119  if ( verbose & VERB_PROCESS )
120  cout << "Changing the amplitudes to their squares" << endl << endl;
121 
122  size_t i, n = p->data_size()/2;
123  double d;
124  Complex<float> cv;
125 
126  for ( i=0; i<n; i++ ) {
127  cv = p->complex(i);
128  d = cv.amp();
129  p->set(i, cv*d);
130  }
131 
132  p->fft(FFTW_BACKWARD);
133 
134  return 0;
135 }
136 
137 int img_weigh_amplitudes_with_curve(Bimage* p, int maxrad, double* curve)
138 {
139  if ( p->fourier_type() != NoTransform ) {
140  cerr << "Error: File " << p->file_name() << " must be a real space map!" << endl;
141  return -1;
142  }
143 
144  p->fft(FFTW_FORWARD);
145 
146 // if ( verbose & VERB_LABEL )
147 // cout << "Weighing amplitudes to a reciprocal radius of " << maxrad << " pixels" << endl << endl;
148 
149  unsigned long i, j, n, x, y, z, iradius, iradius2;
150  long xx, yy, zz, ix, iy, iz;
151  double radius, fraction, fraction2, amp;
152  double rx, ry, rz, scale;
153  Complex<double> cv;
154 
155  double rad_scale = p->real_size().max();
156  Vector3<double> freq_scale = 1.0/p->real_size();
157 
158  double* num = new double[maxrad];
159  double* rps = new double[maxrad];
160 
161  for ( n=0; n<p->images(); n++ ) {
162  cv = 0;
163  for ( i=0; i<maxrad; i++ ) num[i] = rps[i] = 0;
164  for ( z=0; z<p->sizeZ(); z++ ) {
165  zz = z;
166  if ( z > (p->sizeZ() - 1)/2 ) zz -= p->sizeZ();
167  rz = zz*freq_scale.z();
168  iz = -z;
169  if ( iz < 0 ) iz += p->sizeZ();
170  for ( y=0; y<p->sizeY(); y++ ) {
171  yy = y;
172  if ( y > (p->sizeY() - 1)/2 ) yy -= p->sizeY();
173  ry = yy*freq_scale.y();
174  iy = -y;
175  if ( iy < 0 ) iy += p->sizeY();
176  for ( x=0; x<p->sizeX()/2; x++ ) {
177  i = ((n*p->sizeZ() + z)*p->sizeY() + y)*p->sizeX() + x;
178  xx = x;
179  if ( x > (p->sizeX() - 1)/2 ) xx -= p->sizeX();
180  rx = xx*freq_scale.x();
181  ix = -x;
182  if ( ix < 0 ) ix += p->sizeX();
183  j = ((n*p->sizeZ() + iz)*p->sizeY() + iy)*p->sizeX() + ix;
184  radius = rad_scale*sqrt(rx*rx + ry*ry + rz*rz);
185  iradius = (int) radius;
186  iradius2 = iradius + 1;
187  if ( iradius2 < maxrad ) {
188  fraction = radius - iradius;
189  fraction2 = 1.0 - fraction;
190  amp = (p->complex(i)).amp();
191  num[iradius] += fraction2;
192  num[iradius2] += fraction;
193  rps[iradius] += fraction2*amp;
194  rps[iradius2] += fraction*amp;
195  } else {
196  p->set(i, cv);
197  p->set(j, cv);
198  }
199  }
200  }
201  }
202 
203  rps[0] = 0;
204  for ( i=0; i<maxrad; i++ )
205  if ( num[i] ) rps[i] /= num[i];
206 
207  if ( verbose & VERB_FULL ) {
208  cout << "Scaling for image " << n+1 << ":\ns\tRPS\tC\tScale" << endl;
209  for ( i=0; i<maxrad; i++ ) {
210  if ( rps[i] ) scale = curve[i]/rps[i];
211  else scale = 0;
212  cout << i/rad_scale << tab << rps[i] << tab << curve[i] << tab << scale << endl;
213  }
214  cout << endl;
215  }
216 
217  for ( i=0; i<maxrad; i++ )
218  if ( rps[i] ) rps[i] = curve[i]/rps[i];
219 
220  for ( z=0; z<p->sizeZ(); z++ ) {
221  zz = z;
222  if ( z > (p->sizeZ() - 1)/2 ) zz -= p->sizeZ();
223  rz = zz*freq_scale.z();
224  for ( y=0; y<p->sizeY(); y++ ) {
225  yy = y;
226  if ( y > (p->sizeY() - 1)/2 ) yy -= p->sizeY();
227  ry = yy*freq_scale.y();
228  for ( x=0; x<p->sizeX(); x++ ) {
229  i = ((n*p->sizeZ() + z)*p->sizeY() + y)*p->sizeX() + x;
230  xx = x;
231  if ( x > (p->sizeX() - 1)/2 ) xx -= p->sizeX();
232  rx = xx*freq_scale.x();
233  radius = rad_scale*sqrt(rx*rx + ry*ry + rz*rz);
234  iradius = (int) radius;
235  iradius2 = iradius + 1;
236  if ( iradius2 < maxrad ) {
237  fraction = radius - iradius;
238  fraction2 = 1.0 - fraction;
239  scale = rps[iradius]*fraction2 + rps[iradius2]*fraction;
240  cv = p->complex(i) * scale;
241  p->set(i, cv);
242  }
243  }
244  }
245  }
246  }
247 
248  delete[] num;
249  delete[] rps;
250 
251  p->fft(FFTW_BACKWARD);
252 
253  return 0;
254 }
255 
267 int img_weigh_amplitudes_with_C_curve(Bimage* p, double resolution)
268 {
269  p->check_resolution(resolution);
270 
271  // The radius scaling is set to a value consistent with one pixel width
272  // in reciprocal space for the longest dimension.
273  double rad_scale = p->real_size().max();
274 
275  // maxrad is the main limit for the length of all the arrays,
276  // and is derived from the resolution set in the transform
277  unsigned long maxrad = (unsigned long) (2 + rad_scale/resolution);
278 
279  if ( verbose ) {
280  cout << "Weighing amplitudes with a C cross-section:" << endl;
281  cout << "Resolution: " << resolution << " (" << maxrad << " pixels)" << endl << endl;
282  }
283 
284  double* ccurve = C_curve(maxrad, 1/rad_scale);
285 
286  img_weigh_amplitudes_with_curve(p, maxrad, ccurve);
287 
288  delete[] ccurve;
289 
290  return 0;
291 }
292 
306 int img_weigh_amplitudes_with_FSC_curve(Bimage* p, Bplot* plot, double resolution)
307 {
308  p->check_resolution(resolution);
309 
310  // The radius scaling is set to a value consistent with one pixel width
311  // in reciprocal space for the longest dimension.
312  double rad_scale = p->real_size().max();
313 
314  // maxrad is the main limit for the length of all the arrays,
315  // and is derived from the resolution set in the transform
316  unsigned long maxrad = (unsigned long) (2 + rad_scale/resolution);
317  if ( maxrad > plot->rows() ) maxrad = plot->rows();
318 
319  if ( verbose ) {
320  cout << "Weighing amplitudes with an FSC curve:" << endl;
321  cout << "Resolution: " << resolution << " (" << maxrad << " pixels)" << endl << endl;
322  }
323 
324  unsigned long i, j;
325  double* fsc = new double[maxrad];
326 
327  for ( i=0, j=plot->rows(); i<maxrad; i++, j++ )
328  fsc[i] = sqrt((*plot)[j]);
329 
330  img_weigh_amplitudes_with_curve(p, maxrad, fsc);
331 
332  delete[] fsc;
333 
334  return 0;
335 }
336 
337 
356 int img_weigh_amplitudes(Bimage* p, Bimage* pref, Bimage* pmask, double resolution)
357 {
358  if ( p->fourier_type() != NoTransform ) {
359  cerr << "Error: File " << p->file_name() << " must be a real space map!" << endl;
360  return -1;
361  }
362 
363  if ( pref->fourier_type() != NoTransform ) {
364  cerr << "Error: File " << pref->file_name() << " must be a real space map!" << endl;
365  return -1;
366  }
367 
368  if ( pmask ) pmask->change_type(UCharacter);
369 
370  p->check_resolution(resolution);
371 
372  // Pack the two images into one complex block
373  Bimage* pc = p->pack_two_in_complex(pref);
374  if ( !pc ) return -1;
375 
376  pc->fft(FFTW_FORWARD);
377 
378  unsigned long i, j, n, x, y, z, iradius, iradius2, use_this(1);
379  long xx, yy, zz, ix, iy, iz;
380  double radius, fraction, fraction2, amp1, amp2;
381  double rx, ry, rz, scale;
382  Complex<double> cv, image, model;
383 
384  if ( verbose & VERB_DEBUG )
385  cout << "DEBUG img_weigh_amplitudes: pixelsize = " << p->sampling() << endl;
386 
387  // The radius scaling is set to a value consistent with one pixel width
388  // in reciprocal space for the longest dimension.
389  double rad_scale = p->real_size().max();
390 
391  // The frequency scaling is linked to the different dimensions of the
392  // data set (important when the x, y and z dimensions are different)
393  Vector3<double> freq_scale = 1.0/p->real_size();
394 
395  // maxrad is the main limit for the length of all the arrays,
396  // and is derived from the resolution set in the transform
397  unsigned long maxrad = (unsigned long) (2 + rad_scale/resolution);
398 
399  if ( verbose ) {
400  cout << "Weighing amplitudes:" << endl;
401  cout << "Reference map: " << pref->file_name() << endl;
402  cout << "Resolution: " << resolution << " (" << maxrad << " pixels)" << endl << endl;
403  }
404 
405  double* num = new double[maxrad];
406  double* rps1 = new double[maxrad];
407  double* rps2 = new double[maxrad];
408 
409  for ( n=0; n<pc->images(); n++ ) {
410  for ( i=0; i< maxrad; i++ ) num[i] = rps1[i] = rps2[i] = 0;
411  for ( z=0; z<pc->sizeZ(); z++ ) {
412  zz = z;
413  if ( z > (pc->sizeZ() - 1)/2 ) zz -= pc->sizeZ();
414  rz = zz*freq_scale.z();
415  iz = -z;
416  if ( iz < 0 ) iz += pc->sizeZ();
417  for ( y=0; y<pc->sizeY(); y++ ) {
418  yy = y;
419  if ( y > (pc->sizeY() - 1)/2 ) yy -= pc->sizeY();
420  ry = yy*freq_scale.y();
421  iy = -y;
422  if ( iy < 0 ) iy += pc->sizeY();
423  for ( x=0; x<pc->sizeX()/2; x++ ) {
424  i = ((n*pc->sizeZ() + z)*pc->sizeY() + y)*pc->sizeX() + x;
425 // i = pc->index(0,x,y,z,n);
426  xx = x;
427  if ( x > (pc->sizeX() - 1)/2 ) xx -= pc->sizeX();
428  rx = xx*freq_scale.x();
429  ix = -x;
430  if ( ix < 0 ) ix += pc->sizeX();
431  j = ((n*pc->sizeZ() + iz)*pc->sizeY() + iy)*pc->sizeX() + ix;
432 // j = pc->index(0,ix,iy,iz,n);
433  radius = rad_scale*sqrt(rx*rx + ry*ry + rz*rz);
434  iradius = (int) radius;
435  iradius2 = iradius + 1;
436  use_this = 1;
437  if ( pmask && (*pmask)[i] < 1 ) use_this = 0;
438  if ( iradius2 >= maxrad ) use_this = 0;
439  if ( use_this ) {
440  fraction = radius - iradius;
441  fraction2 = 1.0 - fraction;
442  image = pc->complex(i).unpack_first(pc->complex(j));
443  model = pc->complex(i).unpack_second(pc->complex(j));
444  amp1 = image.amp();
445  amp2 = model.amp();
446  num[iradius] += fraction2;
447  num[iradius2] += fraction;
448  rps1[iradius] += fraction2*amp1;
449  rps1[iradius2] += fraction*amp1;
450  rps2[iradius] += fraction2*amp2;
451  rps2[iradius2] += fraction*amp2;
452  pc->set(i, image);
453  pc->set(j, image.conj());
454  } else {
455  pc->set(i, cv);
456  pc->set(j, cv);
457  }
458  }
459  }
460  }
461 
462  rps2[0] = 0;
463 
464  if ( verbose & VERB_FULL ) {
465  cout << "Scaling for image " << n << ":\ns\tRPS1\tRPS2\tScale" << endl;
466  for ( i=0; i<maxrad; i++ ) {
467  if ( num[i] && rps1[i] ) scale = rps2[i] / rps1[i];
468  else scale = 0;
469  cout << i/rad_scale << tab << rps1[i] << tab << rps2[i] << tab << scale << endl;
470  }
471  cout << endl;
472  }
473 
474  for ( i=0; i<maxrad; i++ )
475  if ( num[i] && rps1[i] ) rps2[i] /= rps1[i];
476 
477  for ( z=0; z<pc->sizeZ(); z++ ) {
478  zz = z;
479  if ( z > (pc->sizeZ() - 1)/2 ) zz -= pc->sizeZ();
480  rz = zz*freq_scale.z();
481  for ( y=0; y<pc->sizeY(); y++ ) {
482  yy = y;
483  if ( y > (pc->sizeY() - 1)/2 ) yy -= pc->sizeY();
484  ry = yy*freq_scale.y();
485  for ( x=0; x<pc->sizeX(); x++ ) {
486  i = ((n*pc->sizeZ() + z)*pc->sizeY() + y)*pc->sizeX() + x;
487 // i = pc->index(0,x,y,z,n);
488  use_this = 1;
489  if ( pmask && (*pmask)[i] < 1 ) use_this = 0;
490  xx = x;
491  if ( x > (pc->sizeX() - 1)/2 ) xx -= pc->sizeX();
492  rx = xx*freq_scale.x();
493  radius = rad_scale*sqrt(rx*rx + ry*ry + rz*rz);
494  iradius = (int) radius;
495  iradius2 = iradius + 1;
496  if ( iradius2 >= maxrad ) use_this = 0;
497  if ( use_this ) {
498  fraction = radius - iradius;
499  fraction2 = 1.0 - fraction;
500  scale = rps2[iradius]*fraction2 + rps2[iradius2]*fraction;
501  cv = pc->complex(i) * scale;
502  pc->set(i, cv);
503  }
504  }
505  }
506  }
507  }
508 
509  delete[] num;
510  delete[] rps1;
511  delete[] rps2;
512 
513  pc->fft(FFTW_BACKWARD);
514 
515  for ( i=0; i<p->data_size(); i++ ) p->set(i, (*pc)[i]);
516 
517  delete pc;
518 
519  return 0;
520 }
521 
522 
531 int img_normalize_amplitudes(Bimage* p, Bimage* pmask, double resolution)
532 {
533  if ( p->fourier_type() != NoTransform ) {
534  cerr << "Error: File " << p->file_name() << " must be a real space map!" << endl;
535  return -1;
536  }
537 
538  if ( pmask ) pmask->change_type(UCharacter);
539 
540  p->check_resolution(resolution);
541 
542  p->fft(FFTW_FORWARD);
543 
544  unsigned long i, j, n, x, y, z, iradius, iradius2, use_this(1);
545  long xx, yy, zz;
546  double radius, fraction, fraction2, pwr;
547  double rx, ry, rz, scale;
548  Complex<double> cv, cvz;
549 
550  if ( verbose & VERB_DEBUG )
551  cout << "DEBUG img_normalize_amplitudes: pixelsize = " << p->sampling() << endl;
552 
553  // The radius scaling is set to a value consistent with one pixel width
554  // in reciprocal space for the longest dimension.
555  double rad_scale = p->real_size().max();
556 
557  // The frequency scaling is linked to the different dimensions of the
558  // data set (important when the x, y and z dimensions are different)
559  Vector3<double> freq_scale = 1.0/p->real_size();
560 
561  // maxrad is the main limit for the length of all the arrays,
562  // and is derived from the resolution set in the transform
563  unsigned long maxrad = (unsigned long) (2 + rad_scale/resolution);
564 
565  if ( verbose ) {
566  cout << "Normalizing amplitudes:" << endl;
567  cout << "Resolution: " << resolution << " (" << maxrad << " pixels)" << endl << endl;
568  }
569 
570  double* num = new double[maxrad];
571  double* rps = new double[maxrad];
572 
573  for ( n=0; n<p->images(); n++ ) {
574  for ( i=0; i<maxrad; i++ ) num[i] = rps[i] = 0;
575  for ( z=0; z<p->sizeZ(); z++ ) {
576  zz = z;
577  if ( z > (p->sizeZ() - 1)/2 ) zz -= p->sizeZ();
578  rz = zz*freq_scale.z();
579  for ( y=0; y<p->sizeY(); y++ ) {
580  yy = y;
581  if ( y > (p->sizeY() - 1)/2 ) yy -= p->sizeY();
582  ry = yy*freq_scale.y();
583  for ( x=0; x<p->sizeX(); x++ ) {
584  i = ((n*p->sizeZ() + z)*p->sizeY() + y)*p->sizeX() + x;
585 // i = p->index(0,x,y,z,n);
586  xx = x;
587  if ( x > (p->sizeX() - 1)/2 ) xx -= p->sizeX();
588  rx = xx*freq_scale.x();
589  radius = rad_scale*sqrt(rx*rx + ry*ry + rz*rz);
590  iradius = (int) radius;
591  iradius2 = iradius + 1;
592  use_this = 1;
593  if ( pmask && (*pmask)[i] < 1 ) use_this = 0;
594  if ( iradius2 >= maxrad ) use_this = 0;
595  if ( use_this ) {
596  fraction = radius - iradius;
597  fraction2 = 1.0 - fraction;
598  pwr = p->complex(i).power();
599  num[iradius] += fraction2;
600  num[iradius2] += fraction;
601  rps[iradius] += fraction2*pwr;
602  rps[iradius2] += fraction*pwr;
603  }
604  }
605  }
606  }
607 
608  if ( verbose & VERB_FULL ) {
609  cout << "Scaling for image " << n << ":\ns\tRPS\tScale" << endl;
610  for ( i=0; i<maxrad; i++ ) {
611  if ( num[i] && rps[i] ) scale = sqrt(num[i] / rps[i]);
612  else scale = 0;
613  cout << i/rad_scale << tab << rps[i] << tab << scale << endl;
614  }
615  cout << endl;
616  }
617 
618  for ( i=0; i<maxrad; i++ )
619  if ( num[i] && rps[i] ) rps[i] = sqrt(num[i] / rps[i]);
620 
621  for ( z=0; z<p->sizeZ(); z++ ) {
622  zz = z;
623  if ( z > (p->sizeZ() - 1)/2 ) zz -= p->sizeZ();
624  rz = zz*freq_scale.z();
625  for ( y=0; y<p->sizeY(); y++ ) {
626  yy = y;
627  if ( y > (p->sizeY() - 1)/2 ) yy -= p->sizeY();
628  ry = yy*freq_scale.y();
629  for ( x=0; x<p->sizeX(); x++ ) {
630  i = ((n*p->sizeZ() + z)*p->sizeY() + y)*p->sizeX() + x;
631 // i = p->index(0,x,y,z,n);
632  use_this = 1;
633  if ( pmask && (*pmask)[i] < 1 ) use_this = 0;
634  xx = x;
635  if ( x > (p->sizeX() - 1)/2 ) xx -= p->sizeX();
636  rx = xx*freq_scale.x();
637  radius = rad_scale*sqrt(rx*rx + ry*ry + rz*rz);
638  iradius = (int) radius;
639  iradius2 = iradius + 1;
640  if ( iradius2 >= maxrad ) use_this = 0;
641  if ( use_this ) {
642  fraction = radius - iradius;
643  fraction2 = 1.0 - fraction;
644  scale = rps[iradius]*fraction2 + rps[iradius2]*fraction;
645  cv = p->complex(i) * scale;
646  p->set(i, cv);
647  } else {
648  p->set(i, cvz);
649  }
650  }
651  }
652  }
653  }
654 
655  delete[] num;
656  delete[] rps;
657 
658  p->fft(FFTW_BACKWARD);
659 
660  return 0;
661 }
662 
void change_type(char letter)
Get the data type indicated by a single letter code.
Definition: Bimage.cpp:1440
Type z()
Definition: Vector3.h:141
void sizeZ(size_t nz)
Definition: Bimage.h:319
int img_divide_by_fom(Bimage *p, double wiener)
Divides an image by its figure-of-merit.
int img_weigh_amplitudes_with_C_curve(Bimage *p, double resolution)
Weighs an image's amplitudes with the carbon scattering curve.
int fft()
Definition: Bimage.h:561
Header file for general utilities.
#define VERB_DEBUG
Definition: utilities.h:104
Class for complex numbers.
Complex conj()
Definition: Complex.h:106
Generalized matrix class.
#define VERB_PROCESS
Definition: utilities.h:99
Type max()
Definition: Vector3.h:151
int img_weigh_amplitudes_with_curve(Bimage *p, int maxrad, double *curve)
Header file for image utilities.
void check_resolution(double &resolution)
Checks that the resolution falls within reasonable limits.
Definition: Bimage.cpp:478
int img_sqrt_amp(Bimage *p)
Change the amlitudes to their square roots.
General image parameter class.
Definition: Bimage.h:150
Vector3< double > real_size()
Definition: Bimage.h:395
int img_multiply_by_fom(Bimage *p)
Weighs a set of reflections by its figure-of-merit.
int verbose
Complex< double > complex(size_t j)
Returns a complex value at the given index.
Definition: Bimage.cpp:824
void sampling(double s)
Definition: Bimage.h:398
float * FOM()
Definition: Bimage.h:236
General FFT for n-dimensional data.
double amp()
Definition: Complex.h:104
double * C_curve(unsigned long n, double freq_step)
Calculates the carbon scattering curve.
Definition: ctf.cpp:406
Header file for CTF (contrast transfer function) functions.
Type x()
Definition: Vector3.h:139
void file_name(Bstring s)
Definition: Bimage.h:212
void set(size_t j, double v)
Sets a single value at the given index.
Definition: Bimage.cpp:916
size_t images()
Definition: Bimage.h:396
size_t data_size()
Definition: Bimage.h:222
void sizeX(size_t nx)
Definition: Bimage.h:317
void rows(long n)
Definition: ps_plot.h:206
int img_weigh_amplitudes(Bimage *p, Bimage *pref, Bimage *pmask, double resolution)
Weighs an image's amplitudes with the radial power spectrum of another.
int img_normalize_amplitudes(Bimage *p, Bimage *pmask, double resolution)
Normalizes an image's amplitudes.
void sizeY(size_t ny)
Definition: Bimage.h:318
Bmodel * model
Definition: tcltk_bshow.cpp:32
Bimage * pack_two_in_complex(Bimage *p)
Packs two real images into one complex image.
int img_square_amp(Bimage *p)
Change the amlitudes to their squares.
#define VERB_FULL
Definition: utilities.h:101
#define VERB_LABEL
Definition: utilities.h:98
Type y()
Definition: Vector3.h:140
FourierType fourier_type()
Definition: Bimage.h:308
ostream & tab(ostream &out)
Definition: utilities.cpp:21
int img_weigh_amplitudes_with_FSC_curve(Bimage *p, Bplot *plot, double resolution)
Weighs an image's amplitudes with a given FSC curve.
Definition: ps_plot.h:146