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

More work on migration scripts

parent 695af253
No related branches found
No related tags found
1 merge request!11New storage layout
......@@ -66,7 +66,7 @@ def move_image_file(image_folder, xml_path):
copy_xml_with_newpath(new_xml_path, new_xml_path, new_rel_data_path)
# update the h5 path in the new xml
return {new_name: get_image_properties(name)}
return {new_name: get_image_properties(new_name)}
def update_image_dict(image_folder, image_dict):
......@@ -145,6 +145,7 @@ def migrate_version(version):
# - remove segmentations folder (make sure it's empty)
# - remove bdv server config
clean_up(version_folder)
# TODO make README for version
# migrate all the data in the raw folder
......
......@@ -79,6 +79,9 @@ def update_name_lut():
# get rid of '-ariande' tag [sic]
if '-ariande' in new_name:
new_name = new_name.replace('-ariande', '')
# replace '-mask' with '-segmented'
if '-mask' in new_name:
new_name = new_name.replace('-mask', '-segmented')
# update the gene / region names for prospr
# and make everything lowercase
......@@ -102,19 +105,45 @@ def update_name_lut():
def update_image_properties():
global IMAGE_PROPERTIES
for name in FILE_NAME_LUT:
for name in FILE_NAME_LUT.values():
properties = {}
table_folder = 'tables/%s' % name
# prospr: Color Magenta
# value range 0 - 1000
if name.startswith('prospr'):
if 'virtual-cells' in name:
vc_table_folder = 'tables/%s' % name
properties.update({'ColorMap': 'Glasbey', 'TableFolder': vc_table_folder})
properties.update({'ColorMap': 'Glasbey', 'TableFolder': table_folder})
else:
properties.update({'Color': 'Magenta', 'MinValue': 0, 'MaxValue': 1000})
# TODO handle segmentations / masks
# TODO segmented / mask is not consistent, get rid of '-mask' tag?
# handle all special segmentations:
# - dynamic and with tables:
# -- cells
# -- cilia
# -- nuclei
elif 'segmented-cells' in name:
paintera_project = ''
table_update_function = ''
# TODO postprocessing options in Dynamic
properties.update({'ColorMap': 'Glasbey',
'TableFolder': table_folder,
'Dynamic': {'PainteraProject': paintera_project,
'TableUpdateFunction': table_update_function}})
# - static but with tables:
# -- chromatin
# -- tissue
# -- ganglia
elif ('segmented-chromatin' in name
or 'segmented-tissue' in name
or 'segmented-ganglia' in name):
properties.update({'ColorMap': 'Glasbey', 'TableFolder': table_folder})
# TODO is white correct ?
# all other segmentations are binary masks
elif '-segmented' in name:
properties.update({'Color': 'White', 'MinValue': 0, 'MaxValue': 1})
# em-raw: Color White
# value range 0 - 255
else:
......
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