22 CPPUNIT_TEST_SUITE(mitkGIFVolumetricStatisticsTestSuite);
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 auto featureList = featureCalculator->CalculateFeatures(m_IBSI_Phantom_Image_Large, m_IBSI_Phantom_Mask_Large);
50 std::map<std::string, double> results;
51 for (
auto valuePair : featureList)
53 MITK_INFO << valuePair.first <<
" : " << valuePair.second;
54 results[valuePair.first] = valuePair.second;
56 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Volume Statistic should calculate 33 features.", std::size_t(38), featureList.size());
60 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Volume (mesh based) with Large IBSI Phantom Image", 556, results[
"Volumetric Features::Volume (mesh based)"], 1.0);
61 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Volume (voxel based) with Large IBSI Phantom Image", 592, results[
"Volumetric Features::Volume (voxel based)"], 1.0);
62 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Surface (mesh based) with Large IBSI Phantom Image", 388, results[
"Volumetric Features::Surface (mesh based)"], 1.0);
63 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Surface to volume ratio (mesh based) with Large IBSI Phantom Image", 0.698, results[
"Volumetric Features::Surface to volume ratio (mesh based)"], 0.01);
64 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Compactness 1 (mesh, mesh based) with Large IBSI Phantom Image", 0.04105, results[
"Volumetric Features::Compactness 1 (mesh, mesh based)"], 0.01);
65 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Compactness 2 (mesh, mesh based) with Large IBSI Phantom Image", 0.599, results[
"Volumetric Features::Compactness 2 (mesh, mesh based)"], 0.01);
66 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Spherical disproportion (mesh, mesh based) with Large IBSI Phantom Image", 1.18, results[
"Volumetric Features::Spherical disproportion (mesh, mesh based)"], 0.01);
67 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Sphericity (mesh, mesh based) with Large IBSI Phantom Image", 0.843, results[
"Volumetric Features::Sphericity (mesh, mesh based)"], 0.01);
68 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Asphericity (mesh based) with Large IBSI Phantom Image", 0.186, results[
"Volumetric Features::Asphericity (mesh, mesh based)"], 0.01);
69 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Centre of mass shift with Large IBSI Phantom Image", 0.672, results[
"Volumetric Features::Centre of mass shift"], 0.01);
70 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Maximum 3D diameter with Large IBSI Phantom Image", 11.66, results[
"Volumetric Features::Maximum 3D diameter"], 0.01);
71 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::PCA Major axis length with Large IBSI Phantom Image", 11.40, results[
"Volumetric Features::PCA Major axis length"], 0.01);
72 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::PCA Minor axis length with Large IBSI Phantom Image", 9.31, results[
"Volumetric Features::PCA Minor axis length"], 0.01);
73 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::PCA Least axis length with Large IBSI Phantom Image", 8.54, results[
"Volumetric Features::PCA Least axis length"], 0.01);
74 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::PCA Elongation with Large IBSI Phantom Image", 0.816, results[
"Volumetric Features::PCA Elongation"], 0.01);
75 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::PCA Flatness with Large IBSI Phantom Image", 0.749, results[
"Volumetric Features::PCA Flatness"], 0.01);
79 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Voxel Volume with Large IBSI Phantom Image", 8, results[
"Volumetric Features::Voxel Volume"], 0.01);
80 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Volume (voxel based) with Large IBSI Phantom Image", 592, results[
"Volumetric Features::Volume (voxel based)"], 0.1);
81 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Surface (voxel based) with Large IBSI Phantom Image", 488, results[
"Volumetric Features::Surface (voxel based)"], 1.0);
82 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Centre of mass shift (uncorrected) with Large IBSI Phantom Image", 0.672, results[
"Volumetric Features::Centre of mass shift (uncorrected)"], 0.01);
83 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Bounding Box Volume with Large IBSI Phantom Image", 288, results[
"Volumetric Features::Bounding Box Volume"], 1.0);
84 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Surface to volume ratio (voxel based) with Large IBSI Phantom Image", 0.824, results[
"Volumetric Features::Surface to volume ratio (voxel based)"], 0.01);
85 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Sphericity (voxel based) with Large IBSI Phantom Image", 0.699, results[
"Volumetric Features::Sphericity (voxel based)"], 0.01);
86 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Asphericity (voxel based) with Large IBSI Phantom Image", 0.431, results[
"Volumetric Features::Asphericity (voxel based)"], 0.01);
87 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Sphericity (mesh based) with Large IBSI Phantom Image", 0.879, results[
"Volumetric Features::Sphericity (mesh based)"], 0.01);
88 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Asphericity (mesh based) with Large IBSI Phantom Image", 0.138, results[
"Volumetric Features::Asphericity (mesh based)"], 0.01);
89 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Asphericity (mesh based) with Large IBSI Phantom Image", 0.138, results[
"Volumetric Features::Asphericity (mesh based)"], 0.01);
90 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Compactness 1 (voxel based) with Large IBSI Phantom Image", 0.031, results[
"Volumetric Features::Compactness 1 (voxel based)"], 0.01);
91 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Compactness 1 old (voxel based) with Large IBSI Phantom Image", 5.388, results[
"Volumetric Features::Compactness 1 old (voxel based)"], 0.01);
92 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Compactness 2 (voxel based) with Large IBSI Phantom Image", 0.341, results[
"Volumetric Features::Compactness 2 (voxel based)"], 0.01);
93 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Compactness 1 (mesh based) with Large IBSI Phantom Image", 0.0437, results[
"Volumetric Features::Compactness 1 (mesh based)"], 0.01);
94 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Compactness 2 (mesh based) with Large IBSI Phantom Image", 0.678, results[
"Volumetric Features::Compactness 2 (mesh based)"], 0.01);
95 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Spherical disproportion (voxel based) with Large IBSI Phantom Image", 1.43, results[
"Volumetric Features::Spherical disproportion (voxel based)"], 0.01);
96 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::PCA Major axis length (uncorrected) with Large IBSI Phantom Image", 11.40, results[
"Volumetric Features::PCA Major axis length (uncorrected)"], 0.01);
97 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::PCA Minor axis length (uncorrected) with Large IBSI Phantom Image", 9.31, results[
"Volumetric Features::PCA Minor axis length (uncorrected)"], 0.01);
98 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::PCA Least axis length (uncorrected) with Large IBSI Phantom Image", 8.54, results[
"Volumetric Features::PCA Least axis length (uncorrected)"], 0.01);
99 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::PCA Elongation (uncorrected) with Large IBSI Phantom Image", 0.816, results[
"Volumetric Features::PCA Elongation (uncorrected)"], 0.01);
100 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::PCA Flatness (uncorrected) with Large IBSI Phantom Image", 0.749, results[
"Volumetric Features::PCA Flatness (uncorrected)"], 0.01);
101 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"Volumetric Features::Compactness 1 old (mesh based) with Large IBSI Phantom Image", 6.278, results[
"Volumetric Features::Compactness 1 old (mesh based)"], 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.