Xmipp  v3.23.11-Nereus
subtomo_subtraction.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Estrella Fernandez Gimenez (me.fernandez@cnb.csic.es)
4  *
5  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20  * 02111-1307 USA
21  *
22  * All comments concerning this program package may be sent to the
23  * e-mail address 'xmipp@cnb.csic.es'
24  ***************************************************************************/
25 
26 #include "subtomo_subtraction.h"
27 #include "core/transformations.h"
28 #include <core/histogram.h>
29 #include <core/xmipp_fftw.h>
30 #include <core/xmipp_program.h>
31 #include <data/fourier_filter.h>
32 #include <core/geometry.h>
33 #include "core/transformations.h"
34 
35 
36  // Empty constructor =======================================================
38 {
39  produces_a_metadata = true;
41  keep_input_columns = true;
42  save_metadata_stack = true;
43  remove_disabled = false;
44  rank = 0;
45 }
46 
47 // Usage ===================================================================
49 {
50  // Usage
51  addUsageLine("This program modifies a volume as much as possible in order to assimilate it to another one,");
52  addUsageLine("without loosing the important information in it process. Then, the subtraction of the two volumes");
53  addUsageLine("can be optionally calculated. Sharpening: reference volume must be an atomic structure previously");
54  addUsageLine("converted into a density map of the same specimen than in input volume 2.");
55  // Parameters
57  addParamsLine("--ref <volume>\t: Reference volume");
58  addParamsLine("[--sub]\t: Perform the subtraction of the volumes. Output will be the difference");
59  addParamsLine("[--sigma <s=3>]\t: Decay of the filter (sigma) to smooth the mask transition");
60  addParamsLine("[--iter <n=5>]\t: Number of iterations for the adjustment process");
61  addParamsLine("[--mask1 <mask=\"\">]\t: Mask for volume 1");
62  addParamsLine("[--mask2 <mask=\"\">]\t: Mask for volume 2");
63  addParamsLine("[--maskSub <mask=\"\">]\t: Mask for subtraction region");
64  addParamsLine("[--cutFreq <f=0>]\t: Filter both volumes with a filter which specified cutoff frequency "
65  "(i.e. resolution inverse, <0.5)");
66  addParamsLine("[--lambda <l=1>]\t: Relaxation factor for Fourier Amplitude POCS, i.e. 'how much modification "
67  "of volume Fourier amplitudes', between 1 (full modification, recommended) and 0 (no modification)");
68  addParamsLine("[--radavg]\t: Match the radially averaged Fourier amplitudes when adjusting the amplitudes instead "
69  "of taking directly them from the reference volume");
70  addParamsLine("[--computeEnergy]\t: Compute the energy difference between each step (energy difference gives "
71  "information about the convergence of the adjustment process, while it can slightly slow the performance)");
72  addParamsLine("[--saveV1 <structure=\"\"> ]\t: Save subtraction intermediate file (vol1 filtered) just when option "
73  "--sub is passed, if not passed the input reference volume is not modified");
74  addParamsLine("[--saveV2 <structure=\"\"> ]\t: Save subtraction intermediate file (vol2 adjusted) just when option "
75  "--sub is passed, if not passed the output of the program is this file");
76 }
77 
78 // Read arguments ==========================================================
80 {
82  fnVolRef = getParam("--ref");
83  performSubtraction = checkParam("--sub");
84  iter = getIntParam("--iter");
85  sigma = getIntParam("--sigma");
86  fnMask1 = getParam("--mask1");
87  fnMask2 = getParam("--mask2");
88  fnMaskSub = getParam("--maskSub");
89  cutFreq = getDoubleParam("--cutFreq");
90  lambda = getDoubleParam("--lambda");
91  fnVol1F = getParam("--saveV1");
92  if (fnVol1F.isEmpty())
93  fnVol1F = "volume1_filtered.mrc";
94  fnVol2A = getParam("--saveV2");
95  if (fnVol2A.isEmpty())
96  fnVol2A = "volume2_adjusted.mrc";
97  radavg = checkParam("--radavg");
98  computeE = checkParam("--computeEnergy");
99 }
100 
101 // Show ====================================================================
103  if (!verbose)
104  return;
105  std::cout
106  << "Input volume(s):\t" << fnVolMd << std::endl
107  << "Reference volume:\t" << fnVolRef << std::endl
108  << "Input mask 1:\t" << fnMask1 << std::endl
109  << "Input mask 2:\t" << fnMask2 << std::endl
110  << "Input mask subtract:\t" << fnMaskSub << std::endl
111  << "Sigma:\t" << sigma << std::endl
112  << "Iterations:\t" << iter << std::endl
113  << "Cutoff frequency:\t" << cutFreq << std::endl
114  << "Relaxation factor:\t" << lambda << std::endl
115  << "Match radial averages:\t" << radavg << std::endl
116  << "Output:\t" << fnOut << std::endl;
117 }
118 
120  r.getValueOrDefault(MDL_IMAGE, fnVol2, "no_filename");
121  V.read(fnVol2);
122  V().setXmippOrigin();
123  }
124 
126  img.write(fnImgOut);
127  rowOut.setValue(MDL_IMAGE, fnImgOut);
128  }
129 
130 /* Methods used to adjust an input volume (V) to a another reference volume (V1) through
131 the use of Projectors Onto Convex Sets (POCS) */
135 }
136 
140 }
141 
143  MultidimArray<std::complex<double>> &V2Fourier, double l) {
146  if (mod > 1e-10) // Condition to avoid divide by zero, values smaller than
147  // this threshold are considered zero
149  ((1 - l) + l * DIRECT_MULTIDIM_ELEM(V1FourierMag, n)) / mod;
150  }
151 }
152 
154  double l, const MultidimArray<double> &rQ, int V1size_x, int V1size_y, int V1size_z) {
155  int V1size2_x = V1size_x/2;
156  double V1sizei_x = 1.0/V1size_x;
157  int V1size2_y = V1size_y/2;
158  double V1sizei_y = 1.0/V1size_y;
159  int V1size2_z = V1size_z/2;
160  double V1sizei_z = 1.0/V1size_z;
161  double wx;
162  double wy;
163  double wz;
164  for (int k=0; k<ZSIZE(V); ++k)
165  {
166  FFT_IDX2DIGFREQ_FAST(k,V1size_z,V1size2_z,V1sizei_z,wz)
167  double wz2 = wz*wz;
168  for (int i=0; i<YSIZE(V); ++i)
169  {
170  FFT_IDX2DIGFREQ_FAST(i,V1size_y,V1size2_y,V1sizei_y,wy)
171  double wy2_wz2 = wy*wy + wz2;
172  for (int j=0; j<XSIZE(V); ++j)
173  {
174  FFT_IDX2DIGFREQ_FAST(j,V1size_x,V1size2_x,V1sizei_x,wx)
175  double w = sqrt(wx*wx + wy2_wz2);
176  auto iw = std::min((int)floor(w*V1size_x), (int)XSIZE(rQ) -1);
177  DIRECT_A3D_ELEM(V,k,i,j)*=(1-l)+l*DIRECT_MULTIDIM_ELEM(rQ,iw);
178  }
179  }
180  }
181 }
182 
185  double val = DIRECT_MULTIDIM_ELEM(V, n);
186  if (val < v1m)
187  DIRECT_MULTIDIM_ELEM(V, n) = v1m;
188  else if (val > v1M)
189  DIRECT_MULTIDIM_ELEM(V, n) = v1M;
190  }
191 }
192 
193 void ProgSubtomoSubtraction::POCSFourierPhase(const MultidimArray<std::complex<double>> &phase,
194  MultidimArray<std::complex<double>> &FI) {
196  DIRECT_MULTIDIM_ELEM(FI, n) =
198 }
199 
200 /* Other methods needed to pre-process and operate with the volumes */
201 void ProgSubtomoSubtraction::extractPhase(MultidimArray<std::complex<double>> &FI) const{
203  auto *ptr = (double *)&DIRECT_MULTIDIM_ELEM(FI, n);
204  double phi = atan2(*(ptr + 1), *ptr);
205  DIRECT_MULTIDIM_ELEM(FI, n) = std::complex<double>(cos(phi), sin(phi));
206  }
207 }
208 
210  Vdif = Vdif - Vact;
211  double energy = 0;
213  energy += DIRECT_MULTIDIM_ELEM(Vdif, n) * DIRECT_MULTIDIM_ELEM(Vdif, n);
214  energy = sqrt(energy / MULTIDIM_SIZE(Vdif));
215 }
216 
218  MultidimArray<std::complex<double>> &VolFourierRad,
219  MultidimArray<double> &VolFourierMagRad) const{
220  FourierTransformer transformerRad;
221  transformerRad.completeFourierTransform(VolRad, VolFourierRad);
222  CenterFFT(VolFourierRad, true);
223  FFT_magnitude(VolFourierRad, VolFourierMagRad);
224  VolFourierMagRad.setXmippOrigin();
225 }
226 
228  const MultidimArray<double> &V, MultidimArray<double> &radial_mean) {
229  MultidimArray<double> radial_count;
230  int Vsize2_x = int(XSIZE(V))/2;
231  double Vsizei_x = 1.0/int(XSIZE(V));
232  int Vsize2_y = int(YSIZE(V))/2;
233  double Vsizei_y = 1.0/int(YSIZE(V));
234  int Vsize2_z = int(ZSIZE(V))/2;
235  double Vsizei_z = 1.0/int(ZSIZE(V));
236  double wx;
237  double wy;
238  double wz;
239  auto maxrad = int(floor(sqrt(Vsize2_x*Vsize2_x + Vsize2_y*Vsize2_y + Vsize2_z*Vsize2_z)));
240  radial_count.initZeros(maxrad);
241  radial_mean.initZeros(maxrad);
242  for (int k=0; k<Vsize2_z; ++k)
243  {
244  FFT_IDX2DIGFREQ_FAST(k,ZSIZE(V),Vsize2_z,Vsizei_z,wz)
245  double wz2 = wz*wz;
246  for (int i=0; i<Vsize2_y; ++i)
247  {
248  FFT_IDX2DIGFREQ_FAST(i,YSIZE(V),Vsize2_y,Vsizei_y,wy)
249  double wy2_wz2 = wy*wy + wz2;
250  for (int j=0; j<Vsize2_x; ++j)
251  {
252  FFT_IDX2DIGFREQ_FAST(j,XSIZE(V),Vsize2_x,Vsizei_x,wx)
253  double w = sqrt(wx*wx + wy2_wz2);
254  auto iw = (int)round(w*int(XSIZE(V)));
255  DIRECT_A1D_ELEM(radial_mean,iw)+=DIRECT_A3D_ELEM(VolFourierMag,k,i,j);
256  DIRECT_A1D_ELEM(radial_count,iw)+=1.0;
257  }
258  }
259  }
260  radial_mean/= radial_count;
261 }
262 
264  const MultidimArray<double> &vMag, const MultidimArray<double> &V1,
265  const MultidimArray<double> &V) {
266  // Compute the quotient of the radial mean of the volumes to use it in POCS amplitude
267  MultidimArray<double> radial_meanV1;
268  radialAverage(v1Mag, V1, radial_meanV1);
269  MultidimArray<double> radial_meanV;
270  radialAverage(vMag, V, radial_meanV);
271  MultidimArray<double> radQuotient = radial_meanV1 / radial_meanV;
272  FOR_ALL_ELEMENTS_IN_ARRAY1D(radQuotient)
273  {
274  radQuotient(i) = std::min(radQuotient(i), 1.0);
275  if (radQuotient(i) != radQuotient(i)) // Check if it is NaN and change it by 0
276  radQuotient(i) = 0;
277  }
278  return radQuotient;
279 }
280 
282  filter2.FilterBand = LOWPASS;
283  filter2.FilterShape = RAISED_COSINE;
284  filter2.raised_w = 0.02;
285  filter2.w1 = cutFreq;
286 }
287 
290  const FileName &fnVol2A, FourierFilter &filter2, double cutFreq) {
291  Image<double> V1Filtered;
292  V1Filtered() = V1();
293  if (cutFreq != 0){
294  filter2.applyMaskSpace(V1Filtered());
295  }
296  if (!fnVol1F.isEmpty()) {
297  V1Filtered.write(fnVol1F);
298  }
299  if (!fnVol2A.isEmpty()) {
300  V.write(fnVol2A);
301  }
304  DIRECT_MULTIDIM_ELEM(V1(), n) * (1 - DIRECT_MULTIDIM_ELEM(mask, n)) +
305  (DIRECT_MULTIDIM_ELEM(V1Filtered(), n) -
307  DIRECT_MULTIDIM_ELEM(V1Filtered(), n))) *
308  DIRECT_MULTIDIM_ELEM(mask, n);
309  return V1;
310 }
311 
313  FourierTransformer transformer;
315  MultidimArray<double> magnitude;
316  transformer.FourierTransform(volume, fourier, false);
317  FFT_magnitude(fourier, magnitude);
318  return magnitude;
319 }
320 
323  if (fnM1 != "" && fnM2 != "") {
324  Image<double> mask1;
325  Image<double> mask2;
326  mask1.read(fnM1);
327  mask2.read(fnM2);
328  mask = mask1() * mask2();
329  } else {
330  mask.resizeNoCopy(volume());
331  mask.initConstant(1.0);
332  }
333  return mask;
334 }
335 
337  FourierFilter Filter;
338  Filter.FilterShape = REALGAUSSIAN;
339  Filter.FilterBand = LOWPASS;
340  Filter.w1 = sigma;
341  Filter.applyMaskSpace(mask);
342 }
343 
346  transformer2.FourierTransform(volume, phase, true);
347  extractPhase(phase);
348  return phase;
349 }
350 
352  if (fnMSub.isEmpty()){
353  filterMask(mask);
354  return mask;
355  }
356  else {
357  Image<double> masksub;
358  masksub.read(fnMSub);
359  return masksub();
360  }
361 }
362 
364  show();
365  }
366 
367 /* Core of the program: processing needed to adjust input volume V2 to reference volume V1.
368 Several iteration of this processing should be run. */
369 
370 void ProgSubtomoSubtraction::processImage(const FileName &fnImg, const FileName &fnImgOut, const MDRow &rowIn, MDRow &rowOut) {
372  V1.read(fnVolRef);
373  V1().setXmippOrigin();
374  mask = createMask(V1, fnMask1, fnMask2);
375  POCSmask(mask, V1());
376  POCSnonnegative(V1());
377  V1().computeDoubleMinMax(v1min, v1max);
378  std1 = V1().computeStddev();
380 
381  readParticle(rowIn);
382  MultidimArray<double> &mv = V();
383  mv.setXmippOrigin();
384 
385  // Window subtomo (padding) before apply alignment
386  MultidimArray <double> &mpad = padv();
387  mpad.setXmippOrigin();
388  pad = XSIZE(mv);
389  mv.window(mpad, STARTINGZ(mv)-(int)pad/2, STARTINGY(mv)-(int)pad/2, STARTINGX(mv)-(int)pad/2, FINISHINGZ(mv)+(int)pad/2, FINISHINGZ(mv)+(int)pad/2, FINISHINGZ(mv)+(int)pad/2);
390  // Read alignment
394  roffset.initZeros(3);
395  rowIn.getValueOrDefault(MDL_SHIFT_X, roffset(0), 0);
396  rowIn.getValueOrDefault(MDL_SHIFT_Y, roffset(1), 0);
397  rowIn.getValueOrDefault(MDL_SHIFT_Z, roffset(2), 0);
398  // Apply alignment
399  Image<double> Vaux;
400  MultidimArray<double> &mvaux = Vaux();
401  mvaux.setXmippOrigin();
402  Vaux = padv;
403  mvaux.initZeros();
405  selfTranslate(xmipp_transformation::LINEAR, mvaux, roffset, xmipp_transformation::WRAP);
406  // Crop to restore original size
407  mvaux.window(mv, STARTINGZ(mv), STARTINGY(mv), STARTINGX(mv), FINISHINGZ(mv), FINISHINGY(mv), FINISHINGX(mv));
408  // Preprocessing
409  POCSmask(mask, mv);
410  POCSnonnegative(mv);
411  Vdiff = V;
412  auto V2FourierPhase = computePhase(mv);
413  auto V1FourierMag = computeMagnitude(V1());
414  auto V2FourierMag = computeMagnitude(mv);
415  auto radQuotient = computeRadQuotient(V1FourierMag, V2FourierMag, V1(), mv);
416 
417  for (n = 0; n < iter; ++n)
418  {
420  if (radavg) {
421  auto V1size_x = (int)XSIZE(V1());
422  auto V1size_y = (int)YSIZE(V1());
423  auto V1size_z = (int)ZSIZE(V1());
424  POCSFourierAmplitudeRadAvg(V2Fourier, lambda, radQuotient, V1size_x, V1size_y, V1size_z);
425  }
426  else {
428  }
430  if (computeE) {
431  computeEnergy(Vdiff(), mv);
432  Vdiff = V;
433  }
434  POCSMinMax(mv, v1min, v1max);
435  if (computeE) {
436  computeEnergy(Vdiff(), mv);
437  Vdiff = V;
438  }
439  POCSmask(mask, mv);
440  if (computeE) {
441  computeEnergy(Vdiff(), mv);
442  Vdiff = V;
443  }
445  POCSFourierPhase(V2FourierPhase, V2Fourier);
447  if (computeE) {
448  computeEnergy(Vdiff(), mv);
449  Vdiff = V;
450  }
451  POCSnonnegative(mv);
452  if (computeE) {
453  computeEnergy(Vdiff(), mv);
454  Vdiff = V;
455  }
456  double std2 = mv.computeStddev();
457  mv *= std1 / std2;
458  if (computeE) {
459  computeEnergy(Vdiff(), mv);
460  Vdiff = V;
461  }
462  if (cutFreq != 0) {
463  filter2.generateMask(mv);
466  if (computeE) {
467  computeEnergy(Vdiff(), mv);
468  Vdiff = V;
469  }
470  }
471  }
472 
473  if (performSubtraction) {
474  auto masksub = getSubtractionMask(fnMaskSub, mask);
475  V1.read(fnVolRef);
476  V = subtraction(V1, V, masksub, fnVol1F, fnVol2A, filter2, cutFreq);
477  }
478 
479  // Recover original alignment
480  Image<double> Vf;
481  MultidimArray<double> &mvf = Vf();
482  mvf.setXmippOrigin();
483  Vf = V;
485  A.initIdentity(4);
486  geo2TransformationMatrix(rowIn,A);
487  applyGeometry(xmipp_transformation::LINEAR, mvf, mv, A, xmipp_transformation::IS_INV, xmipp_transformation::DONT_WRAP);
488  writeParticle(rowOut, fnImgOut, Vf);
489 }
490 
492 {
494 }
void processImage(const FileName &fnImg, const FileName &fnImgOut, const MDRow &rowIn, MDRow &rowOut) override
Rotation angle of an image (double,degrees)
#define YSIZE(v)
void min(Image< double > &op1, const Image< double > &op2)
MultidimArray< double > computeRadQuotient(const MultidimArray< double > &, const MultidimArray< double > &, const MultidimArray< double > &, const MultidimArray< double > &)
void radialAverage(const MultidimArray< double > &, const MultidimArray< double > &, MultidimArray< double > &)
double getDoubleParam(const char *param, int arg=0)
__host__ __device__ float2 floor(const float2 v)
void inverseFourierTransform()
Definition: xmipp_fftw.cpp:329
#define FINISHINGX(v)
void geo2TransformationMatrix(const MDRow &imageGeo, Matrix2D< double > &A, bool only_apply_shifts)
#define MULTIDIM_SIZE(v)
void resizeNoCopy(const MultidimArray< T1 > &v)
void sqrt(Image< double > &op)
MultidimArray< double > getSubtractionMask(const FileName &, MultidimArray< double >)
Tilting angle of an image (double,degrees)
void readParams() override
Read argument from command line.
Shift for the image in the X axis (double)
void applyGeometry(int SplineDegree, MultidimArray< std::complex< double > > &V2, const MultidimArray< std::complex< double > > &V1, const Matrix2D< double > &A, bool inv, bool wrap, std::complex< double > outside, MultidimArray< double > *BcoeffsPtr)
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)
void preProcess() override
MPI methods.
Special label to be used when gathering MDs in MpiMetadataPrograms.
doublereal * w
void initConstant(T val)
void abs(Image< double > &op)
void write(const FileName &outFile, WriteModeMetaData mode=MD_OVERWRITE) const
void POCSmask(const MultidimArray< double > &, MultidimArray< double > &)
Processing methods.
MultidimArray< double > mask
Matrix1D< double > roffset
#define FINISHINGZ(v)
MultidimArray< std::complex< double > > V2Fourier
Image< double > subtraction(Image< double >, Image< double > &, const MultidimArray< double > &, const FileName &, const FileName &, FourierFilter &, double)
ProgSubtomoSubtraction()
Empty constructor.
#define STARTINGX(v)
#define i
void extractPhase(MultidimArray< std::complex< double >> &) const
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
FourierTransformer transformer2
#define STARTINGY(v)
void CenterFFT(MultidimArray< T > &v, bool forward)
Definition: xmipp_fft.h:291
#define FFT_IDX2DIGFREQ_FAST(idx, size, size_2, isize, freq)
Definition: xmipp_fft.h:54
#define DIRECT_A1D_ELEM(v, i)
void window(MultidimArray< T1 > &result, int n0, int z0, int y0, int x0, int nF, int zF, int yF, int xF, T1 init_value=0) const
const char * getParam(const char *param, int arg=0)
void centerFFTMagnitude(MultidimArray< double > &, MultidimArray< std::complex< double >> &, MultidimArray< double > &) const
void selfTranslate(int SplineDegree, MultidimArray< T > &V1, const Matrix1D< double > &v, bool wrap=xmipp_transformation::WRAP, T outside=0)
void createFilter(FourierFilter &, double)
void POCSFourierAmplitude(const MultidimArray< double > &, MultidimArray< std::complex< double >> &, double)
void filterMask(MultidimArray< double > &) const
#define XSIZE(v)
#define RAISED_COSINE
void max(Image< double > &op1, const Image< double > &op2)
void show() const override
Show.
#define FOR_ALL_DIRECT_ELEMENTS_IN_MULTIDIMARRAY(v)
MultidimArray< std::complex< double > > computePhase(MultidimArray< double > &)
#define ZSIZE(v)
#define DIRECT_MULTIDIM_ELEM(v, n)
MultidimArray< double > computeMagnitude(MultidimArray< double > &)
void Euler_rotate(const MultidimArray< double > &V, double rot, double tilt, double psi, MultidimArray< double > &result)
Definition: geometry.cpp:1061
int verbose
Verbosity level.
void POCSFourierPhase(const MultidimArray< std::complex< double >> &, MultidimArray< std::complex< double >> &)
void initZeros()
Definition: matrix1d.h:592
void mod(const MultidimArray< T > &x, MultidimArray< T > &m, double y)
#define DIRECT_A3D_ELEM(v, k, i, j)
void FourierTransform(T &v, T1 &V, bool getCopy=true)
Definition: xmipp_fftw.h:166
MultidimArray< double > createMask(const Image< double > &, const FileName &, const FileName &)
void POCSFourierAmplitudeRadAvg(MultidimArray< std::complex< double >> &, double, const MultidimArray< double > &, int, int, int)
#define j
const T & getValueOrDefault(MDLabel label, const T &def) const
bool remove_disabled
Remove disabled images from the input selfile.
void setValue(MDLabel label, const T &d, bool addLabel=true)
#define FINISHINGY(v)
#define FOR_ALL_ELEMENTS_IN_ARRAY1D(v)
void POCSMinMax(MultidimArray< double > &, double, double)
int round(double x)
Definition: ap.cpp:7245
void POCSnonnegative(MultidimArray< double > &)
bool isEmpty() const
bool save_metadata_stack
Save the associated output metadata when output file is a stack.
Shift for the image in the Z axis (double)
void completeFourierTransform(T &v, T1 &V)
Definition: xmipp_fftw.h:315
bool keep_input_columns
Keep input metadata columns.
bool checkParam(const char *param)
int read(const FileName &name, DataMode datamode=DATA, size_t select_img=ALL_IMAGES, bool mapData=false, int mode=WRITE_READONLY)
#define REALGAUSSIAN
bool each_image_produces_an_output
Indicate that an output is produced for each image in the input.
Shift for the image in the Y axis (double)
void addUsageLine(const char *line, bool verbatim=false)
double computeStddev() const
void initZeros(const MultidimArray< T1 > &op)
int getIntParam(const char *param, int arg=0)
void FFT_magnitude(const MultidimArray< std::complex< double > > &v, MultidimArray< double > &mag)
Definition: xmipp_fftw.cpp:393
void computeEnergy(MultidimArray< double > &, const MultidimArray< double > &) const
void generateMask(MultidimArray< double > &v)
void readParticle(const MDRow &rowIn)
Read and write methods.
#define STARTINGZ(v)
void defineParams() override
Define parameters.
Name of an image (std::string)
bool produces_a_metadata
Indicate that the unique final output file is a Metadata.
#define LOWPASS
void addParamsLine(const String &line)
void writeParticle(MDRow &rowOut, FileName, Image< double > &)
MultidimArray< double > V1FourierMag
void initIdentity()
Definition: matrix2d.h:673
void applyMaskSpace(MultidimArray< double > &v)