Skip to content
Snippets Groups Projects
Commit aabc2873 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Still not showing equivalency between test and reference RoiSets

parent a7b7a392
No related branches found
No related tags found
2 merge requests!18Completed (de)serialization of RoiSet,!16Completed (de)serialization of RoiSet
......@@ -381,14 +381,14 @@ class TestRoiSetFromZmask(unittest.TestCase):
def test_create_roiset_from_df_and_patch_masks(self):
ref_roiset = self.test_create_roiset_from_2d_obj_ids()
where_ser = output_path / 'roiset_from_3d'
where_ser = output_path / 'serialize'
ref_roiset.serialize(where_ser, prefix='ref')
where_df = output_path / 'roiset_from_3d' / 'dataframe' / 'ref.csv'
where_df = where_ser / 'dataframe' / 'ref.csv'
self.assertTrue(where_df.exists())
df_test = pd.read_csv(where_df)
# check that patches are correct size
where_patch_masks = output_path / 'roiset_from_3d' / 'tight_patch_masks'
where_patch_masks = where_ser / 'tight_patch_masks'
for pmf in where_patch_masks.iterdir():
self.assertTrue(pmf.suffix.upper() == '.PNG')
la = int(re.search(r'la([\d]+)', str(pmf)).group(1))
......@@ -400,5 +400,10 @@ class TestRoiSetFromZmask(unittest.TestCase):
# make another RoiSet from just the data table, raw images, and (tight) patch masks
test_roiset = RoiSet.deserialize(self.stack, where_ser, prefix='ref')
self.assertEqual(ref_roiset.get_zmask().shape, test_roiset.get_zmask().shape,)
self.assertTrue(np.all(ref_roiset.get_zmask() == test_roiset.get_zmask()))
where_dser = output_path / 'deserialize'
test_roiset.serialize(where_dser, prefix='test')
self.assertTrue(np.all(test_roiset.get_df().label == ref_roiset.get_df().label))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment