Xmipp  v3.23.11-Nereus
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Alignment::RotationEstimationSetting Class Reference

#include <arotation_estimator.h>

Collaboration diagram for Alignment::RotationEstimationSetting:
Collaboration graph
[legend]

Public Member Functions

unsigned getNoOfRings () const
 
void check () const
 

Static Public Member Functions

static float getMaxRotation ()
 
static unsigned getDefaultLastRing (const Dimensions &d)
 
static unsigned getDefaultFirstRing (const Dimensions &d)
 

Public Attributes

std::vector< HW * > hw
 
AlignType type
 
Dimensions refDims = Dimensions(0)
 
Dimensions otherDims = Dimensions(0)
 
size_t batch
 
float maxRotDeg
 
bool fullCircle
 
unsigned firstRing
 
unsigned lastRing
 
bool allowTuningOfNumberOfSamples
 
bool allowDataOverwrite
 

Detailed Description

Definition at line 42 of file arotation_estimator.h.

Member Function Documentation

◆ check()

void Alignment::RotationEstimationSetting::check ( ) const
inline

Definition at line 72 of file arotation_estimator.h.

72  {
73  if (0 == hw.size()) {
74  REPORT_ERROR(ERR_VALUE_INCORRECT, "HW contains zero (0) devices");
75  }
76  if ( ! refDims.isValid()) {
77  REPORT_ERROR(ERR_LOGIC_ERROR, "'Reference' dimensions are invalid (contain 0)");
78  }
79  if ( ! otherDims.isValid()) {
80  REPORT_ERROR(ERR_LOGIC_ERROR, "'Other' dimensions are invalid (contain 0)");
81  }
83  REPORT_ERROR(ERR_LOGIC_ERROR, "Dimensions of the reference and other signals differ");
84  }
85  if (AlignType::None == type) {
86  REPORT_ERROR(ERR_LOGIC_ERROR, "'None' alignment type is set. This is invalid value");
87  }
88  if ((AlignType::OneToN == type)
89  && (1 != refDims.n())) {
90  REPORT_ERROR(ERR_LOGIC_ERROR, "More than one reference specified for alignment type 1:N");
91  }
92  if ((AlignType::MToN == type)
93  && (1 == refDims.n())) {
94  REPORT_ERROR(ERR_LOGIC_ERROR, "Single reference specified for alignment type M:N");
95  }
96  if (batch > otherDims.n()) {
97  REPORT_ERROR(ERR_LOGIC_ERROR, "Batch is bigger than number of signals");
98  }
99  if (0 == batch) {
100  REPORT_ERROR(ERR_LOGIC_ERROR, "Batch is zero (0)");
101  }
102  if (0 == maxRotDeg) {
103  REPORT_ERROR(ERR_VALUE_INCORRECT, "Max rotation is zero (0)");
104  }
105  if (0 == lastRing) {
106  REPORT_ERROR(ERR_VALUE_INCORRECT, "Last ring is zero (0)");
107  }
108  if (0 == firstRing) {
109  REPORT_ERROR(ERR_VALUE_INCORRECT, "First ring is zero (0)");
110  }
111  if (lastRing <= firstRing) {
112  REPORT_ERROR(ERR_VALUE_INCORRECT, "Last ring is bigger (or equal) than first ring");
113  }
114  if (lastRing >= refDims.x()) {
115  REPORT_ERROR(ERR_VALUE_INCORRECT, "Last ring is too big");
116  }
117  if (firstRing >= refDims.x()) {
118  REPORT_ERROR(ERR_VALUE_INCORRECT, "First ring is too big");
119  }
120  }
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
CUDA_HD constexpr size_t x() const
Definition: dimensions.h:51
constexpr bool equalExceptNPadded(const Dimensions &b) const
Definition: dimensions.h:124
CUDA_HD constexpr size_t n() const
Definition: dimensions.h:78
constexpr bool isValid() const
Definition: dimensions.h:138
Incorrect value received.
Definition: xmipp_error.h:195
Some logical error in the pipeline.
Definition: xmipp_error.h:147

◆ getDefaultFirstRing()

static unsigned Alignment::RotationEstimationSetting::getDefaultFirstRing ( const Dimensions d)
inlinestatic

Definition at line 64 of file arotation_estimator.h.

64  {
65  return std::max((size_t)2, d.x() / 20);
66  }
CUDA_HD constexpr size_t x() const
Definition: dimensions.h:51
void max(Image< double > &op1, const Image< double > &op2)

◆ getDefaultLastRing()

static unsigned Alignment::RotationEstimationSetting::getDefaultLastRing ( const Dimensions d)
inlinestatic

Definition at line 60 of file arotation_estimator.h.

60  {
61  return (d.x() - 3) / 2; // so that we have some edge around the biggest ring
62  }
CUDA_HD constexpr size_t x() const
Definition: dimensions.h:51

◆ getMaxRotation()

static float Alignment::RotationEstimationSetting::getMaxRotation ( )
inlinestatic

Definition at line 56 of file arotation_estimator.h.

56  {
57  return 360.f - std::numeric_limits<float>::min();
58  }
void min(Image< double > &op1, const Image< double > &op2)

◆ getNoOfRings()

unsigned Alignment::RotationEstimationSetting::getNoOfRings ( ) const
inline

Definition at line 68 of file arotation_estimator.h.

Member Data Documentation

◆ allowDataOverwrite

bool Alignment::RotationEstimationSetting::allowDataOverwrite

Definition at line 54 of file arotation_estimator.h.

◆ allowTuningOfNumberOfSamples

bool Alignment::RotationEstimationSetting::allowTuningOfNumberOfSamples

Definition at line 53 of file arotation_estimator.h.

◆ batch

size_t Alignment::RotationEstimationSetting::batch

Definition at line 48 of file arotation_estimator.h.

◆ firstRing

unsigned Alignment::RotationEstimationSetting::firstRing

Definition at line 51 of file arotation_estimator.h.

◆ fullCircle

bool Alignment::RotationEstimationSetting::fullCircle

Definition at line 50 of file arotation_estimator.h.

◆ hw

std::vector<HW*> Alignment::RotationEstimationSetting::hw

Definition at line 44 of file arotation_estimator.h.

◆ lastRing

unsigned Alignment::RotationEstimationSetting::lastRing

Definition at line 52 of file arotation_estimator.h.

◆ maxRotDeg

float Alignment::RotationEstimationSetting::maxRotDeg

Definition at line 49 of file arotation_estimator.h.

◆ otherDims

Dimensions Alignment::RotationEstimationSetting::otherDims = Dimensions(0)

Definition at line 47 of file arotation_estimator.h.

◆ refDims

Dimensions Alignment::RotationEstimationSetting::refDims = Dimensions(0)

Definition at line 46 of file arotation_estimator.h.

◆ type

AlignType Alignment::RotationEstimationSetting::type

Definition at line 45 of file arotation_estimator.h.


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