@@ -14,15 +14,9 @@ class DashVolumeSlicer:
14
14
app (dash.Dash): the Dash application instance.
15
15
volume (ndarray): the 3D numpy array to slice through.
16
16
axis (int): the dimension to slice in. Default 0.
17
- <<<<<<< HEAD
18
17
scene_id (str): the scene that this slicer is part of. Slicers
19
18
that have the same scene-id show each-other's positions with
20
19
line indicators. By default this is a hash of ``id(volume)``.
21
- =======
22
- volume_id (str): the id to use for the volume. By default this is a
23
- hash of ``id(volume)``. Slicers that have the same volume-id show
24
- each-other's positions with line indicators.
25
- >>>>>>> Implement indicators
26
20
27
21
This is a placeholder object, not a Dash component. The components
28
22
that make up the slicer can be accessed as attributes:
@@ -35,26 +29,16 @@ class DashVolumeSlicer:
35
29
Each component is given a dict-id with the following keys:
36
30
37
31
* "context": a unique string id for this slicer instance.
38
- <<<<<<< HEAD
39
32
* "scene": the scene_id.
40
33
* "axis": the int axis.
41
34
* "name": the name of the (sub) component.
42
- =======
43
- * "volume": the volume_id.
44
- * "axis": the int axis.
45
- * "name": the name of the component.
46
- >>>>>>> Implement indicators
47
35
48
36
TODO: iron out these details, list the stores that are public
49
37
"""
50
38
51
39
_global_slicer_counter = 0
52
40
53
- < << << << HEAD
54
41
def __init__ (self , app , volume , axis = 0 , scene_id = None ):
55
- == == == =
56
- def __init__ (self , app , volume , axis = 0 , volume_id = None ):
57
- >> >> >> > Implement indicators
58
42
if not isinstance (app , Dash ):
59
43
raise TypeError ("Expect first arg to be a Dash app." )
60
44
self ._app = app
@@ -67,7 +51,6 @@ def __init__(self, app, volume, axis=0, volume_id=None):
67
51
raise ValueError ("The given axis must be 0, 1, or 2." )
68
52
self ._axis = int (axis )
69
53
# Check and store id
70
- < << << << HEAD
71
54
if scene_id is None :
72
55
scene_id = "volume_" + hex (id (volume ))[2 :]
73
56
elif not isinstance (scene_id , str ):
@@ -76,16 +59,6 @@ def __init__(self, app, volume, axis=0, volume_id=None):
76
59
# Get unique id scoped to this slicer object
77
60
DashVolumeSlicer ._global_slicer_counter += 1
78
61
self .context_id = "slicer_" + str (DashVolumeSlicer ._global_slicer_counter )
79
- == == == =
80
- if volume_id is None :
81
- volume_id = hex (id (volume ))
82
- elif not isinstance (volume_id , str ):
83
- raise TypeError ("volume_id must be a string" )
84
- self .volume_id = volume_id
85
- # Get unique id scoped to this slicer object
86
- DashVolumeSlicer ._global_slicer_counter += 1
87
- self .context_id = "slicer" + str (DashVolumeSlicer ._global_slicer_counter )
88
- >> >> >> > Implement indicators
89
62
90
63
# Get the slice size (width, height), and max index
91
64
arr_shape = list (volume .shape )
@@ -164,11 +137,7 @@ def _subid(self, name):
164
137
# todo: is there a penalty for using a dict-id vs a string-id?
165
138
return {
166
139
"context" : self .context_id ,
167
- << << << < HEAD
168
140
"scene" : self .scene_id ,
169
- == == == =
170
- "volume-id" : self .volume_id ,
171
- >> >> >> > Implement indicators
172
141
"axis" : self ._axis ,
173
142
"name" : name ,
174
143
}
@@ -248,7 +217,6 @@ def _create_client_callbacks(self):
248
217
let x0 = 0, y0 = 0, dx = 1, dy = 1;
249
218
//slice_cache[new_index] = undefined; // todo: disabled cache for now!
250
219
// Maybe we do not need an update
251
- console.log(slice_size)
252
220
if (!data) {
253
221
data = lowres[index];
254
222
// Scale the image to take the exact same space as the full-res
@@ -319,22 +287,14 @@ def _create_client_callbacks(self):
319
287
y: y,
320
288
hoverinfo: 'skip',
321
289
version: version
322
- <<<<<<< HEAD
323
290
};
324
- =======
325
- }
326
- >>>>>>> Implement indicators
327
291
}
328
292
""" ,
329
293
Output (self ._subid ("_indicators" ), "data" ),
330
294
[
331
295
Input (
332
296
{
333
- << << << < HEAD
334
297
"scene" : self .scene_id ,
335
- == == == =
336
- "volume-id" : self .volume_id ,
337
- >> >> >> > Implement indicators
338
298
"context" : ALL ,
339
299
"name" : "index" ,
340
300
"axis" : axis ,
0 commit comments