| 396 | } |
| 397 | |
| 398 | void mitkImageStatisticsCalculatorTestSuite::TestCase9() |
| 399 | { |
| 400 | /***************************** |
| 401 | * whole pixel (gray) + half pixel (white) in y-direction |
| 402 | * -> mean of 191.5 expected |
| 403 | ******************************/ |
| 404 | MITK_INFO << std::endl << "Test case 9:-----------------------------------------------------------------------------------"; |
| 405 | |
| 406 | std::string filename = this->GetTestDataFilePath("ImageStatisticsTestData/testimage.nrrd"); |
| 407 | m_TestImage = mitk::IOUtil::Load<mitk::Image>(filename); |
| 408 | m_Geometry = m_TestImage->GetSlicedGeometry()->GetPlaneGeometry(0); |
| 409 | |
| 410 | mitk::Point2D pnt1; pnt1[0] = 11.5; pnt1[1] = 10.5; |
| 411 | mitk::Point2D pnt2; pnt2[0] = 11.5; pnt2[1] = 12.0; |
| 412 | mitk::Point2D pnt3; pnt3[0] = 12.5; pnt3[1] = 12.0; |
| 413 | mitk::Point2D pnt4; pnt4[0] = 12.5; pnt4[1] = 10.5; |
| 414 | std::vector<mitk::Point2D> points{ pnt1,pnt2,pnt3,pnt4 }; |
| 415 | auto figure = GeneratePlanarPolygon(m_Geometry, points); |
| 416 | |
| 417 | mitk::PlanarFigureMaskGenerator::Pointer planFigMaskGen = mitk::PlanarFigureMaskGenerator::New(); |
| 418 | planFigMaskGen->SetInputImage(m_TestImage); |
| 419 | planFigMaskGen->SetPlanarFigure(figure.GetPointer()); |
| 420 | |
| 421 | mitk::ImageStatisticsContainer::Pointer statisticsContainer; |
| 422 | CPPUNIT_ASSERT_NO_THROW(statisticsContainer = ComputeStatistics(m_TestImage, planFigMaskGen.GetPointer())); |
| 423 | auto statisticsObjectTimestep0 = statisticsContainer->GetStatistics(1, 0); |
| 424 | |
| 425 | this->VerifyStatistics(statisticsObjectTimestep0, 191.5, 89.802561210691536, 128.63499999046327); |
| 426 | } |
| 427 | |
| 428 | void mitkImageStatisticsCalculatorTestSuite::TestCase10() |
| 429 | { |
nothing calls this directly
no test coverage detected