| 187 | } |
| 188 | |
| 189 | void mitkImageStatisticsCalculatorTestSuite::TestCase2() |
| 190 | { |
| 191 | /***************************** |
| 192 | * half pixel in x-direction (white) |
| 193 | * -> mean of 255 expected |
| 194 | ******************************/ |
| 195 | MITK_INFO << std::endl << "Test case 2:-----------------------------------------------------------------------------------"; |
| 196 | |
| 197 | std::string filename = this->GetTestDataFilePath("ImageStatisticsTestData/testimage.nrrd"); |
| 198 | m_TestImage = mitk::IOUtil::Load<mitk::Image>(filename); |
| 199 | m_Geometry = m_TestImage->GetSlicedGeometry()->GetPlaneGeometry(0); |
| 200 | |
| 201 | mitk::Point2D pnt1; pnt1[0] = 10.0; pnt1[1] = 3.5; |
| 202 | mitk::Point2D pnt2; pnt2[0] = 9.5; pnt2[1] = 3.5; |
| 203 | mitk::Point2D pnt3; pnt3[0] = 9.5; pnt3[1] = 4.5; |
| 204 | mitk::Point2D pnt4; pnt4[0] = 10.0; pnt4[1] = 4.5; |
| 205 | std::vector<mitk::Point2D> points{ pnt1,pnt2,pnt3,pnt4 }; |
| 206 | auto figure = GeneratePlanarPolygon(m_Geometry, points); |
| 207 | |
| 208 | mitk::PlanarFigureMaskGenerator::Pointer planFigMaskGen = mitk::PlanarFigureMaskGenerator::New(); |
| 209 | planFigMaskGen->SetInputImage(m_TestImage); |
| 210 | planFigMaskGen->SetPlanarFigure(figure.GetPointer()); |
| 211 | |
| 212 | mitk::ImageStatisticsContainer::Pointer statisticsContainer; |
| 213 | CPPUNIT_ASSERT_NO_THROW(statisticsContainer = ComputeStatistics(m_TestImage, planFigMaskGen.GetPointer())); |
| 214 | auto statisticsObjectTimestep0 = statisticsContainer->GetStatistics(1,0); |
| 215 | |
| 216 | this->VerifyStatistics(statisticsObjectTimestep0, 255.0, 0.0, 255.0); |
| 217 | } |
| 218 | |
| 219 | void mitkImageStatisticsCalculatorTestSuite::TestCase3() |
| 220 | { |
nothing calls this directly
no test coverage detected