Repository: PolusAI/nyxus (language: python)

Issue:
added header to fix build issue.
added cstdint header


Discussion / hints:

Fix patch:
diff --git a/src/nyx/features/gldzm.cpp b/src/nyx/features/gldzm.cpp
index 2956e015..efc524b7 100644
--- a/src/nyx/features/gldzm.cpp
+++ b/src/nyx/features/gldzm.cpp
@@ -1,4 +1,5 @@
 #include <limits.h>
+#include <stack>
 #include "gldzm.h"
 #include "../environment.h"
 
@@ -11,8 +12,8 @@ void GLDZMFeature::clear_buffers()
 {
 	f_SDE =
 		f_LDE =
-		f_LGLE =
-		f_HGLE =
+		f_LGLZE =
+		f_HGLZE =
 		f_SDLGLE =
 		f_SDHGLE =
 		f_LDLGLE =
@@ -30,19 +31,27 @@ void GLDZMFeature::clear_buffers()
 		f_GLE = 0;
 }
 
-void GLDZMFeature::calculate (LR& r)
+void GLDZMFeature::calc_gldzm_matrix (SimpleMatrix<unsigned int> & GLDZM, const std::vector<IDZ_cluster_indo> & Z, const std::vector<PixIntens> & I)
 {
-	clear_buffers();
-
-	//==== Check if the ROI is degenerate (equal intensity)
-	if (r.aux_min == r.aux_max)
-		return;
+	int i = 0;
+	for (auto& z : Z)
+	{
+		// row. Gray tones are sparse so we need to find indices of tones in 'Z' and use them as rows of P-matrix
+		auto iter = std::find (I.begin(), I.end(), std::get<0>(z));
+		int row = (int)(iter - I.begin());
+		// column (a distance). Distances are dense \in [1,Nd]
+		int col = std::get<1>(z) - 1;	// 0-based => -1
+		auto& k = GLDZM.yx(row, col);
+		k++;
+	}
+}
 
+void GLDZMFeature::prepare_GLDZM_matrix_kit (SimpleMatrix<unsigned int>& GLDZM, int& Ng, int& Nd, LR& r)
+{
 	//==== Compose the distance matrix
 
 	// -- Zones (intensity clusters)
-	using ACluster = std::pair<PixIntens, int>;	// <zone intensity, zone distance>
-	std::vector<ACluster> Z;
+	std::vector<IDZ_cluster_indo> Z;
 
 	// -- Unique intensities 
 	std::unordered_set<PixIntens> U;
@@ -64,7 +73,7 @@ void GLDZMFeature::calculate (LR& r)
 		if (Ir == 0)
 			continue;
 		// binned intensity
-		unsigned int Ib = Nyxus::to_grayscale (Ir, 0, piRange, nGrays, Environment::ibsi_compliance);
+		unsigned int Ib = Nyxus::to_grayscale(Ir, 0, piRange, nGrays, Environment::ibsi_compliance);
 		D[i] = Ib;
 		// update the set of unique intensities
 		U.insert(Ib);
@@ -81,113 +90,178 @@ void GLDZMFeature::calculate (LR& r)
 			if (inten == 0 || int(inten) == VISITED)
 				continue;
 
-			// Found a gray pixel. Find same-intensity neighbourhood of it.
-			std::vector<std::tuple<int, int>> history;
+			// Once found a nonblank pixel, explore its same-intensity neighbourhood (aka "zone") pixel's distance 
+			// to the image border and figure out the whole zone's metric - minimum member pixel's distance to the border.
+			std::stack<std::tuple<int, int>> parentstack;
 
-			int x = col, 
+			int x = col,
 				y = row;
-			int zoneSize = 1;	// '1' because we already have a pixel. Hopefully it's a part of a zone
-			D.yx(y, x) = VISITED;
 
-			// Keep track of this pixel, hopefully 1st pixel of the cluster
-			history.push_back ({x,y});
-			int zoneMetric = dist2border <pixData> (D, x, y); //dist2closestRoiBorder (D, x, y);
+			// Initial zone size
+			int zoneSize = 1;	// once found a never-visited pixel, we already have a 1-pixel zone
+
+			// Prepare an initial approximation of zone's distance to border
+			int zoneMetric = dist2border <pixData> (D, x, y); 
 
 			// Scan the neighborhood of pixel (x,y)
 			for (;;)
 			{
-				// East
-				int _x = x + 1,
+				//==== Calculate the metric of this pixel. It may happen to be the only pixel of a zone
+				
+				// Prevent rescanning: mark eroded pixels with 'VISITED'. (The goal is to erode the whole zone.)
+				D.yx (y,x) = VISITED;
+
+				//==== Check if zone continues to the East
+				int _x = x+1, 
 					_y = y;
 				if (D.safe(_y,_x) && D.yx(_y,_x) != VISITED && D.yx(_y,_x) == inten)
 				{
-					D.yx(y, x + 1) = VISITED;
+
+					// Store pixel (x+1,y)'s parent pixel pisition
+					parentstack.push ({x,y});
 
 					// Update zone's metric
-					int dist2roi = dist2border <pixData> (D, _x, _y); //dist2closestRoiBorder (D, _x, _y);
-					zoneMetric = std::min (zoneMetric, dist2roi);
+					int dist2roi = dist2border <pixData>(D, _x, _y);
+					zoneMetric = std::min(zoneMetric, dist2roi);
 
 					// Update zone size
 					zoneSize++;
 
-					// Remember this pixel
-					history.push_back ({_x,_y});
-					// Advance
-					x = x + 1;
-					// Proceed
+					// Make the new neighborhood pixel current parent
+					x = _x;
 					continue;
 				}
 
-				// South
+				//==== Check if zone continues to the South
 				_x = x;
-				_y = y + 1;
-				if (D.safe(_y,_x) && D.yx(_y,_x) != VISITED && D.yx(_y,_x) == inten)
+				_y = y+1;
+				if (D.safe(_y, _x) && D.yx(_y, _x) != VISITED && D.yx(_y, _x) == inten)
 				{
-					D.yx(_y,_x) = VISITED;
+
+					// Store pixel (x,y+1)'s parent pixel pisition
+					parentstack.push ({x,y});	
 
 					// Update zone's metric
-					int dist2roi = dist2border <pixData> (D, _x, _y); //dist2closestRoiBorder(D, _x, _y);
+					int dist2roi = dist2border <pixData>(D, _x, _y);
 					zoneMetric = std::min(zoneMetric, dist2roi);
 
 					// Update zone size
 					zoneSize++;
 
-					history.push_back ({_x,_y});
-					y = y + 1;
+					// Make the new neighborhood pixel current parent
+					y = _y;
 					continue;
 				}
 
-				// We are done exploring this cluster
-				break;
-			}
+				//==== Check if zone continues to the West
+				_x = x-1;
+				_y = y;
+				if (D.safe(_y, _x) && D.yx(_y, _x) != VISITED && D.yx(_y, _x) == inten)
+				{
 
-			// Done scanning a cluster. Perform 3 actions:
-			// --1
-			U.insert(inten);
+					// Store pixel (x-1,y)'s parent pixel pisition
+					parentstack.push ({x,y});	
 
-			// --2 Create a zone
-			ACluster clu = { inten, zoneMetric};
-			Z.push_back(clu);
+					// Update zone's metric
+					int dist2roi = dist2border <pixData>(D, _x, _y);
+					zoneMetric = std::min(zoneMetric, dist2roi);
+
+					// Update zone size
+					zoneSize++;
+
+					// Make the new neighborhood pixel current parent
+					x = _x;
+					continue;
+				}
+
+				//==== Check if zone continues to the North
+				_x = x;
+				_y = y-1;
+				if (D.safe(_y, _x) && D.yx(_y, _x) != VISITED && D.yx(_y, _x) == inten)
+				{
+
+					// Store pixel (x,y-1)'s parent pixel pisition
+					parentstack.push ({x,y});	
+
+					// Update zone's metric
+					int dist2roi = dist2border <pixData> (D, _x, _y);
+					zoneMetric = std::min (zoneMetric, dist2roi);
+
+					// Update zone size
+					zoneSize++;
+
+					// Make the new neighborhood pixel current parent
+					y = _y;
+					continue;
+				}
+
+				// We are done exploring pixel's potential neighborhood. There might happen a zone or not (just this pixel)
+				if (parentstack.empty() == false)
+				{
+					// Not a trivial (single-pixel) zone
+					
+					// Restore the last saved parent position as current
+					// in order to get ahold the terminal pixel's parent who hopefully has other children
+					auto parent_xy = parentstack.top();	
+					parentstack.pop();
+					x = std::get<0> (parent_xy);
+					y = std::get<1> (parent_xy);
+				}
+				else
+					// Empty 'parentstack' indicates that no neighbors ("children") of pixel (x,y) are found or have all been ingested. 
+					// We are good to register this zone and proceed with searching another one.
+					break;
+			}
+
+			// At this point, 'parentstack' is expected to be empty
+			{
+				// Done scanning the whole zone. Register it
+				IDZ_cluster_indo clu = {inten, zoneMetric, zoneSize};
+				Z.push_back (clu);
+			}
 		}
 
 	//==== Fill the zonal metric matrix
 
 	// -- number of discrete intensity values in the image
-	int Ng = (int)U.size();
+	Ng = (int)U.size();
 
 	// -- max zone distance to ROI or image border
-	int Nd = 0;
+	Nd = 0;
 	for (auto& z : Z)
-		Nd = std::max (Nd, z.second);
+		Nd = std::max(Nd, std::get<1>(z));
 
 	// -- Set to vector to be able to know each intensity's index
 	std::vector<PixIntens> I (U.begin(), U.end());
 	std::sort (I.begin(), I.end());	// Optional
 
 	// -- Zone intensity -to- zone distance matrix
-	SimpleMatrix<int> P;
-	P.allocate (Nd, Ng);	// Ng rows, Nd columns
-	P.fill(0);
+	GLDZM.allocate (Nd, Ng);	// Ng rows, Nd columns
+	GLDZM.fill (0);
+	calc_gldzm_matrix (GLDZM, Z, I);
+}
 
-	// -- fill it
-	int i = 0;
-	for (auto& z : Z)
-	{
-		// row. Gray tones are sparse so we need to find indices of tones in 'Z' and use them as rows of P-matrix
-		auto iter = std::find (I.begin(), I.end(), z.first);	
-		int row = (int)(iter - I.begin());
-		// col (a distance). Distances are dense \in [1,Nd]
-		int col = z.second - 1;	// 0-based => -1
-		auto& k = P.yx (row, col);
-		k++;
-	}
+void GLDZMFeature::calculate (LR& r)
+{
+	clear_buffers();
+
+	//==== Check if the ROI is degenerate (equal intensity)
+	if (r.aux_min == r.aux_max)
+		return;
+
+	//==== Prepare the GLDZM-matrix kit: matrix itself and its dimensions
+	std::vector<PixIntens> greyLevelsLUT;
+	SimpleMatrix<unsigned int> GLDZM;
+	int Ng,	// number of grey levels
+		Nd;	// maximum number of non-zero dependencies
+	prepare_GLDZM_matrix_kit (GLDZM, Ng, Nd, r);
 
 	//==== Calculate vectors of totals by intensity (Mx) and by distance (Md)
 	std::vector<double> Mx, Md;
-	calc_row_and_column_sum_vectors (Mx, Md, P, Ng, Nd);
+	calc_row_and_column_sum_vectors (Mx, Md, GLDZM, Ng, Nd);
 
 	//==== Calculate features, set variables f_GLE, f_GML, f_GLV, etc
-	calc_features (Mx, Md, P, r.aux_area);
+	calc_features (Mx, Md, GLDZM, r.aux_area);
 }
 
 template <class Imgmatrx> int GLDZMFeature::dist2border (Imgmatrx& I, const int x, const int y)
@@ -224,6 +298,12 @@ template <class Imgmatrx> int GLDZMFeature::dist2border (Imgmatrx& I, const int
 			dist2b = y0 - y;
 			break;
 		}
+	// make distances 1-based
+	dist2l++;
+	dist2r++;
+	dist2t++;
+	dist2b++;
+
 	// result
 	int retval = std::min(std::min(std::min(dist2l, dist2r), dist2t), dist2b);
 	if (retval == 0)
@@ -281,12 +361,12 @@ template <class Imgmatrx> void GLDZMFeature::calc_features (const std::vector<do
 	{
 		double tmp = (double)g + 1;
 		double x = Mx[g];
-		f_LGLE += x / (tmp * tmp);	// Low Grey Level Emphasis = \frac{1}{N_s} \sum_x \frac{m_x}{x^2}
-		f_HGLE += (tmp * tmp) * x;	// High Grey Level Emphasis = \frac{1}{N_s} \sum_x x^2 m_x
+		f_LGLZE += x / (tmp * tmp);	// Low Grey Level Emphasis = \frac{1}{N_s} \sum_x \frac{m_x}{x^2}
+		f_HGLZE += (tmp * tmp) * x;	// High Grey Level Emphasis = \frac{1}{N_s} \sum_x x^2 m_x
 		f_GLNU += x * x;			// Grey Level Non-Uniformity = \frac{1}{N_s} \sum_x m_x^2
 	}
-	f_LGLE /= (double)Ns;
-	f_HGLE /= (double)Ns;
+	f_LGLZE /= (double)Ns;
+	f_HGLZE /= (double)Ns;
 	f_GLNU /= (double)Ns;
 	f_GLNUN = f_GLNU / (double)Ns;	// Grey Level Non-Uniformity Normalized = \frac{1}{N_s^2} \sum_x m_x^2
 
@@ -329,8 +409,8 @@ void GLDZMFeature::save_value (std::vector<std::vector<double>>& fvals)
 {
 	fvals[GLDZM_SDE][0] = f_SDE;
 	fvals[GLDZM_LDE][0] = f_LDE;
-	fvals[GLDZM_LGLE][0] = f_LGLE;
-	fvals[GLDZM_HGLE][0] = f_HGLE;
+	fvals[GLDZM_LGLZE][0] = f_LGLZE;
+	fvals[GLDZM_HGLZE][0] = f_HGLZE;
 	fvals[GLDZM_SDLGLE][0] = f_SDLGLE;
 	fvals[GLDZM_SDHGLE][0] = f_SDHGLE;
 	fvals[GLDZM_LDLGLE][0] = f_LDLGLE;
diff --git a/src/nyx/features/gldzm.h b/src/nyx/features/gldzm.h
index 39d3f6e6..f3dc7743 100644
--- a/src/nyx/features/gldzm.h
+++ b/src/nyx/features/gldzm.h
@@ -16,8 +16,8 @@ class GLDZMFeature : public FeatureMethod
 	{
 		GLDZM_SDE,		// Small Distance Emphasis
 		GLDZM_LDE,		// Large Distance Emphasis
-		GLDZM_LGLE,		// Low Grey Level Emphasis
-		GLDZM_HGLE,		// High GreyLevel Emphasis
+		GLDZM_LGLZE,		// Low Grey Level Zone Emphasis
+		GLDZM_HGLZE,		// High Grey Level Zone Emphasis
 		GLDZM_SDLGLE,	// Small Distance Low Grey Level Emphasis
 		GLDZM_SDHGLE,	// Small Distance High GreyLevel Emphasis
 		GLDZM_LDLGLE,	// Large Distance Low Grey Level Emphasis
@@ -48,11 +48,17 @@ class GLDZMFeature : public FeatureMethod
 		return fs.anyEnabled (GLDZMFeature::featureset);
 	}
 
+	void prepare_GLDZM_matrix_kit(SimpleMatrix<unsigned int>& GLDZM, /*std::vector<PixIntens>& grey_levels_LUT,*/ int& Ng, int& Nd, LR& r);
+
 private:
 
 	void clear_buffers();	
 	template <class Imgmatrx> int dist2border (Imgmatrx & I, const int x, const int y);
 	template <class Imgmatrx> void calc_row_and_column_sum_vectors (std::vector<double>& Mx, std::vector<double>& Md, Imgmatrx & P, const int Ng, const int Nd);
+
+	using IDZ_cluster_indo = std::tuple<PixIntens, int, int>;	// <intensity, distance metric, size>
+	void calc_gldzm_matrix (SimpleMatrix<unsigned int>& GLDZM, const std::vector<IDZ_cluster_indo>& Z, const std::vector<PixIntens>& I);
+
 	template <class Imgmatrx> void calc_features (const std::vector<double>& Mx, const std::vector<double>& Md, Imgmatrx& P, unsigned int roi_area);
 
 	const double EPS = 2.2e-16;
@@ -60,8 +66,8 @@ class GLDZMFeature : public FeatureMethod
 	// Variables caching feature values between calculate() and save_value(). 
 	double f_SDE,		// Small Distance Emphasis
 		f_LDE,		// Large Distance Emphasis
-		f_LGLE,		// Low Grey Level Emphasis
-		f_HGLE,		// High GreyLevel Emphasis
+		f_LGLZE,		// Low Grey Level Zone Emphasis
+		f_HGLZE,		// High Grey Level Zone Emphasis
 		f_SDLGLE,	// Small Distance Low Grey Level Emphasis
 		f_SDHGLE,	// Small Distance High GreyLevel Emphasis
 		f_LDLGLE,	// Large Distance Low Grey Level Emphasis
diff --git a/src/nyx/featureset.cpp b/src/nyx/featureset.cpp
index 240f51d3..8c26b077 100644
--- a/src/nyx/featureset.cpp
+++ b/src/nyx/featureset.cpp
@@ -229,8 +229,8 @@ namespace Nyxus
 
 		{ "GLDZM_SDE", GLDZM_SDE},
 		{ "GLDZM_LDE", GLDZM_LDE},
-		{ "GLDZM_LGLE", GLDZM_LGLE},
-		{ "GLDZM_HGLE", GLDZM_HGLE},
+		{ "GLDZM_LGLZE", GLDZM_LGLZE},
+		{ "GLDZM_HGLZE", GLDZM_HGLZE},
 		{ "GLDZM_SDLGLE", GLDZM_SDLGLE},
 		{ "GLDZM_SDHGLE", GLDZM_SDHGLE},
 		{ "GLDZM_LDLGLE", GLDZM_LDLGLE},
diff --git a/src/nyx/featureset.h b/src/nyx/featureset.h
index 2fa44d38..86b3c33e 100644
--- a/src/nyx/featureset.h
+++ b/src/nyx/featureset.h
@@ -218,10 +218,10 @@ namespace Nyxus
 		// GLDZM:
 		GLDZM_SDE,		// Small Distance Emphasis
 		GLDZM_LDE,		// Large Distance Emphasis
-		GLDZM_LGLE,		// Low Grey Level Emphasis
-		GLDZM_HGLE,		// High GreyLevel Emphasis
+		GLDZM_LGLZE,		// Low Grey Level Zone Emphasis
+		GLDZM_HGLZE,		// High Grey Level Zone Emphasis
 		GLDZM_SDLGLE,	// Small Distance Low Grey Level Emphasis
-		GLDZM_SDHGLE,	// Small Distance High GreyLevel Emphasis
+		GLDZM_SDHGLE,	// Small Distance High Grey Level Emphasis
 		GLDZM_LDLGLE,	// Large Distance Low Grey Level Emphasis
 		GLDZM_LDHGLE,	// Large Distance High Grey Level Emphasis
 		GLDZM_GLNU,		// Grey Level Non Uniformity


Test patch:
diff --git a/tests/test_all.cc b/tests/test_all.cc
index f66be091..abbfc95c 100755
--- a/tests/test_all.cc
+++ b/tests/test_all.cc
@@ -8,6 +8,7 @@
 #include "test_ibsi_glcm.h"
 #include "test_ibsi_gldm.h"
 #include "test_ibsi_glrlm.h"
+#include "test_ibsi_gldzm.h"
 #include "test_ibsi_glszm.h"
 #include "test_ibsi_intensity.h"
 #include "test_ibsi_ngldm.h"
@@ -860,13 +861,11 @@ TEST(TEST_NYXUS, TEST_GLRLM_RP)
 	ASSERT_NO_THROW(test_glrlm_rp());
 }
 
-
 TEST(TEST_NYXUS, TEST_GLRLM_GLV)
 {
 	ASSERT_NO_THROW(test_glrlm_glv());
 }
 
-
 TEST(TEST_NYXUS, TEST_GLRLM_RV)
 {
 	ASSERT_NO_THROW(test_glrlm_rv());
@@ -877,6 +876,13 @@ TEST(TEST_NYXUS, TEST_GLRLM_RE)
 	ASSERT_NO_THROW(test_glrlm_re());
 }
 
+// GLDZM
+
+TEST(TEST_NYXUS, TEST_IBSI_GLDZM_MATRIX_CORRECTNESS)
+{
+	ASSERT_NO_THROW(test_ibsi_GLDZM_matrix_correctness());
+}
+
 // GLSZM
 
 TEST(TEST_NYXUS, TEST_GLSZM_SAE) {
diff --git a/tests/test_data.h b/tests/test_data.h
index f5edfaf8..2e0e55e4 100755
--- a/tests/test_data.h
+++ b/tests/test_data.h
@@ -215,6 +215,35 @@ const static int nonibsi_rayryeng_ngldm_ground_truth[] =
 	0, 1, 0, 0, 0, 0
 };
 
+//
+// Sample image for GLDZM feature calculation 
+// Source: IBSI Documentation, Release 0.0.1dev, Page 104
+//
+
+const static NyxusPixel ibsi_fig3_17a_gldzm_sample_image_int[] =
+{
+	{1, 1, 1}, {2, 1, 2}, {3, 1, 2}, {4, 1, 3},
+	{1, 2, 1}, {2, 2, 2}, {3, 2, 3}, {4, 2, 3},
+	{1, 3, 4}, {2, 3, 2}, {3, 3, 4}, {4, 3, 1},
+	{1, 4, 4}, {2, 4, 1}, {3, 4, 2}, {4, 4, 3}
+};
+
+const static NyxusPixel ibsi_fig3_17a_gldzm_sample_image_mask[] =
+{
+	{1, 1, 1}, {2, 1, 1}, {3, 1, 1}, {4, 1, 1},
+	{1, 2, 1}, {2, 2, 1}, {3, 2, 1}, {4, 2, 1},
+	{1, 3, 1}, {2, 3, 1}, {3, 3, 1}, {4, 3, 1},
+	{1, 4, 1}, {2, 4, 1}, {3, 4, 1}, {4, 4, 1}
+};
+
+const static int ibsi_fig3_17c_gldzm_ground_truth[] =
+{
+	3, 0,
+	2, 0,
+	2, 0,
+	1, 1
+};
+
 // Phantom for ROI perimeter feature calculation - nonzero pixels of ROI mask generated in Matlab as:
 // BW_noholes = imfill(imread('circles.png', 'holes'))
 const static NyxusPixel roiDataForPerimeterTest[] = {
diff --git a/tests/test_ibsi_gldzm.h b/tests/test_ibsi_gldzm.h
index ff3782b7..57bbf591 100644
--- a/tests/test_ibsi_gldzm.h
+++ b/tests/test_ibsi_gldzm.h
@@ -37,12 +37,12 @@ void test_ibsi_gldzm_matrix()
 
     // Load a test image
     LR roidata;
-    load_masked_test_roi_data (roidata, ibsi_fig3_17a_ngldm_sample_image_int, ibsi_fig3_17a_ngldm_sample_image_mask, sizeof(ibsi_fig3_17a_ngldm_sample_image_mask) / sizeof(NyxusPixel));
+    load_masked_test_roi_data (roidata, ibsi_fig3_17a_gldzm_sample_image_int, ibsi_fig3_17a_gldzm_sample_image_mask, sizeof(ibsi_fig3_17a_gldzm_sample_image_mask) / sizeof(NyxusPixel));
 
-    // In this test, we only calculate and examine the NGLD-matrix without calculating features
+    // In this test, we only calculate and examine the GLDZ-matrix without calculating features
     GLDZMFeature f;
 
-    // Have the feature object to create the NGLDM matrix kit (matrix itself, LUT of grey tones (0-max in IBSI mode, unique otherwise), and NGLDM's dimensions)
+    // Have the feature object to create the GLDZM matrix kit (matrix itself, LUT of grey tones (0-max in IBSI mode, unique otherwise), and GLDZM's dimensions)
     SimpleMatrix<unsigned int> GLDZM;
     int Ng,	// number of grey levels
         Nd;	// maximum number of non-zero dependencies
@@ -53,7 +53,7 @@ void test_ibsi_gldzm_matrix()
     for (int g = 0; g < Ng; g++)
         for (int d = 0; d < Nd; d++)
         {
-            auto gtruth = ibsi_fig3_17c_ngldm_ground_truth [g * Nd + d];
+            auto gtruth = ibsi_fig3_17c_gldzm_ground_truth [g * Nd + d];
             auto actual = GLDZM.yx (g,d);
             if (gtruth != actual)
             {
@@ -164,87 +164,7 @@ void test_ibsi_gldzm_feature (const AvailableFeatures& feature, const std::strin
     ASSERT_TRUE (agrees_gt(aveTotal, ibsi_gldzm_gtruth[feature_name], 2.));
 }
 
-    void test_ibsi_GLDZM_matrix_correctness()
-    {
-        test_ibsi_gldzm_matrix();
-    }
-
-    void test_ibsi_GLDZM_SDE()
-    {
-        test_ibsi_gldzm_feature (GLDZM_SDE, "GLDZM_SDE");
-    }
-
-    void test_ibsi_GLDZM_LDE()
-    {
-        test_ibsi_gldzm_feature (GLDZM_LDE, "GLDZM_LDE");
-    }
-
-    void test_ibsi_GLDZM_LGLZE()
-    {
-        test_ibsi_gldzm_feature (GLDZM_LGLZE, "GLDZM_LGLZE");
-    }
-
-    void test_ibsi_GLDZM_HGLZE()
-    {
-        test_ibsi_gldzm_feature (GLDZM_HGLZE, "GLDZM_HGLZE");
-    }
-
-    void test_ibsi_GLDZM_SDHGLE()
-    {
-        test_ibsi_gldzm_feature (GLDZM_SDHGLE, "GLDZM_SDHGLE");
-    }
-
-    void test_ibsi_GLDZM_LDLGLE()
-    {
-        test_ibsi_gldzm_feature (GLDZM_LDLGLE, "GLDZM_LDLGLE");
-    }
-
-    void test_ibsi_GLDZM_LDHGLE()
-    {
-        test_ibsi_gldzm_feature (GLDZM_LDHGLE, "GLDZM_LDHGLE");
-    }
-
-    void test_ibsi_GLDZM_GLNU()
-    {
-        test_ibsi_gldzm_feature(GLDZM_GLNU, "GLDZM_GLNU");
-    }
-
-    void test_ibsi_GLDZM_GLNUN()
-    {
-        test_ibsi_gldzm_feature(GLDZM_GLNUN, "GLDZM_GLNUN");
-    }
-
-    void test_ibsi_GLDZM_ZDNU()
-    {
-        test_ibsi_gldzm_feature(GLDZM_ZDNU, "GLDZM_ZDNU");
-    }
-
-    void test_ibsi_GLDZM_ZDNUN()
-    {
-        test_ibsi_gldzm_feature (GLDZM_ZDNUN, "GLDZM_ZDNUN");
-    }
-
-    void test_ibsi_GLDZM_ZP()
-    {
-        test_ibsi_gldzm_feature (GLDZM_ZP, "GLDZM_ZP");
-    }
-
-    void test_ibsi_GLDZM_GLV()
-    {
-        test_ibsi_gldzm_feature (GLDZM_GLV, "GLDZM_GLV");
-    }
-
-    void test_ibsi_GLDZM_ZDV()
-    {
-        test_ibsi_gldzm_feature (GLDZM_ZDV, "GLDZM_ZDV");
-    }
-
-    void test_ibsi_GLDZM_ZDE()
-    {
-        test_ibsi_gldzm_feature (GLDZM_ZDE, "GLDZM_ZDE");
-    }
-
-
-
-
-
+void test_ibsi_GLDZM_matrix_correctness()
+{
+    test_ibsi_gldzm_matrix();
+}