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

Confirms that ilastik pixel classification already works with multichannel input

parent bcf1efbe
No related branches found
No related tags found
2 merge requests!50Release 2024.06.03,!40ilastik workflow and API allow multichannel inputs
......@@ -57,6 +57,8 @@ ilastik_classifiers = {
'px': root / 'ilastik' / 'demo_px.ilp',
'pxmap_to_obj': root / 'ilastik' / 'demo_obj.ilp',
'seg_to_obj': root / 'ilastik' / 'demo_obj_seg.ilp',
'px_color_zstack': root / 'ilastik' / 'px_color_zstack.ilp',
'ob_color_zstack': root / 'ilastik' / 'ob_color_zstack.ilp',
}
roiset_test_data = {
......
......@@ -320,6 +320,34 @@ class TestIlastikOverApi(TestServerBaseClass):
self.assertEqual(resp_infer.status_code, 200, resp_infer.content.decode())
class TestIlastikOnMultichannelInputs(TestServerBaseClass):
def setUp(self) -> None:
super(TestIlastikOnMultichannelInputs, self).setUp()
self.pa_px_classifier = ilastik_classifiers['px_color_zstack']
self.pa_ob_classifier = ilastik_classifiers['ob_color_zstack']
self.input_image = generate_file_accessor(roiset_test_data['multichannel_zstack']['path'])
def _copy_input_file_to_server(self):
from shutil import copyfile
pa_data = roiset_test_data['multichannel_zstack']['path']
resp = self._get('paths')
pa = resp.json()['inbound_images']
outpath = pathlib.Path(pa) / pa_data.name
copyfile(
czifile['path'],
outpath
)
def test_classify_pixels(self):
self.assertGreater(self.input_image.chroma, 1)
mod = ilm.IlastikPixelClassifierModel(params={'project_file': self.pa_px_classifier})
pxmap = mod.infer(self.input_image)[0]
self.assertEqual(pxmap.hw, self.input_image.hw)
class TestIlastikObjectClassification(unittest.TestCase):
def setUp(self):
stack = generate_file_accessor(roiset_test_data['multichannel_zstack']['path'])
......
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