-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
""" | ||
test_autocontour.py | ||
Created by: Michael Kuczynski | ||
Created on: June 29, 2022 | ||
Description: Test automatic periosteal contour. | ||
""" | ||
|
||
import unittest | ||
import numpy as np | ||
import SimpleITK as sitk | ||
|
||
from ormir_xct.autocontour.autocontour_gobj import autocontour_gobj | ||
from ormir_xct.autocontour.AutocontourKnee import AutocontourKnee | ||
|
||
class TestAutocontour(unittest.TestCase): | ||
def test_autocontour(self): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
""" | ||
test_segmentation_evaluation.py | ||
Created by: Michael Kuczynski | ||
Created on: June 29, 2022 | ||
Description: Test segmentation evaluation. | ||
""" | ||
|
||
import os | ||
import unittest | ||
import numpy as np | ||
import SimpleITK as sitk | ||
|
||
from ormir_xct.util.segmentation_evaluation import ( | ||
binarize_numpy_array, | ||
get_distance_map_and_surface, | ||
get_surface_to_surface_distances_list, | ||
calculate_dice_and_jaccard, | ||
calculate_surface_distance_measures, | ||
) | ||
|
||
|
||
def create_test_image(dimensions, value): | ||
""" | ||
Creates a numpy array containing a single value of given dimension. | ||
""" | ||
array = np.full(dimensions, value) | ||
return array | ||
|
||
|
||
class TestSegmentationEvaluation(unittest.TestCase): | ||
def test_binarize_numpy_array(self): | ||
test_image = np.array([[1, 2, 3], [0, 0, 100], [22, 0, 33]]) | ||
expected_image = np.array([[1, 1, 1], [0, 0, 1], [1, 0, 1]]) | ||
|
||
result_image = binarize_numpy_array(test_image) | ||
|
||
np.testing.assert_array_equal(expected_image, result_image) | ||
|
||
@unittest.skip("unimplemented") | ||
def test_get_distance_map_and_surface(self): | ||
pass | ||
|
||
@unittest.skip("unimplemented") | ||
def test_get_surface_to_surface_distances_list(self): | ||
pass | ||
|
||
@unittest.skip("unimplemented") | ||
def test_calculate_dice_and_jaccard(self): | ||
pass | ||
|
||
@unittest.skip("unimplemented") | ||
def test_calculate_surface_distance_measures(self): | ||
pass |