Xmipp  v3.23.11-Nereus
Classes | Typedefs | Functions
test_psd_estimator.cpp File Reference
#include <gtest/gtest.h>
#include <set>
#include "reconstruction/psd_estimator.h"
Include dependency graph for test_psd_estimator.cpp:

Go to the source code of this file.

Classes

class  PSD_Estimator_Test< T >
 

Typedefs

typedef ::testing::Types< double, float > TestTypes
 

Functions

 TYPED_TEST_SUITE_P (PSD_Estimator_Test)
 
 TYPED_TEST_P (PSD_Estimator_Test, windowCoords)
 
 TYPED_TEST_P (PSD_Estimator_Test, half2whole)
 
 REGISTER_TYPED_TEST_SUITE_P (PSD_Estimator_Test, windowCoords, half2whole)
 
 INSTANTIATE_TYPED_TEST_SUITE_P (psd_estimator, PSD_Estimator_Test, TestTypes)
 

Typedef Documentation

◆ TestTypes

typedef ::testing::Types<double, float> TestTypes

Definition at line 202 of file test_psd_estimator.cpp.

Function Documentation

◆ INSTANTIATE_TYPED_TEST_SUITE_P()

INSTANTIATE_TYPED_TEST_SUITE_P ( psd_estimator  ,
PSD_Estimator_Test  ,
TestTypes   
)

◆ REGISTER_TYPED_TEST_SUITE_P()

REGISTER_TYPED_TEST_SUITE_P ( PSD_Estimator_Test  ,
windowCoords  ,
half2whole   
)

◆ TYPED_TEST_P() [1/2]

TYPED_TEST_P ( PSD_Estimator_Test  ,
windowCoords   
)

Definition at line 136 of file test_psd_estimator.cpp.

137 {
138  auto inXCandid = {32, 256, 512};
139  auto inYCandid = {32, 256, 512, 513};
140  auto patchXCandid = {5, 64, 367, 512};
141  auto patchYCandid = {5, 64, 367, 512};
142  auto borderXCandid = {0, 5};
143  auto borderYCandid = {0, 5};
144  auto overlapCandid = {0.f, 0.2f, 0.9f};
145 
146  int counter = 0;
147  for (auto inX : inXCandid) {
148  for (auto inY : inYCandid) {
149  for (auto patchX : patchXCandid) {
150  if (patchX > inX) continue;
151  for (auto patchY : patchYCandid) {
152  if (patchY > inY) continue;
153  for (auto borderX : borderXCandid) {
154  if (patchX + 2 * borderX > inX) continue;
155  for (auto borderY : borderYCandid) {
156  if (patchY + 2 * borderY > inY) continue;
157  counter = (counter + 1) % overlapCandid.size();
159  {borderX, borderY},
160  Dimensions(inX, inY),
161  Dimensions(patchX, patchY),
162  *(overlapCandid.begin() + counter));
163  }
164  }
165  }
166  }
167  }
168  }
169 }
void test_window(const std::pair< size_t, size_t > &borders, const Dimensions &micrograph, const Dimensions &patch, float overlap)

◆ TYPED_TEST_P() [2/2]

TYPED_TEST_P ( PSD_Estimator_Test  ,
half2whole   
)

Definition at line 171 of file test_psd_estimator.cpp.

172 {
173  // even even (small)
176  // odd even (small)
178  // even odd (small)
180  // odd odd (small)
183 
184  // even even (big)
187  // odd even (big)
189  // even odd (big)
191  // odd odd (big)
194 }
void testHalf2Whole(size_t x, size_t y)

◆ TYPED_TEST_SUITE_P()

TYPED_TEST_SUITE_P ( PSD_Estimator_Test  )