| 366 | } |
| 367 | |
| 368 | void mitkImageStatisticsCalculatorTestSuite::TestCase8() |
| 369 | { |
| 370 | /***************************** |
| 371 | * whole pixel (gray) |
| 372 | * -> mean of 128 expected |
| 373 | ******************************/ |
| 374 | MITK_INFO << std::endl << "Test case 8:-----------------------------------------------------------------------------------"; |
| 375 | |
| 376 | std::string filename = this->GetTestDataFilePath("ImageStatisticsTestData/testimage.nrrd"); |
| 377 | m_TestImage = mitk::IOUtil::Load<mitk::Image>(filename); |
| 378 | m_Geometry = m_TestImage->GetSlicedGeometry()->GetPlaneGeometry(0); |
| 379 | |
| 380 | mitk::Point2D pnt1; pnt1[0] = 11.5; pnt1[1] = 10.5; |
| 381 | mitk::Point2D pnt2; pnt2[0] = 11.5; pnt2[1] = 11.5; |
| 382 | mitk::Point2D pnt3; pnt3[0] = 12.5; pnt3[1] = 11.5; |
| 383 | mitk::Point2D pnt4; pnt4[0] = 12.5; pnt4[1] = 10.5; |
| 384 | std::vector<mitk::Point2D> points{ pnt1,pnt2,pnt3,pnt4 }; |
| 385 | auto figure = GeneratePlanarPolygon(m_Geometry, points); |
| 386 | |
| 387 | mitk::PlanarFigureMaskGenerator::Pointer planFigMaskGen = mitk::PlanarFigureMaskGenerator::New(); |
| 388 | planFigMaskGen->SetInputImage(m_TestImage); |
| 389 | planFigMaskGen->SetPlanarFigure(figure.GetPointer()); |
| 390 | |
| 391 | mitk::ImageStatisticsContainer::Pointer statisticsContainer; |
| 392 | CPPUNIT_ASSERT_NO_THROW(statisticsContainer = ComputeStatistics(m_TestImage, planFigMaskGen.GetPointer())); |
| 393 | auto statisticsObjectTimestep0 = statisticsContainer->GetStatistics(1, 0); |
| 394 | |
| 395 | this->VerifyStatistics(statisticsObjectTimestep0, 128.0, 0.0, 128.0); |
| 396 | } |
| 397 | |
| 398 | void mitkImageStatisticsCalculatorTestSuite::TestCase9() |
| 399 | { |
nothing calls this directly
no test coverage detected