23 CPPUNIT_TEST_SUITE(mitkPhotoacousticNoiseGeneratorTestSuite);
25 CPPUNIT_TEST_SUITE_END();
31 mitk::pa::Volume::Pointer m_Volume;
37 void testNoiseGenerator()
39 int size = 1000 * 100 * 100;
40 auto* volume =
new double[size];
41 for (
int i = 0; i < size; i++)
48 int negativecounter = 0;
50 for (
int i = 0; i < size; i++)
52 if (m_Volume->GetData()[i] <= 0)
57 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"More than one negative: " +
58 std::to_string(negativecounter) +
" (" +
59 std::to_string((((
double)negativecounter) / size) * 100) +
"%)", negativecounter, 0);
62 void tearDown()
override MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
Test fixture for parameterized tests.
static void ApplyNoiseModel(mitk::pa::Volume::Pointer image, double detectorNoise, double speckleNoise)
ApplyNoiseModel Applies noise to an image.
static Volume::Pointer New(double *data, unsigned int xDim, unsigned int yDim, unsigned int zDim, double spacing)
returns smartpointer reference to a new instance of this objects. The given data array will be freed ...