9
9
from . import omero_vitessce_settings
10
10
11
11
from vitessce import VitessceConfig , OmeZarrWrapper , MultiImageWrapper
12
- from vitessce import ViewType as vt , FileType as ft , CoordinationType as ct
12
+ from vitessce import ViewType as Vt , FileType as Ft , CoordinationType as Ct
13
13
14
14
# Get the address of omeroweb from the config
15
15
SERVER = omero_vitessce_settings .SERVER_ADDRESS [1 :- 1 ]
@@ -62,17 +62,17 @@ def create_dataset_config(dataset_id, conn):
62
62
wrappers = []
63
63
for img in images :
64
64
wrapper = OmeZarrWrapper (
65
- img_url = build_zarr_image_url (img .getId ()),
66
- name = img .getName ())
65
+ img_url = build_zarr_image_url (img .getId ()),
66
+ name = img .getName ())
67
67
wrappers .append (wrapper )
68
68
vc_dataset .add_object (MultiImageWrapper (image_wrappers = wrappers ,
69
69
use_physical_size_scaling = True ))
70
- vc .add_view (vt .SPATIAL , dataset = vc_dataset , x = 0 , y = 0 , w = 10 , h = 10 )
71
- vc .add_view (vt .LAYER_CONTROLLER , dataset = vc_dataset , x = 10 , y = 0 , w = 2 , h = 10 )
70
+ vc .add_view (Vt .SPATIAL , dataset = vc_dataset , x = 0 , y = 0 , w = 10 , h = 10 )
71
+ vc .add_view (Vt .LAYER_CONTROLLER , dataset = vc_dataset , x = 10 , y = 0 , w = 2 , h = 10 )
72
72
vc .add_coordination_by_dict ({
73
- ct .SPATIAL_ZOOM : 2 ,
74
- ct .SPATIAL_TARGET_X : 0 ,
75
- ct .SPATIAL_TARGET_Y : 0 ,
73
+ Ct .SPATIAL_ZOOM : 2 ,
74
+ Ct .SPATIAL_TARGET_X : 0 ,
75
+ Ct .SPATIAL_TARGET_Y : 0 ,
76
76
})
77
77
return vc
78
78
@@ -85,14 +85,14 @@ def create_image_config(image_id):
85
85
"""
86
86
vc = VitessceConfig (schema_version = "1.0.6" )
87
87
vc_dataset = vc .add_dataset ().add_file (
88
- url = build_zarr_image_url (image_id ),
89
- file_type = ft .IMAGE_OME_ZARR )
90
- vc .add_view (vt .SPATIAL , dataset = vc_dataset , x = 0 , y = 0 , w = 10 , h = 10 )
91
- vc .add_view (vt .LAYER_CONTROLLER , dataset = vc_dataset , x = 10 , y = 0 , w = 2 , h = 10 )
88
+ url = build_zarr_image_url (image_id ),
89
+ file_type = Ft .IMAGE_OME_ZARR )
90
+ vc .add_view (Vt .SPATIAL , dataset = vc_dataset , x = 0 , y = 0 , w = 10 , h = 10 )
91
+ vc .add_view (Vt .LAYER_CONTROLLER , dataset = vc_dataset , x = 10 , y = 0 , w = 2 , h = 10 )
92
92
vc .add_coordination_by_dict ({
93
- ct .SPATIAL_ZOOM : 2 ,
94
- ct .SPATIAL_TARGET_X : 0 ,
95
- ct .SPATIAL_TARGET_Y : 0 ,
93
+ Ct .SPATIAL_ZOOM : 2 ,
94
+ Ct .SPATIAL_TARGET_X : 0 ,
95
+ Ct .SPATIAL_TARGET_Y : 0 ,
96
96
})
97
97
return vc
98
98
@@ -107,7 +107,7 @@ def attach_config(vc, obj_type, obj_id, conn):
107
107
delete = False ) as outfile :
108
108
json .dump (vc .to_dict (), outfile , indent = 4 , sort_keys = False )
109
109
file_ann = conn .createFileAnnfromLocalFile (
110
- outfile .name , mimetype = "text/plain" )
110
+ outfile .name , mimetype = "text/plain" )
111
111
obj = conn .getObject (obj_type , obj_id )
112
112
obj .linkAnnotation (file_ann )
113
113
return file_ann .getId ()
0 commit comments