Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_IOI_IMAGE_creation(self):
interface = Image_interface()
# Initialization
def test_IOI_IMAGE_loading(self):
interface = Image_interface(pattern="image")
sample_list = interface.initialize(self.tmp_data.name)
img = interface.load_image(sample_list[0])
seg = interface.load_segmentation(sample_list[0])
self.assertTrue(np.array_equal(img, self.img[:,:,0]))
self.assertTrue(np.array_equal(seg, self.seg[:,:,0]))
# NIFTI_interface - Loading and Storage of Predictions
def test_IOI_IMAGE_initialize(self):
interface = Image_interface(pattern="image")
sample_list = interface.initialize(self.tmp_data.name)
self.assertEqual(len(sample_list), 1)
self.assertEqual(sample_list[0], "image")
# Loading Images and Segmentations
def test_IOI_IMAGE_predictionhandling(self):
interface = Image_interface(pattern="image")
sample_list = interface.initialize(self.tmp_data.name)
interface.save_prediction(self.seg[:,:,0], "pred.image",
self.tmp_data.name)
pred = interface.load_prediction("pred.image", self.tmp_data.name)
self.assertTrue(np.array_equal(pred, self.seg[:,:,0]))