22 CPPUNIT_TEST_SUITE(mitkGIFVolumetricDensityStatisticsTestSuite);
26 CPPUNIT_TEST_SUITE_END();
36 void setUp(
void)
override 38 m_IBSI_Phantom_Image_Small = mitk::IOUtil::Load<mitk::Image>(
GetTestDataFilePath(
"Radiomics/IBSI_Phantom_Image_Small.nrrd"));
39 m_IBSI_Phantom_Image_Large = mitk::IOUtil::Load<mitk::Image>(
GetTestDataFilePath(
"Radiomics/IBSI_Phantom_Image_Large.nrrd"));
40 m_IBSI_Phantom_Mask_Small = mitk::IOUtil::Load<mitk::Image>(
GetTestDataFilePath(
"Radiomics/IBSI_Phantom_Mask_Small.nrrd"));
41 m_IBSI_Phantom_Mask_Large = mitk::IOUtil::Load<mitk::Image>(
GetTestDataFilePath(
"Radiomics/IBSI_Phantom_Mask_Large.nrrd"));
44 void ImageDescription_PhantomTest()
48 featureCalculator->SetUseBinsize(
true);
49 featureCalculator->SetBinsize(1.0);
50 featureCalculator->SetUseMinimumIntensity(
true);
51 featureCalculator->SetUseMaximumIntensity(
true);
52 featureCalculator->SetMinimumIntensity(0.5);
53 featureCalculator->SetMaximumIntensity(6.5);
55 auto featureList = featureCalculator->CalculateFeatures(m_IBSI_Phantom_Image_Large, m_IBSI_Phantom_Mask_Large);
57 std::map<std::string, double> results;
58 for (
auto valuePair : featureList)
60 MITK_INFO << valuePair.first <<
" : " << valuePair.second;
61 results[valuePair.first] = valuePair.second;
63 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Image Diagnostics should calculate 13 features.", std::size_t(13), featureList.size());
70 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Morphological Density::Volume integrated intensity with Large IBSI Phantom Image", 1195, results[
"Morphological Density::Volume integrated intensity"], 1.0);
71 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Morphological Density::Volume Moran's I index with Large IBSI Phantom Image", 0.0397, results[
"Morphological Density::Volume Moran's I index"], 0.0001);
72 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Morphological Density::Volume Geary's C measure with Large IBSI Phantom Image", 0.974, results[
"Morphological Density::Volume Geary's C measure"], 0.001);
73 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Morphological Density::Volume Volume density axis-aligned bounding box with Large IBSI Phantom Image", 0.87, results[
"Morphological Density::Volume density axis-aligned bounding box"], 0.01);
74 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Morphological Density::Surface Volume density axis-aligned bounding box with Large IBSI Phantom Image", 0.87, results[
"Morphological Density::Surface density axis-aligned bounding box"], 0.01);
75 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Morphological Density::Volume Volume oriented minimum bounding box with Large IBSI Phantom Image", 0.87, results[
"Morphological Density::Volume density oriented minimum bounding box"], 0.01);
76 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Morphological Density::Surface Volume oriented minimum bounding box with Large IBSI Phantom Image", 0.86, results[
"Morphological Density::Surface density oriented minimum bounding box"], 0.01);
78 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Morphological Density::Volume Volume approx. enclosing ellipsoid with Large IBSI Phantom Image", 1.17, results[
"Morphological Density::Volume density approx. enclosing ellipsoid"], 0.01);
79 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Morphological Density::Surface Volume approx. enclosing ellipsoid with Large IBSI Phantom Image", 1.34, results[
"Morphological Density::Surface density approx. enclosing ellipsoid"], 0.01);
80 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Morphological Density::Volume Volume minimum volume enclosing ellipsoid with Large IBSI Phantom Image", 0.24, results[
"Morphological Density::Volume density approx. minimum volume enclosing ellipsoid"], 0.01);
81 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Morphological Density::Surface Volume minimum volume enclosing ellipsoid with Large IBSI Phantom Image", 0.49, results[
"Morphological Density::Surface density approx. minimum volume enclosing ellipsoid"], 0.01);
82 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Morphological Density::Volume Volume convex hull with Large IBSI Phantom Image", 0.96, results[
"Morphological Density::Volume density convex hull"], 0.01);
83 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Morphological Density::Surface Volume convex hull with Large IBSI Phantom Image", 1.03, results[
"Morphological Density::Surface density convex hull"], 0.01);
MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
static std::string GetTestDataFilePath(const std::string &testData)
Get the absolute path for test data.
Test fixture for parameterized tests.