Xmipp  v3.23.11-Nereus
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Alignment::AShiftCorrEstimator< T > Class Template Referenceabstract

#include <ashift_corr_estimator.h>

Inheritance diagram for Alignment::AShiftCorrEstimator< T >:
Inheritance graph
[legend]
Collaboration diagram for Alignment::AShiftCorrEstimator< T >:
Collaboration graph
[legend]

Public Member Functions

 AShiftCorrEstimator ()
 
 AShiftCorrEstimator (const AShiftCorrEstimator &)=delete
 
 AShiftCorrEstimator (const AShiftCorrEstimator &&)=delete
 
virtual ~AShiftCorrEstimator ()
 
AShiftCorrEstimatoroperator= (const AShiftCorrEstimator &)=delete
 
AShiftCorrEstimatoroperator= (const AShiftCorrEstimator &&)=delete
 
virtual void init2D (const std::vector< HW *> &hw, AlignType type, const FFTSettings< T > &dims, size_t maxShift, bool includingBatchFT, bool includingSingleFT, bool allowDataOverwrite)=0
 
virtual void computeCorrelations2DOneToN (std::complex< T > *inOut, bool center)=0
 
virtual void load2DReferenceOneToN (const std::complex< T > *ref)=0
 
virtual void computeCorrelations2DOneToN (const HW &hw, std::complex< T > *inOut, const std::complex< T > *ref, const Dimensions &dims, bool center)=0
 
void release () override
 
- Public Member Functions inherited from Alignment::AShiftEstimator< T >
 AShiftEstimator ()
 
 AShiftEstimator (const AShiftEstimator &)=delete
 
 AShiftEstimator (const AShiftEstimator &&)=delete
 
virtual ~AShiftEstimator ()
 
AShiftEstimatoroperator= (const AShiftEstimator &)=delete
 
AShiftEstimatoroperator= (const AShiftEstimator &&)=delete
 
virtual void load2DReferenceOneToN (const T *ref)=0
 
virtual void computeShift2DOneToN (T *others)=0
 
std::vector< Point2D< float > > getShifts2D ()
 
constexpr bool isInitialized () const
 
constexpr Dimensions getDimensions () const
 
constexpr AlignType getAlignType () const
 
virtual HWgetHW () const =0
 

Protected Member Functions

void setDefault () override
 
virtual void init2D (AlignType type, const FFTSettings< T > &dims, size_t maxShift, bool includingBatchFT, bool includingSingleFT, bool allowDataOverwrite)
 
void check () override
 
virtual void init2DOneToN ()
 
void init2D (const std::vector< HW *> &hw, AlignType type, const Dimensions &dims, size_t batch, size_t maxShift)
 
- Protected Member Functions inherited from Alignment::AShiftEstimator< T >
virtual void init2D (AlignType type, const Dimensions &dims, size_t batch, size_t maxShift)
 

Protected Attributes

FFTSettings< T > * m_settingsInv
 
size_t m_centerSize
 
bool m_includingBatchFT
 
bool m_includingSingleFT
 
bool m_is_ref_FD_loaded
 
bool m_allowDataOverwrite
 
- Protected Attributes inherited from Alignment::AShiftEstimator< T >
AlignType m_type
 
const Dimensionsm_dims
 
size_t m_batch
 
size_t m_maxShift
 
std::vector< Point2D< float > > m_shifts2D
 
bool m_is_ref_loaded
 
bool m_is_shift_computed
 
bool m_isInit
 

Detailed Description

template<typename T>
class Alignment::AShiftCorrEstimator< T >

Definition at line 41 of file ashift_corr_estimator.h.

Constructor & Destructor Documentation

◆ AShiftCorrEstimator() [1/3]

template<typename T>
Alignment::AShiftCorrEstimator< T >::AShiftCorrEstimator ( )
inline

Definition at line 43 of file ashift_corr_estimator.h.

43  {
44  setDefault();
45  }

◆ AShiftCorrEstimator() [2/3]

template<typename T>
Alignment::AShiftCorrEstimator< T >::AShiftCorrEstimator ( const AShiftCorrEstimator< T > &  )
delete

◆ AShiftCorrEstimator() [3/3]

template<typename T>
Alignment::AShiftCorrEstimator< T >::AShiftCorrEstimator ( const AShiftCorrEstimator< T > &&  )
delete

◆ ~AShiftCorrEstimator()

template<typename T>
virtual Alignment::AShiftCorrEstimator< T >::~AShiftCorrEstimator ( )
inlinevirtual

Definition at line 50 of file ashift_corr_estimator.h.

50  {
51  release();
52  }

Member Function Documentation

◆ check()

template<typename T >
void Alignment::AShiftCorrEstimator< T >::check ( )
overrideprotectedvirtual

Reimplemented from Alignment::AShiftEstimator< T >.

Definition at line 76 of file ashift_corr_estimator.cpp.

76  {
77  using memoryUtils::operator "" _GB;
78 
79  if (this->m_settingsInv->fBytesBatch() >= 4_GB) {
80  REPORT_ERROR(ERR_VALUE_INCORRECT, "Batch is bigger than max size (4GB)");
81  }
82  if ((0 != (this->m_settingsInv->sDim().x() % 2))
83  || (0 != (this->m_settingsInv->sDim().y() % 2))) {
84  // while performing IFT of the correlation, we center the signal using multiplication
85  // in the FD. This, however, works only for even signal.
87  "The X and Y dimensions have to be multiple of two. Crop your signal");
88  }
89 }
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
Incorrect value received.
Definition: xmipp_error.h:195

◆ computeCorrelations2DOneToN() [1/2]

template<typename T>
virtual void Alignment::AShiftCorrEstimator< T >::computeCorrelations2DOneToN ( std::complex< T > *  inOut,
bool  center 
)
pure virtual

◆ computeCorrelations2DOneToN() [2/2]

template<typename T>
virtual void Alignment::AShiftCorrEstimator< T >::computeCorrelations2DOneToN ( const HW hw,
std::complex< T > *  inOut,
const std::complex< T > *  ref,
const Dimensions dims,
bool  center 
)
pure virtual

◆ init2D() [1/3]

template<typename T>
virtual void Alignment::AShiftCorrEstimator< T >::init2D ( const std::vector< HW *> &  hw,
AlignType  type,
const FFTSettings< T > &  dims,
size_t  maxShift,
bool  includingBatchFT,
bool  includingSingleFT,
bool  allowDataOverwrite 
)
pure virtual

◆ init2D() [2/3]

template<typename T >
void Alignment::AShiftCorrEstimator< T >::init2D ( AlignType  type,
const FFTSettings< T > &  dims,
size_t  maxShift,
bool  includingBatchFT,
bool  includingSingleFT,
bool  allowDataOverwrite 
)
protectedvirtual

Definition at line 52 of file ashift_corr_estimator.cpp.

55  {
56  AShiftEstimator<T>::init2D(type, dims.sDim(), dims.batch(), maxShift);
57 
58  m_settingsInv = new FFTSettings<T>(dims.isForward() ? dims.createInverse() : dims);
59  m_includingBatchFT = includingBatchFT;
60  m_includingSingleFT = includingSingleFT;
61  m_centerSize = 2 * maxShift + 1;
62  m_allowDataOverwrite = allowDataOverwrite;
63 
64  this->check();
65 
66  switch (type) {
67  case AlignType::OneToN:
68  init2DOneToN();
69  break;
70  default:
71  REPORT_ERROR(ERR_NOT_IMPLEMENTED, "This alignment type is not supported yet");
72  }
73 }
Case or algorithm not implemented yet.
Definition: xmipp_error.h:177
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
virtual void init2D(const std::vector< HW *> &hw, AlignType type, const Dimensions &dims, size_t batch, size_t maxShift)=0
constexpr size_t batch() const
Definition: fft_settings.h:86
viol type
FFTSettings< T > createInverse() const
Definition: fft_settings.h:134
constexpr Dimensions sDim() const
Definition: fft_settings.h:78
constexpr bool isForward() const
Definition: fft_settings.h:122

◆ init2D() [3/3]

template<typename T>
void Alignment::AShiftCorrEstimator< T >::init2D ( const std::vector< HW *> &  hw,
AlignType  type,
const Dimensions dims,
size_t  batch,
size_t  maxShift 
)
inlineprotectedvirtual

Implements Alignment::AShiftEstimator< T >.

Definition at line 100 of file ashift_corr_estimator.h.

101  {};

◆ init2DOneToN()

template<typename T>
virtual void Alignment::AShiftCorrEstimator< T >::init2DOneToN ( )
inlineprotectedvirtual

Definition at line 95 of file ashift_corr_estimator.h.

95 {}; // nothing to do

◆ load2DReferenceOneToN()

template<typename T>
virtual void Alignment::AShiftCorrEstimator< T >::load2DReferenceOneToN ( const std::complex< T > *  ref)
pure virtual

◆ operator=() [1/2]

template<typename T>
AShiftCorrEstimator& Alignment::AShiftCorrEstimator< T >::operator= ( const AShiftCorrEstimator< T > &  )
delete

◆ operator=() [2/2]

template<typename T>
AShiftCorrEstimator& Alignment::AShiftCorrEstimator< T >::operator= ( const AShiftCorrEstimator< T > &&  )
delete

◆ release()

template<typename T >
void Alignment::AShiftCorrEstimator< T >::release ( )
overridevirtual

◆ setDefault()

template<typename T >
void Alignment::AShiftCorrEstimator< T >::setDefault ( )
overrideprotectedvirtual

Member Data Documentation

◆ m_allowDataOverwrite

template<typename T>
bool Alignment::AShiftCorrEstimator< T >::m_allowDataOverwrite
protected

Definition at line 86 of file ashift_corr_estimator.h.

◆ m_centerSize

template<typename T>
size_t Alignment::AShiftCorrEstimator< T >::m_centerSize
protected

Definition at line 80 of file ashift_corr_estimator.h.

◆ m_includingBatchFT

template<typename T>
bool Alignment::AShiftCorrEstimator< T >::m_includingBatchFT
protected

Definition at line 83 of file ashift_corr_estimator.h.

◆ m_includingSingleFT

template<typename T>
bool Alignment::AShiftCorrEstimator< T >::m_includingSingleFT
protected

Definition at line 84 of file ashift_corr_estimator.h.

◆ m_is_ref_FD_loaded

template<typename T>
bool Alignment::AShiftCorrEstimator< T >::m_is_ref_FD_loaded
protected

Definition at line 85 of file ashift_corr_estimator.h.

◆ m_settingsInv

template<typename T>
FFTSettings<T>* Alignment::AShiftCorrEstimator< T >::m_settingsInv
protected

Definition at line 79 of file ashift_corr_estimator.h.


The documentation for this class was generated from the following files: