Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuczyns committed Aug 30, 2023
1 parent 6643310 commit 7ab6008
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/autocontour/test_autocontour_gobj.py
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
55 changes: 55 additions & 0 deletions tests/util/test_segmentation_evaluation.py
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

0 comments on commit 7ab6008

Please sign in to comment.