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

#include <arotation_estimator.h>

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

Public Member Functions

 ARotationEstimator ()
 
void init (const RotationEstimationSetting settings, bool reuse)
 
void loadReference (const T *ref)
 
void compute (T *others)
 
const std::vector< float > & getRotations2D () const
 
virtual ~ARotationEstimator ()
 
HWgetHW () const
 
const RotationEstimationSettinggetSettings () const
 

Protected Member Functions

virtual void check ()=0
 
virtual void init2D ()=0
 
virtual void load2DReferenceOneToN (const T *ref)=0
 
virtual void computeRotation2DOneToN (T *others)=0
 
virtual bool canBeReused2D (const RotationEstimationSetting &s) const =0
 
std::vector< float > & getRotations2D ()
 
constexpr bool isInitialized () const
 
constexpr bool isRefLoaded () const
 

Detailed Description

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

Definition at line 124 of file arotation_estimator.h.

Constructor & Destructor Documentation

◆ ARotationEstimator()

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

Definition at line 126 of file arotation_estimator.h.

126  :
127  m_isInit(false),
128  m_isRefLoaded(false) {};

◆ ~ARotationEstimator()

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

Definition at line 140 of file arotation_estimator.h.

140 {};

Member Function Documentation

◆ canBeReused2D()

template<typename T>
virtual bool Alignment::ARotationEstimator< T >::canBeReused2D ( const RotationEstimationSetting s) const
protectedpure virtual

◆ check()

template<typename T>
virtual void Alignment::ARotationEstimator< T >::check ( )
protectedpure virtual

◆ compute()

template<typename T >
void Alignment::ARotationEstimator< T >::compute ( T *  others)

Definition at line 72 of file arotation_estimator.cpp.

72  { // FIXME DS should be const?
73  if (m_settings.otherDims.is2D()) {
74  m_rotations2D.resize(0);
75  m_rotations2D.reserve(m_settings.otherDims.n());
76  if (AlignType::OneToN == m_settings.type) {
77  return this->computeRotation2DOneToN(others);
78  }
79  }
80  REPORT_ERROR(ERR_NOT_IMPLEMENTED, "Not implemented");
81 }
CUDA_HD constexpr bool is2D() const
Definition: dimensions.h:162
Case or algorithm not implemented yet.
Definition: xmipp_error.h:177
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
CUDA_HD constexpr size_t n() const
Definition: dimensions.h:78
virtual void computeRotation2DOneToN(T *others)=0

◆ computeRotation2DOneToN()

template<typename T>
virtual void Alignment::ARotationEstimator< T >::computeRotation2DOneToN ( T *  others)
protectedpure virtual

◆ getHW()

template<typename T>
HW& Alignment::ARotationEstimator< T >::getHW ( ) const
inline

Definition at line 142 of file arotation_estimator.h.

142  { // FIXME DS remove once we use the new data-centric approach
143  assert(m_isInit);
144  return *m_settings.hw.at(0);
145  }

◆ getRotations2D() [1/2]

template<typename T>
const std::vector<float>& Alignment::ARotationEstimator< T >::getRotations2D ( ) const
inline

Definition at line 136 of file arotation_estimator.h.

136  {
137  return m_rotations2D;
138  }

◆ getRotations2D() [2/2]

template<typename T>
std::vector<float>& Alignment::ARotationEstimator< T >::getRotations2D ( )
inlineprotected

Definition at line 160 of file arotation_estimator.h.

160  {
161  return m_rotations2D;
162  }

◆ getSettings()

template<typename T>
const RotationEstimationSetting& Alignment::ARotationEstimator< T >::getSettings ( ) const
inline

Definition at line 147 of file arotation_estimator.h.

147  {
148  return m_settings;
149  }

◆ init()

template<typename T >
void Alignment::ARotationEstimator< T >::init ( const RotationEstimationSetting  settings,
bool  reuse 
)

Definition at line 31 of file arotation_estimator.cpp.

31  {
32  // check that settings is not completely wrong
33  settings.check();
34  bool skipInit = m_isInit && reuse && this->canBeReused(settings);
35  // set it
36  m_settings = settings;
37  // initialize estimator
38  if ( ! skipInit) {
39  if (m_settings.otherDims.is2D()) {
40  this->init2D();
41  } else {
42  REPORT_ERROR(ERR_NOT_IMPLEMENTED, "Not implemented");
43  }
44  // check that there's no logical problem
45  this->check();
46  // no issue found, we're good to go
47  m_isInit = true;
48  }
49 }
CUDA_HD constexpr bool is2D() const
Definition: dimensions.h:162
Case or algorithm not implemented yet.
Definition: xmipp_error.h:177
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211

◆ init2D()

template<typename T>
virtual void Alignment::ARotationEstimator< T >::init2D ( )
protectedpure virtual

◆ isInitialized()

template<typename T>
constexpr bool Alignment::ARotationEstimator< T >::isInitialized ( ) const
inlineprotected

Definition at line 164 of file arotation_estimator.h.

164  {
165  return m_isInit;
166  }

◆ isRefLoaded()

template<typename T>
constexpr bool Alignment::ARotationEstimator< T >::isRefLoaded ( ) const
inlineprotected

Definition at line 168 of file arotation_estimator.h.

168  {
169  return m_isRefLoaded;
170  }

◆ load2DReferenceOneToN()

template<typename T>
virtual void Alignment::ARotationEstimator< T >::load2DReferenceOneToN ( const T *  ref)
protectedpure virtual

◆ loadReference()

template<typename T >
void Alignment::ARotationEstimator< T >::loadReference ( const T *  ref)

Definition at line 60 of file arotation_estimator.cpp.

60  {
61  if (m_settings.otherDims.is2D()) {
62  if (AlignType::OneToN == m_settings.type) {
63  this->load2DReferenceOneToN(ref);
64  m_isRefLoaded = true;
65  return;
66  }
67  }
68  REPORT_ERROR(ERR_NOT_IMPLEMENTED, "Not implemented");
69 }
CUDA_HD constexpr bool is2D() const
Definition: dimensions.h:162
Case or algorithm not implemented yet.
Definition: xmipp_error.h:177
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
virtual void load2DReferenceOneToN(const T *ref)=0

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