Esempio n. 1
0
    def test_vessel_width(self):
        self.manual.threshold_image()
        threshold = self.manual.get_uint_image()
        self.manual.skeletonization()
        skeleton = self.manual.get_uint_image()
        landmarks, segmented = l.potential_landmarks(skeleton, 3)
        widths = vc._vessel_widths(segmented, threshold)

        result = np.genfromtxt(self._test_path + "vessels_width_test.csv", delimiter=',')
        assert_array_equal(result, widths[0:10], "Vessel widths does not match")
Esempio n. 2
0
    def test_vectors(self):
        self.manual.threshold_image()
        threshold = self.manual.get_uint_image()
        self.manual.skeletonization()
        skeleton = self.manual.get_uint_image()
        gray = cv2.cvtColor(self.original, cv2.COLOR_BGR2GRAY)
        lab = cv2.cvtColor(self.original, cv2.COLOR_BGR2LAB)
        L, A, B = cv2.split(lab)
        widths = vc._vessel_widths(skeleton, threshold)
        iv = vc._vector(widths[0], 6, self.original, L, gray, 0)

        result = np.genfromtxt(self._test_path + "vector_test.csv", delimiter=',')
        assert_array_equal(result, iv, "Feature vector does not match")
Esempio n. 3
0
    def test_preparing_data_without_av(self):
        self.manual.threshold_image()
        threshold = self.manual.get_uint_image()
        self.manual.skeletonization()
        skeleton = self.manual.get_uint_image()
        gray = cv2.cvtColor(self.original, cv2.COLOR_BGR2GRAY)
        lab = cv2.cvtColor(self.original, cv2.COLOR_BGR2LAB)
        L, A, B = cv2.split(lab)
        landmarks, segmented = l.potential_landmarks(skeleton, 3)
        widths = vc._vessel_widths(segmented, threshold)
        features = vc._preparing_data(widths, 6, self.original, None, L, gray)

        result = np.genfromtxt(self._test_path + "preparing_data_without_av_test.csv", delimiter=',')
        assert_array_equal(result, features[0:10], "Data does not match")