Skip to content

Commit

Permalink
WIP working front-end
Browse files Browse the repository at this point in the history
  • Loading branch information
aschampion committed Nov 29, 2016
1 parent 2c56e87 commit 3e07d18
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 24 deletions.
2 changes: 1 addition & 1 deletion django/applications/catmaid/control/data_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def get_data_view( request, data_view_id ):
# Build a stack group index, if stack groups should be made available
stackgroup_index = defaultdict(list)
stackgroups_of = defaultdict(list)
if show_stackgroups:
if False and show_stackgroups:
# Get all
stackgroups = StackGroup.objects.filter(project__in=projects)
for sg in stackgroups:
Expand Down
30 changes: 11 additions & 19 deletions django/applications/catmaid/static/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -1157,12 +1157,19 @@ var project;
var useExistingViewer = typeof stackViewer !== 'undefined';
var labelupload = '';

if( e.hasOwnProperty('labelupload_url') && e.tile_source_type === 2 ) {
var selectedMirrorIdx = 0;
var selectedMirror = e.mirrors[selectedMirrorIdx];

if( e.hasOwnProperty('labelupload_url') && selectedMirror.tile_source_type === 2 ) {
labelupload = e.labelupload_url;
}

var tilesource = CATMAID.getTileSource(e.tile_source_type,
e.image_base, e.file_extension, e.tile_width, e.tile_height);
var tilesource = CATMAID.getTileSource(
selectedMirror.tile_source_type,
selectedMirror.image_base,
selectedMirror.file_extension,
selectedMirror.tile_width,
selectedMirror.tile_height);

var stack = new CATMAID.Stack(
e.sid,
Expand All @@ -1174,7 +1181,7 @@ var project;
e.num_zoom_levels,
-2,
labelupload, // TODO: if there is any
e.metadata,
e.description,
e.orientation,
tilesource );

Expand All @@ -1200,21 +1207,6 @@ var project;
if (!useExistingViewer) {
stackViewer.addLayer( "TileLayer", tilelayer );

$.each(e.overlay, function(key, value) {
var tilesource = CATMAID.getTileSource( value.tile_source_type,
value.image_base, value.file_extension, value.tile_width, value.tile_height );
var layer_visibility = parseInt(value.default_opacity) > 0;
var tilelayer2 = new tilelayerConstructor(
stackViewer,
value.title,
stack,
tilesource,
layer_visibility,
value.default_opacity / 100,
false);
stackViewer.addLayer( value.title, tilelayer2 );
});

project.addStackViewer( stackViewer );

// refresh the overview handler to also register the mouse events on the buttons
Expand Down
4 changes: 2 additions & 2 deletions django/applications/catmaid/static/js/stack-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@
this._view.appendChild( this._horr );
this.showReferenceLines(StackViewer.Settings.session.display_stack_reference_lines);

if (primaryStack.metadata.length > 0) {
this.addLayer('Stack metadata', new CATMAID.MetadataLayer(this, primaryStack.metadata));
if (primaryStack.description.length > 0) {
this.addLayer('Stack description', new CATMAID.MetadataLayer(this, primaryStack.description));
}
}

Expand Down
4 changes: 2 additions & 2 deletions django/applications/catmaid/static/js/stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
num_zoom_levels, //!< {int} that defines the number of available non-artificial zoom levels
max_zoom_level, //!< {int} that defines the maximum available zoom level
labelupload_url, //!< {String} that defines the label upload URL for labels (for tile_source_type==2)
metadata, //!< {String} of arbitrary meta data
description, //!< {String} of arbitrary meta data
orientation, //!< {Integer} orientation (0: xy, 1: xz, 2: yz)
tileSource
) {
Expand Down Expand Up @@ -70,7 +70,7 @@
self.MIN_S = max_zoom_level;

self.labelupload_url = labelupload_url;
this.metadata = metadata;
this.description = description;
self.orientation = orientation;
self.tileSource = tileSource;

Expand Down

0 comments on commit 3e07d18

Please sign in to comment.