Skip to content
Snippets Groups Projects
Commit 881918f9 authored by Constantin Pape's avatar Constantin Pape
Browse files

add_segmentation is working for dynamic segmentations and added existing dynamic segmentations

parent e62eb491
No related branches found
No related tags found
1 merge request!3Refactor sources
This commit is part of merge request !3. Comments created here will be created in the context of that merge request.
......@@ -37,10 +37,10 @@ def add_static_segmentations():
source = 'sbem-6dpf-1-whole'
# chromatin segmentation
# chromatin_tables = {'default': './data/0.2.0/tables/sbem-6dpf-1-whole-segmented-chromatin-labels/default.csv'}
# add_segmentation(source, 'segmented-chromatin-labels',
# segmentation_path='./data/rawdata/sbem-6dpf-1-whole-segmented-chromatin-labels.xml',
# table_path_dict=chromatin_tables, copy_data=False)
chromatin_tables = {'default': './data/0.2.0/tables/sbem-6dpf-1-whole-segmented-chromatin-labels/default.csv'}
add_segmentation(source, 'segmented-chromatin-labels',
segmentation_path='./data/rawdata/sbem-6dpf-1-whole-segmented-chromatin-labels.xml',
table_path_dict=chromatin_tables, copy_data=False)
# tissue segmentation
tissue_tables = {'default': './data/0.1.0/tables/sbem-6dpf-1-whole-segmented-tissue-labels/base.csv'}
......@@ -53,17 +53,40 @@ def add_static_segmentations():
segmentation_path='./data/rawdata/sbem-6dpf-1-whole-segmented-muscle.xml', copy_data=False)
def add_dynamic_segmentations():
source = 'sbem-6dpf-1-whole'
paintera_root = '/g/kreshuk/data/arendt/platyneris_v1/data.n5'
# cell segmentation
add_segmentation(source, 'segmented-cells-labes',
paintera_project=(paintera_root, 'volumes/paintera/proofread_cells'),
resolution=[.025, .02, .02],
table_update_function='make_cell_tables')
# nucleus segmentation
add_segmentation(source, 'segmented-nuclei-labels',
paintera_project=(paintera_root, 'volumes/paintera/nuclei'),
resolution=[.1, .08, .08],
table_update_function='make_nucleus_tables')
# cilia segmentation
add_segmentation(source, 'segmented-cilia-labels',
paintera_project=(paintera_root, 'volumes/paintera/cilia'),
resolution=[.025, .01, .01],
table_update_function='make_cilia_tables')
def add_segmentations():
add_static_segmentations()
# add_dynamic_segmentations()
add_dynamic_segmentations()
def add_existing_data():
""" Add existing data to the json files that keep track of
sources, image data and segmentations.
"""
# add_sources()
# add_images()
add_sources()
add_images()
add_segmentations()
......
{"sbem-6dpf-1-whole-segmented-chromatin-labels": {"is_static": true, "has_tables": true}, "sbem-6dpf-1-whole-segmented-tissue-labels": {"is_static": true, "has_tables": true}, "sbem-6dpf-1-whole-segmented-muscle": {"is_static": true, "has_tables": false}}
\ No newline at end of file
{"sbem-6dpf-1-whole-segmented-chromatin-labels": {"is_static": true, "has_tables": true}, "sbem-6dpf-1-whole-segmented-tissue-labels": {"is_static": true, "has_tables": true}, "sbem-6dpf-1-whole-segmented-muscle": {"is_static": true, "has_tables": false}, "sbem-6dpf-1-whole-segmented-cells-labes": {"is_static": false, "paintera_project": ["/g/kreshuk/data/arendt/platyneris_v1/data.n5", "volumes/paintera/proofread_cells"], "resolution": [0.025, 0.02, 0.02], "table_update_function": "make_cell_tables"}, "sbem-6dpf-1-whole-segmented-nuclei-labels": {"is_static": false, "paintera_project": ["/g/kreshuk/data/arendt/platyneris_v1/data.n5", "volumes/paintera/nuclei"], "resolution": [0.1, 0.08, 0.08], "table_update_function": "make_nucleus_tables"}, "sbem-6dpf-1-whole-segmented-cilia-labels": {"is_static": false, "paintera_project": ["/g/kreshuk/data/arendt/platyneris_v1/data.n5", "volumes/paintera/cilia"], "resolution": [0.025, 0.01, 0.01], "table_update_function": "make_cilia_tables"}}
\ No newline at end of file
......@@ -35,10 +35,10 @@ def check_paintera(paintera_project):
except TypeError:
return False
try:
f = z5py.File(path)
f = z5py.File(path, 'r')
group = f[key]
# check for expected paintera keys
for kk in ('data', 'label-block-mapping', 'unique-labels'):
for kk in ('data', 'label-to-block-mapping', 'unique-labels'):
if kk not in group:
return False
except Exception:
......
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