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

Now that RoiSet is in base, remove dependency on ilastik in its test; tests...

Now that RoiSet is in base, remove dependency on ilastik in its test; tests now open segmentation mask from file
parent 18f28496
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ multichannel_zstack = { ...@@ -8,6 +8,7 @@ multichannel_zstack = {
'h': 512, 'h': 512,
'c': 5, 'c': 5,
'z': 7, 'z': 7,
'mask_path': root / 'testing' / 'zmask-test-stack-mask.tif',
} }
pixel_classifier = { pixel_classifier = {
......
...@@ -15,27 +15,10 @@ from model_server.base.models import DummyInstanceSegmentationModel ...@@ -15,27 +15,10 @@ from model_server.base.models import DummyInstanceSegmentationModel
class BaseTestRoiSetMonoProducts(object): class BaseTestRoiSetMonoProducts(object):
def setUp(self) -> None: def setUp(self) -> None:
# set up test raw data and segmentation from file
# need test data incl obj map
self.stack = generate_file_accessor(multichannel_zstack['path']) self.stack = generate_file_accessor(multichannel_zstack['path'])
self.stack_ch_seg = self.stack.get_one_channel_data(pipeline_params['segmentation_channel'])
self.stack_ch_pa = self.stack.get_one_channel_data(pipeline_params['patches_channel']) self.stack_ch_pa = self.stack.get_one_channel_data(pipeline_params['patches_channel'])
self.seg_mask = generate_file_accessor(multichannel_zstack['mask_path'])
self.pxmodel = IlastikPixelClassifierModel(
{'project_file': pixel_classifier['path']},
)
mip = InMemoryDataAccessor(
self.stack_ch_seg.data.max(axis=-1, keepdims=True)
)
pxmap, _ = self.pxmodel.infer(mip)
write_accessor_data_to_file(output_path / 'pxmap.tif', pxmap)
self.seg_mask = InMemoryDataAccessor(
pxmap.get_one_channel_data(
pipeline_params['pxmap_channel']
).data > pipeline_params['pxmap_threshold']
)
write_accessor_data_to_file(output_path / 'seg_mask.tif', self.seg_mask)
class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase): class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase):
......
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