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

Merge branch 'allow_mono_patches' into 'staging'

Allow exporting of mono patches from run_exports

See merge request !26
parents 2bbd571d 1263a4e6
No related branches found
No related tags found
3 merge requests!37Release 2024.04.19,!34Revert "Temporary error-handling for debug...",!26Allow exporting of mono patches from run_exports
......@@ -28,7 +28,7 @@ class PatchParams(BaseModel):
draw_mask: bool = False
rescale_clip: float = 0.001
focus_metric: str = 'max_sobel'
rgb_overlay_channels: List[Union[int, None]] = [None, None, None]
rgb_overlay_channels: Union[List[Union[int, None]], None] = None
rgb_overlay_weights: List[float] = [1.0, 1.0, 1.0]
pad_to: int = 256
expanded: bool = False
......
......@@ -428,9 +428,38 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa
self.assertEqual(pacc.hw, (256, 256))
print('res')
def test_run_export_mono_2d_patch(self):
p = RoiSetExportParams(**{
'patches_2d': {
'draw_bounding_box': False,
'draw_mask': False,
'expanded': True,
'pad_to': 256,
'rgb_overlay_channels': None,
},
})
self.assertTrue(hasattr(p.patches_2d, 'pad_to'))
self.assertTrue(hasattr(p.patches_2d, 'expanded'))
where = output_path / 'run_exports_mono_2d_patch'
res = self.roiset.run_exports(
where,
channel=-1,
prefix='test',
params=p
)
# test that exported patches are padded dimension
for fn in res['patches_2d']:
pa = where / fn
self.assertTrue(pa.exists())
pacc = generate_file_accessor(pa)
self.assertEqual(pacc.chroma, 1)
print('res')
class TestRoiSetFromZmask(unittest.TestCase):
class TestRoiSetSerialization(unittest.TestCase):
def setUp(self) -> None:
# set up test raw data and segmentation from file
......
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