22 CPPUNIT_TEST_SUITE(mitkGIFGreyLevelDistanceZoneTestSuite );
24 MITK_TEST(ImageDescription_PhantomTest_3D);
25 MITK_TEST(ImageDescription_PhantomTest_2D);
27 CPPUNIT_TEST_SUITE_END();
37 void setUp(
void)
override 39 m_IBSI_Phantom_Image_Small = mitk::IOUtil::Load<mitk::Image>(
GetTestDataFilePath(
"Radiomics/IBSI_Phantom_Image_Small.nrrd"));
40 m_IBSI_Phantom_Image_Large = mitk::IOUtil::Load<mitk::Image>(
GetTestDataFilePath(
"Radiomics/IBSI_Phantom_Image_Large.nrrd"));
41 m_IBSI_Phantom_Mask_Small = mitk::IOUtil::Load<mitk::Image>(
GetTestDataFilePath(
"Radiomics/IBSI_Phantom_Mask_Small.nrrd"));
42 m_IBSI_Phantom_Mask_Large = mitk::IOUtil::Load<mitk::Image>(
GetTestDataFilePath(
"Radiomics/IBSI_Phantom_Mask_Large.nrrd"));
45 void ImageDescription_PhantomTest_3D()
49 featureCalculator->SetUseBinsize(
true);
50 featureCalculator->SetBinsize(1.0);
51 featureCalculator->SetUseMinimumIntensity(
true);
52 featureCalculator->SetUseMaximumIntensity(
true);
53 featureCalculator->SetMinimumIntensity(0.5);
54 featureCalculator->SetMaximumIntensity(6.5);
56 auto featureList = featureCalculator->CalculateFeatures(m_IBSI_Phantom_Image_Large, m_IBSI_Phantom_Mask_Large);
58 std::map<std::string, double> results;
59 for (
auto valuePair : featureList)
61 MITK_INFO << valuePair.first <<
" : " << valuePair.second;
62 results[valuePair.first] = valuePair.second;
64 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Image Diagnostics should calculate 19 features.", std::size_t(19), featureList.size());
68 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Small Distance Emphasis with Large IBSI Phantom Image", 1, results[
"Grey Level Distance Zone::Small Distance Emphasis"], 0.001);
69 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Large Distance Emphasis with Large IBSI Phantom Image", 1, results[
"Grey Level Distance Zone::Large Distance Emphasis"], 0.001);
70 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Low Grey Level Emphasis with Large IBSI Phantom Image", 0.253, results[
"Grey Level Distance Zone::Low Grey Level Emphasis"], 0.001);
71 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::High Grey Level Emphasis with Large IBSI Phantom Image", 15.6, results[
"Grey Level Distance Zone::High Grey Level Emphasis"], 0.001);
72 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Small Distance Low Grey Level Emphasis with Large IBSI Phantom Image", 0.253, results[
"Grey Level Distance Zone::Small Distance Low Grey Level Emphasis"], 0.001);
73 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Small Distance High Grey Level Emphasis with Large IBSI Phantom Image", 15.6, results[
"Grey Level Distance Zone::Small Distance High Grey Level Emphasis"], 0.001);
74 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Large Distance Low Grey Level Emphasis with Large IBSI Phantom Image", 0.253, results[
"Grey Level Distance Zone::Large Distance Low Grey Level Emphasis"], 0.001);
75 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Large Distance High Grey Level Emphasis with Large IBSI Phantom Image", 15.6, results[
"Grey Level Distance Zone::Large Distance High Grey Level Emphasis"], 0.001);
76 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Grey Level Non-Uniformity with Large IBSI Phantom Image", 1.4, results[
"Grey Level Distance Zone::Grey Level Non-Uniformity"], 0.001);
77 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Grey Level Non-Uniformity Normalized with Large IBSI Phantom Image", 0.28, results[
"Grey Level Distance Zone::Grey Level Non-Uniformity Normalized"], 0.001);
78 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Distance Size Non-Uniformity with Large IBSI Phantom Image", 5, results[
"Grey Level Distance Zone::Distance Size Non-Uniformity"], 0.001);
79 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Distance Size Non-Uniformity Normalized with Large IBSI Phantom Image", 1, results[
"Grey Level Distance Zone::Distance Size Non-Uniformity Normalized"], 0.001);
80 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Zone Percentage with Large IBSI Phantom Image", 0.0676, results[
"Grey Level Distance Zone::Zone Percentage"], 0.001);
81 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Grey Level Variance with Large IBSI Phantom Image", 2.64, results[
"Grey Level Distance Zone::Grey Level Variance"], 0.001);
82 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Zone Distance Variance with Large IBSI Phantom Image", 0, results[
"Grey Level Distance Zone::Zone Distance Variance"], 0.001);
83 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Zone Distance Entropy with Large IBSI Phantom Image", 1.92, results[
"Grey Level Distance Zone::Zone Distance Entropy"], 0.01);
88 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Grey Level Mean with Large IBSI Phantom Image", 3.6, results[
"Grey Level Distance Zone::Grey Level Mean"], 0.001);
89 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Zone Distance Mean with Large IBSI Phantom Image", 1, results[
"Grey Level Distance Zone::Zone Distance Mean"], 0.001);
90 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Grey Level Distance Zone::Grey Level Entropy with Large IBSI Phantom Image", 1.92, results[
"Grey Level Distance Zone::Grey Level Entropy"], 0.01);
93 void ImageDescription_PhantomTest_2D()
97 featureCalculator->SetUseBinsize(
true);
98 featureCalculator->SetBinsize(1.0);
99 featureCalculator->SetUseMinimumIntensity(
true);
100 featureCalculator->SetUseMaximumIntensity(
true);
101 featureCalculator->SetMinimumIntensity(0.5);
102 featureCalculator->SetMaximumIntensity(6.5);
104 auto featureList = featureCalculator->CalculateFeaturesSlicewise(m_IBSI_Phantom_Image_Large, m_IBSI_Phantom_Mask_Large, 2);
106 std::map<std::string, double> results;
107 for (
auto valuePair : featureList)
109 MITK_INFO << valuePair.first <<
" : " << valuePair.second;
110 results[valuePair.first] = valuePair.second;
112 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Image Diagnostics should calculate 114 features.", std::size_t(114), featureList.size());
116 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Small Distance Emphasis with Large IBSI Phantom Image", 0.946, results[
"SliceWise Mean Grey Level Distance Zone::Small Distance Emphasis"], 0.001);
117 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Large Distance Emphasis with Large IBSI Phantom Image", 1.21, results[
"SliceWise Mean Grey Level Distance Zone::Large Distance Emphasis"], 0.01);
118 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Low Grey Level Emphasis with Large IBSI Phantom Image", 0.371, results[
"SliceWise Mean Grey Level Distance Zone::Low Grey Level Emphasis"], 0.001);
119 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::High Grey Level Emphasis with Large IBSI Phantom Image", 16.4, results[
"SliceWise Mean Grey Level Distance Zone::High Grey Level Emphasis"], 0.1);
120 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Small Distance Low Grey Level Emphasis with Large IBSI Phantom Image", 0.367, results[
"SliceWise Mean Grey Level Distance Zone::Small Distance Low Grey Level Emphasis"], 0.001);
121 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Small Distance High Grey Level Emphasis with Large IBSI Phantom Image", 15.2, results[
"SliceWise Mean Grey Level Distance Zone::Small Distance High Grey Level Emphasis"], 0.1);
122 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Large Distance Low Grey Level Emphasis with Large IBSI Phantom Image", 0.386, results[
"SliceWise Mean Grey Level Distance Zone::Large Distance Low Grey Level Emphasis"], 0.001);
123 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Large Distance High Grey Level Emphasis with Large IBSI Phantom Image", 21.3, results[
"SliceWise Mean Grey Level Distance Zone::Large Distance High Grey Level Emphasis"], 0.1);
124 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Grey Level Non-Uniformity with Large IBSI Phantom Image", 1.41, results[
"SliceWise Mean Grey Level Distance Zone::Grey Level Non-Uniformity"], 0.01);
125 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Grey Level Non-Uniformity Normalized with Large IBSI Phantom Image", 0.323, results[
"SliceWise Mean Grey Level Distance Zone::Grey Level Non-Uniformity Normalized"], 0.001);
126 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Distance Size Non-Uniformity with Large IBSI Phantom Image", 3.79, results[
"SliceWise Mean Grey Level Distance Zone::Distance Size Non-Uniformity"], 0.01);
127 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Distance Size Non-Uniformity Normalized with Large IBSI Phantom Image", 0.898, results[
"SliceWise Mean Grey Level Distance Zone::Distance Size Non-Uniformity Normalized"], 0.001);
128 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Zone Percentage with Large IBSI Phantom Image", 0.24, results[
"SliceWise Mean Grey Level Distance Zone::Zone Percentage"], 0.01);
129 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Grey Level Variance with Large IBSI Phantom Image", 3.97, results[
"SliceWise Mean Grey Level Distance Zone::Grey Level Variance"], 0.01);
130 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Zone Distance Variance with Large IBSI Phantom Image", 0.051, results[
"SliceWise Mean Grey Level Distance Zone::Zone Distance Variance"], 0.001);
131 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Zone Distance Entropy with Large IBSI Phantom Image", 1.73, results[
"SliceWise Mean Grey Level Distance Zone::Zone Distance Entropy"], 0.01);
136 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Grey Level Mean with Large IBSI Phantom Image", 3.526, results[
"SliceWise Mean Grey Level Distance Zone::Grey Level Mean"], 0.001);
137 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Zone Distance Mean with Large IBSI Phantom Image", 1.071, results[
"SliceWise Mean Grey Level Distance Zone::Zone Distance Mean"], 0.001);
138 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Grey Level Distance Zone::Grey Level Entropy with Large IBSI Phantom Image", 1.732, results[
"SliceWise Mean Grey Level Distance Zone::Grey Level Entropy"], 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.