Xmipp  v3.23.11-Nereus
movie_alignment_correlation.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Carlos Oscar Sanchez Sorzano coss@cnb.csic.es
4  * David Strelak (davidstrelak@gmail.com)
5  *
6  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21  * 02111-1307 USA
22  *
23  * All comments concerning this program package may be sent to the
24  * e-mail address 'xmipp@cnb.csic.es'
25  ***************************************************************************/
26 
27 #ifndef _PROG_MOVIE_ALIGNMENT_CORRELATION
28 #define _PROG_MOVIE_ALIGNMENT_CORRELATION
29 
30 #include "data/filters.h"
31 #include "core/xmipp_fftw.h"
33 
38 template<typename T>
40 public:
41  void defineParams() override;
42  void readParams() override;
43 private:
51  void loadData(const MetaData& movie, const Image<T>& dark,
52  const Image<T>& igain);
53 
62  void computeShifts(size_t N, const Matrix1D<T>& bX, const Matrix1D<T>& bY,
63  const Matrix2D<T>& A);
64 
68  void applyShiftsComputeAverage(const MetaData& movie, const Image<T>& dark,
69  const Image<T>& igain, Image<T>& initialMic, size_t& Ninitial,
70  Image<T>& averageMicrograph, size_t& N,
71  const AlignmentResult<T> &globAlignment);
72 
76  void applyShiftsComputeAverage(
77  const MetaData& movie, const Image<T>& dark, const Image<T>& igain,
78  Image<T>& initialMic, size_t& Ninitial, Image<T>& averageMicrograph,
79  size_t& N, const LocalAlignmentResult<T> &alignment);
80 
84  AlignmentResult<T> computeGlobalAlignment(const MetaData &movie,
85  const Image<T> &dark,
86  const Image<T> &igain);
87 
91  void releaseAll() {
92  for (auto f : frameFourier) {
93  delete f;
94  }
95  frameFourier.clear();
96  };
97 
101  LocalAlignmentResult<T> computeLocalAlignment(const MetaData &movie,
102  const Image<T> &dark, const Image<T> &igain,
103  const AlignmentResult<T> &globAlignment);
104 private:
109  std::vector<MultidimArray<std::complex<T> > *> frameFourier;
110 
112  int newXdim;
113  int newYdim;
114 
116  float sizeFactor;
117 };
119 #endif
void defineParams() override
Define parameters.
Definition: mask.h:36
void readParams() override
Read argument from command line.
double * f
Definition: ctf.h:38