22 CPPUNIT_TEST_SUITE( mitkGIFIntensityVolumeHistogramTestSuite);
24 MITK_TEST(ImageDescription_PhantomTest_Large);
25 MITK_TEST(ImageDescription_PhantomTest_Small);
26 MITK_TEST(ImageDescription_PhantomTest_2D);
28 CPPUNIT_TEST_SUITE_END();
38 void setUp(
void)
override 40 m_IBSI_Phantom_Image_Small = mitk::IOUtil::Load<mitk::Image>(
GetTestDataFilePath(
"Radiomics/IBSI_Phantom_Image_Small.nrrd"));
41 m_IBSI_Phantom_Image_Large = mitk::IOUtil::Load<mitk::Image>(
GetTestDataFilePath(
"Radiomics/IBSI_Phantom_Image_Large.nrrd"));
42 m_IBSI_Phantom_Mask_Small = mitk::IOUtil::Load<mitk::Image>(
GetTestDataFilePath(
"Radiomics/IBSI_Phantom_Mask_Small.nrrd"));
43 m_IBSI_Phantom_Mask_Large = mitk::IOUtil::Load<mitk::Image>(
GetTestDataFilePath(
"Radiomics/IBSI_Phantom_Mask_Large.nrrd"));
46 void ImageDescription_PhantomTest_Large()
50 featureCalculator->SetUseBinsize(
true);
51 featureCalculator->SetBinsize(1.0);
52 featureCalculator->SetUseMinimumIntensity(
true);
53 featureCalculator->SetUseMaximumIntensity(
true);
54 featureCalculator->SetMinimumIntensity(0.5);
55 featureCalculator->SetMaximumIntensity(6.5);
57 auto featureList = featureCalculator->CalculateFeatures(m_IBSI_Phantom_Image_Large, m_IBSI_Phantom_Mask_Large);
59 std::map<std::string, double> results;
60 for (
auto valuePair : featureList)
62 MITK_INFO << valuePair.first <<
" : " << valuePair.second;
63 results[valuePair.first] = valuePair.second;
65 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Image Diagnostics should calculate 7 features.", std::size_t(7), featureList.size());
70 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Intensity Volume Histogram::Volume fraction at 0.10 intensity with Large IBSI Phantom Image", 0.3243, results[
"Intensity Volume Histogram::Volume fraction at 0.10 intensity"], 0.001);
71 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Intensity Volume Histogram::Volume fraction at 0.90 intensity with Large IBSI Phantom Image", 0.09459, results[
"Intensity Volume Histogram::Volume fraction at 0.90 intensity"], 0.001);
72 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Intensity Volume Histogram::Intensity at 0.10 volume with Large IBSI Phantom Image", 5, results[
"Intensity Volume Histogram::Intensity at 0.10 volume"], 0.001);
73 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Intensity Volume Histogram::Intensity at 0.90 volume with Large IBSI Phantom Image", 2, results[
"Intensity Volume Histogram::Intensity at 0.90 volume"], 0.001);
74 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Intensity Volume Histogram::Difference volume fraction at 0.10 and 0.90 intensity with Large IBSI Phantom Image", 0.22973, results[
"Intensity Volume Histogram::Difference volume fraction at 0.10 and 0.90 intensity"], 0.001);
75 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Intensity Volume Histogram::Difference intensity at 0.10 and 0.90 volume with Large IBSI Phantom Image", 3, results[
"Intensity Volume Histogram::Difference intensity at 0.10 and 0.90 volume"], 0.001);
76 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Intensity Volume Histogram::Area under IVH curve with Large IBSI Phantom Image", 0.32027, results[
"Intensity Volume Histogram::Area under IVH curve"], 0.001);
79 void ImageDescription_PhantomTest_Small()
83 featureCalculator->SetUseBinsize(
true);
84 featureCalculator->SetBinsize(1.0);
85 featureCalculator->SetUseMinimumIntensity(
true);
86 featureCalculator->SetUseMaximumIntensity(
true);
87 featureCalculator->SetMinimumIntensity(0.5);
88 featureCalculator->SetMaximumIntensity(6.5);
90 auto featureList = featureCalculator->CalculateFeatures(m_IBSI_Phantom_Image_Small, m_IBSI_Phantom_Mask_Small);
92 std::map<std::string, double> results;
93 for (
auto valuePair : featureList)
95 MITK_INFO << valuePair.first <<
" : " << valuePair.second;
96 results[valuePair.first] = valuePair.second;
98 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Image Diagnostics should calculate 7 features.", std::size_t(7), featureList.size());
103 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Intensity Volume Histogram::Volume fraction at 0.10 intensity with Large IBSI Phantom Image", 0.3243, results[
"Intensity Volume Histogram::Volume fraction at 0.10 intensity"], 0.001);
104 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Intensity Volume Histogram::Volume fraction at 0.90 intensity with Large IBSI Phantom Image", 0.09459, results[
"Intensity Volume Histogram::Volume fraction at 0.90 intensity"], 0.001);
105 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Intensity Volume Histogram::Intensity at 0.10 volume with Large IBSI Phantom Image", 5, results[
"Intensity Volume Histogram::Intensity at 0.10 volume"], 0.001);
106 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Intensity Volume Histogram::Intensity at 0.90 volume with Large IBSI Phantom Image", 2, results[
"Intensity Volume Histogram::Intensity at 0.90 volume"], 0.001);
107 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Intensity Volume Histogram::Difference volume fraction at 0.10 and 0.90 intensity with Large IBSI Phantom Image", 0.22973, results[
"Intensity Volume Histogram::Difference volume fraction at 0.10 and 0.90 intensity"], 0.001);
108 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Intensity Volume Histogram::Difference intensity at 0.10 and 0.90 volume with Large IBSI Phantom Image", 3, results[
"Intensity Volume Histogram::Difference intensity at 0.10 and 0.90 volume"], 0.001);
109 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Intensity Volume Histogram::Area under IVH curve with Large IBSI Phantom Image", 0.32027, results[
"Intensity Volume Histogram::Area under IVH curve"], 0.001);
112 void ImageDescription_PhantomTest_2D()
116 featureCalculator->SetUseBinsize(
true);
117 featureCalculator->SetBinsize(1.0);
118 featureCalculator->SetUseMinimumIntensity(
true);
119 featureCalculator->SetUseMaximumIntensity(
true);
120 featureCalculator->SetMinimumIntensity(0.5);
121 featureCalculator->SetMaximumIntensity(6.5);
123 auto featureList = featureCalculator->CalculateFeaturesSlicewise(m_IBSI_Phantom_Image_Large, m_IBSI_Phantom_Mask_Large, 2);
125 std::map<std::string, double> results;
126 for (
auto valuePair : featureList)
128 MITK_INFO << valuePair.first <<
" : " << valuePair.second;
129 results[valuePair.first] = valuePair.second;
131 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Image Diagnostics should calculate 42 features.", std::size_t(42), featureList.size());
136 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Intensity Volume Histogram::Volume fraction at 0.10 intensity with Large IBSI Phantom Image", 0.31539, results[
"SliceWise Mean Intensity Volume Histogram::Volume fraction at 0.10 intensity"], 0.001);
137 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Intensity Volume Histogram::Volume fraction at 0.90 intensity with Large IBSI Phantom Image", 0.0924106, results[
"SliceWise Mean Intensity Volume Histogram::Volume fraction at 0.90 intensity"], 0.001);
138 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Intensity Volume Histogram::Intensity at 0.10 volume with Large IBSI Phantom Image", 6, results[
"SliceWise Mean Intensity Volume Histogram::Intensity at 0.10 volume"], 0.001);
139 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Intensity Volume Histogram::Intensity at 0.90 volume with Large IBSI Phantom Image", 2, results[
"SliceWise Mean Intensity Volume Histogram::Intensity at 0.90 volume"], 0.001);
140 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Intensity Volume Histogram::Difference volume fraction at 0.10 and 0.90 intensity with Large IBSI Phantom Image", 0.222979, results[
"SliceWise Mean Intensity Volume Histogram::Difference volume fraction at 0.10 and 0.90 intensity"], 0.001);
141 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Intensity Volume Histogram::Difference intensity at 0.10 and 0.90 volume with Large IBSI Phantom Image", 4, results[
"SliceWise Mean Intensity Volume Histogram::Difference intensity at 0.10 and 0.90 volume"], 0.001);
142 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Mean Intensity Volume Histogram::Area under IVH curve with Large IBSI Phantom Image", 0.314325, results[
"SliceWise Mean Intensity Volume Histogram::Area under IVH curve"], 0.001);
144 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Var. Intensity Volume Histogram::Volume fraction at 0.10 intensity with Large IBSI Phantom Image", 0.0248178, results[
"SliceWise Var. Intensity Volume Histogram::Volume fraction at 0.10 intensity"], 0.001);
145 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Var. Intensity Volume Histogram::Volume fraction at 0.90 intensity with Large IBSI Phantom Image", 0.00149203, results[
"SliceWise Var. Intensity Volume Histogram::Volume fraction at 0.90 intensity"], 0.001);
146 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Var. Intensity Volume Histogram::Intensity at 0.10 volume with Large IBSI Phantom Image", 1, results[
"SliceWise Var. Intensity Volume Histogram::Intensity at 0.10 volume"], 0.001);
147 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Var. Intensity Volume Histogram::Intensity at 0.90 volume with Large IBSI Phantom Image", 0, results[
"SliceWise Var. Intensity Volume Histogram::Intensity at 0.90 volume"], 0.001);
148 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Var. Intensity Volume Histogram::Difference volume fraction at 0.10 and 0.90 intensity with Large IBSI Phantom Image", 0.01414, results[
"SliceWise Var. Intensity Volume Histogram::Difference volume fraction at 0.10 and 0.90 intensity"], 0.001);
149 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Var. Intensity Volume Histogram::Difference intensity at 0.10 and 0.90 volume with Large IBSI Phantom Image", 1, results[
"SliceWise Var. Intensity Volume Histogram::Difference intensity at 0.10 and 0.90 volume"], 0.001);
150 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"SliceWise Var. Intensity Volume Histogram::Area under IVH curve with Large IBSI Phantom Image", 0.0110923, results[
"SliceWise Var. Intensity Volume Histogram::Area under IVH curve"], 0.001);
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.