31 void PolarRotationEstimator<T>::init2D() {
33 auto s = this->getSettings();
34 if (1 != s.hw.size()) {
38 m_cpu =
dynamic_cast<CPU*
>(s.hw.at(0));
39 }
catch (std::bad_cast&) {
43 if (std::is_same<T, float>()) {
44 m_dataAux.resize(s.refDims.y(), s.refDims.x());
49 void PolarRotationEstimator<T>::load2DReferenceOneToN(
const T *ref) {
50 auto isReady = this->isInitialized();
57 auto s = this->getSettings();
59 s.firstRing, s.lastRing, m_refPlans, 1);
60 m_rotCorrAux.resize(2 * m_refPolarFourierI.getSampleNoOuterRing() - 1);
61 m_aux.local_transformer.setReal(m_rotCorrAux);
66 const size_t s = this->getSettings().otherDims.sizeSingle();
67 for (
size_t i = 0;
i < s; ++
i) {
68 m_dataAux.
data[
i] = data[
i];
75 const auto s = this->getSettings().otherDims.copyForN(1);
83 void PolarRotationEstimator<T>::computeRotation2DOneToN(T *others) {
84 bool isReady = this->isInitialized() && this->isRefLoaded();
89 auto s = this->getSettings();
90 for (
size_t n = 0;
n < s.otherDims.n(); ++
n) {
91 size_t offset =
n * s.otherDims.sizeSingle();
95 s.firstRing, s.lastRing, m_plans, 1);
96 this->getRotations2D().emplace_back(
102 void PolarRotationEstimator<T>::release() {
105 m_rotCorrAux.clear();
112 void PolarRotationEstimator<T>::setDefault() {
114 m_refPlans =
nullptr;
120 void PolarRotationEstimator<T>::check() {
121 const auto s = this->getSettings();
123 std::cerr <<
"Batch processing is not supported. Signals will be processed one by one.\n";
125 if (s.allowDataOverwrite) {
126 std::cerr <<
"allowDataOverwrite flag is ignored, as it's not yet supported.\n";
128 if (s.refDims.x() != s.refDims.y()) {
131 if (s.refDims.isPadded()) {
134 if (s.refDims.x() < 6) {
141 template class PolarRotationEstimator<float>;
142 template class PolarRotationEstimator<double>;
#define REPORT_ERROR(nerr, ErrormMsg)
template void polarFourierTransform< false >(const MultidimArray< double > &in, Polar< std::complex< double > > &out, bool conjugated, int first_ring, int last_ring, Polar_fftw_plans *&plans, int BsplineOrder)
double best_rotation(const Polar< std::complex< double > > &I1, const Polar< std::complex< double > > &I2, RotationalCorrelationAux &aux)
Incorrect argument received.
Some logical error in the pipeline.