Xmipp  v3.23.11-Nereus
ashift_corr_estimator.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: David Strelak (davidstrelak@gmail.com)
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 #ifndef LIBRARIES_RECONSTRUCTION_ASHIFT_CORR_ESTIMATOR_H_
27 #define LIBRARIES_RECONSTRUCTION_ASHIFT_CORR_ESTIMATOR_H_
28 
29 #include "ashift_estimator.h"
30 #include "data/fft_settings.h"
32 #include <complex>
33 #include <limits>
34 
38 namespace Alignment {
39 
40 template<typename T>
42 public:
44  setDefault();
45  }
46 
49 
51  release();
52  }
53 
56 
57  virtual void init2D(const std::vector<HW*> &hw, AlignType type,
58  const FFTSettings<T> &dims, size_t maxShift,
59  bool includingBatchFT, bool includingSingleFT,
60  bool allowDataOverwrite) = 0;
61 
62  virtual void computeCorrelations2DOneToN(
63  std::complex<T> *inOut, bool center) = 0;
64 
65  virtual void load2DReferenceOneToN(const std::complex<T> *ref) = 0;
66 
68 
69  virtual void computeCorrelations2DOneToN(
70  const HW &hw,
71  std::complex<T> *inOut,
72  const std::complex<T> *ref,
73  const Dimensions &dims,
74  bool center) = 0;
75 
76  void release() override;
77 
78 protected:
80  size_t m_centerSize;
81 
82  // flags
87 
88  void setDefault() override;
89  virtual void init2D(AlignType type,
90  const FFTSettings<T> &dims, size_t maxShift,
91  bool includingBatchFT, bool includingSingleFT,
92  bool allowDataOverwrite);
93 
94  void check() override;
95  virtual void init2DOneToN() {}; // nothing to do
96 
97  // parent init functions cannot be used, but cannot be hidden
98  // in private block, to make compiler (NVCC) happy
100  void init2D(const std::vector<HW*> &hw, AlignType type,
101  const Dimensions &dims, size_t batch, size_t maxShift) {};
102 };
103 
104 } /* namespace Alignment */
106 #endif /* LIBRARIES_RECONSTRUCTION_ASHIFT_CORR_ESTIMATOR_H_ */
virtual void load2DReferenceOneToN(const std::complex< T > *ref)=0
virtual void init2D(const std::vector< HW *> &hw, AlignType type, const FFTSettings< T > &dims, size_t maxShift, bool includingBatchFT, bool includingSingleFT, bool allowDataOverwrite)=0
AShiftCorrEstimator & operator=(const AShiftCorrEstimator &)=delete
Definition: hw.h:35
viol type
virtual void computeCorrelations2DOneToN(std::complex< T > *inOut, bool center)=0
void init2D(const std::vector< HW *> &hw, AlignType type, const Dimensions &dims, size_t batch, size_t maxShift)