Esempio n. 1
0
 def test_IOI_NIFTI_predictionhandling(self):
     interface = NIFTI_interface(pattern="nifti")
     sample_list = interface.initialize(self.tmp_data.name)
     sample = MIScnn_sample.Sample("pred.nifti", np.asarray([0]), interface.channels, interface.classes)
     sample.add_prediction(self.seg);
     interface.save_prediction(sample, self.tmp_data.name)
     pred = interface.load_prediction("pred.nifti", self.tmp_data.name)
     self.assertTrue(np.array_equal(pred.reshape(self.seg.shape), self.seg))
Esempio n. 2
0
 def test_IOI_NIFTI_loading(self):
     interface = NIFTI_interface(pattern="nifti")
     sample_list = interface.initialize(self.tmp_data.name)
     img = interface.load_image(sample_list[0])
     seg = interface.load_segmentation(sample_list[0])
     details = interface.load_details(sample_list[0])
     self.assertTrue(np.array_equal(img, self.img))
     self.assertTrue(np.array_equal(seg, self.seg))
Esempio n. 3
0
 def test_IOI_NIFTI_loading(self):
     interface = NIFTI_interface(pattern="nifti")
     sample_list = interface.initialize(self.tmp_data.name)
     img, extended = interface.load_image(sample_list[0])
     # Create a Sample object
     sample = MIScnn_sample.Sample(sample_list[0], img, interface.channels, interface.classes, extended)
     seg = interface.load_segmentation(sample_list[0])
     
     self.assertTrue(np.array_equal(img, self.img))
     self.assertTrue(np.array_equal(seg, self.seg))
Esempio n. 4
0
 def test_IOI_NIFTI_initialize(self):
     interface = NIFTI_interface(pattern="nifti")
     sample_list = interface.initialize(self.tmp_data.name)
     self.assertEqual(len(sample_list), 1)
     self.assertEqual(sample_list[0], "nifti")
Esempio n. 5
0
 def test_IOI_NIFTI_predictionhandling(self):
     interface = NIFTI_interface(pattern="nifti")
     sample_list = interface.initialize(self.tmp_data.name)
     interface.save_prediction(self.seg, "pred.nifti", self.tmp_data.name)
     pred = interface.load_prediction("pred.nifti", self.tmp_data.name)
     self.assertTrue(np.array_equal(pred, self.seg))