Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/big image roi #16

Merged
merged 32 commits into from
Nov 17, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b14a5ec
Display of shape text in web ROI table. See #6812
Sep 21, 2011
5531616
Collapse the ROI-shape hierarchy if only 1 shape per ROI. See #6812
Sep 21, 2011
ac10af5
Improving layout of ROI table in web. See #6832
Sep 21, 2011
ccefdfa
Small fixes to web ROI table. See #6832
Sep 21, 2011
d67e0d8
Mostly working roi thumbnails. Need to handle edge cases and big images.
Sep 23, 2011
44b3e0f
Roi thumbs line colour and display in table for Big images.
Sep 26, 2011
6f0315f
Roi-thumbnail zoom on mouse-over.
Oct 13, 2011
a3c4b0e
Web roi thumbnails handle regions outside image. See #6166
Oct 14, 2011
650b49e
Handle clicks on roi_thumbnails
Oct 20, 2011
7a0909d
roi support on big image viewer, see #6578
atarkowska Oct 20, 2011
a4ed3b7
Merge branch 'feature/6166_web_rois' into feature/big_image_roi
atarkowska Oct 20, 2011
c129e02
Selecting ROI shape returns centre positon: x, y.
Oct 20, 2011
95d2ea7
highlighting object by clicking on it; choosing object moves viewer t…
atarkowska Oct 20, 2011
e33e41f
Fix several small roi_thumb issues, line-colour picker
Oct 20, 2011
fdc9ccc
Removing console.log
Oct 20, 2011
583eb07
Adding scroll-bars to ROI table
Oct 25, 2011
8705183
Allow toggle of ROI thumbnails display. See #7091
Oct 25, 2011
d6d1636
Don't zoom in on ROI thumbnails for small ROIs. See #7091
Oct 25, 2011
3468c95
replacing mouse cursor, close #7096
atarkowska Oct 25, 2011
2a2f803
adding exclusion for big image viewer in handleShapeRowClick
atarkowska Oct 25, 2011
23357de
Fixing bug with ROI BBox() not found for multi-Z image.
Oct 26, 2011
56510e2
Adding shape icons to ROI table
Oct 26, 2011
b74dcb0
Adding Z and T ranges to ROI row of table
Oct 26, 2011
e13b075
Fixing ROI thumbnails: padding colour and polyline
Oct 26, 2011
63a009d
ROI table scrolls without losing header
Oct 27, 2011
15c0bab
Adding Shape_thumbnails into ROI table.
Oct 27, 2011
35f1c85
Workaround bug with text-shape selection coordinates
Oct 28, 2011
fda1873
Fixing IE error with scaling in panojs control_roi.js
Oct 31, 2011
edbd443
Small fix to ROI table row color IE bug.
Nov 1, 2011
130055d
Removing 'fill' of text shapes on deselection.
Nov 1, 2011
05b1eda
Handle web ROI thumbnails over max image size
Nov 3, 2011
6cdfd87
Removing print statements
Nov 4, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
position: relative;
top: 0;
left: 0;
background-color: #434343;
background-color: #DDD;
overflow: hidden;

/* NOTE: the size and width should be set dynamically when initialized */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,6 @@ INPUT.changed {
/* max-width: 600px; */
}

#roi_table_postit {
width:175px;
}
#roi_table_postit table {
width: 100%;
}
Expand Down Expand Up @@ -630,17 +627,46 @@ input.spin-button {
}

/* Styles for the ROI table */
#roi_table_postit {
width:320px;
}
#roi_table_div {
overflow-y: scroll;
max-height: 500px;
}
#roi_small_table th {
background-color: #ccc;
padding: 1px;
}
#roi_small_table td {
background-color: #fff;
background-color: #fff;
text-align: center;
}
#roi_small_table td.icon {
background-color: #fff;
text-align: left;
white-space: nowrap;
width: 50px;
}
#roi_small_table .only_child td {
background-color: #ddd;
}

#roi_small_table .shape_cell {
cursor: pointer;
position: relative;
}
#roi_small_table .roi_row th {
cursor: pointer;
position: relative;
}
#roi_thumb_popup {
position: absolute;
z-index: 250;
display: none;
}
.color_picker_option {
float: left;
width: 8px;
height: 10px;
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
PanoJS.CONTROL_ROI_STYLE = "position: absolute;";

function ROIControl(viewer) {
this.viewer = viewer;
this.createDOMElements();

this.scale = 1;
this.x = 0;
this.y = 0;
this.width = 0;
this.height = 0;

this.viewer.addViewerMovedListener(this);
this.viewer.addViewerZoomedListener(this);
this.viewer.addViewerResizedListener(this);

// load thumbnail image
this.init();
}


ROIControl.prototype.init = function() {
this.updateDOMElements();
this.viewer.notifyViewerZoomed();
}

ROIControl.prototype.createDOMElements = function() {
var de = this.viewer.surface;

this.dom_element = document.createElement('div');
this.dom_element.id = 'roi_canvas_big';
this.dom_element.className = 'roi_canvas_big';
this.dom_element.setAttribute("style", PanoJS.CONTROL_ROI_STYLE);
de.appendChild(this.dom_element);

}

ROIControl.prototype.updateDOMElements = function() {
var cur_size = this.viewer.currentImageSize();
this.width = cur_size.width;
this.height = cur_size.height;

this.dom_element.style.width = this.width + 'px';
this.dom_element.style.height = this.height + 'px';
this.dom_element.style.left = this.x + 'px';
this.dom_element.style.top = this.y + 'px';
}

ROIControl.prototype.viewerMoved = function(e) {
if (!this.dom_element || typeof this.dom_element == 'undefined') return;
this.x = e.x;
this.y = e.y;
this.updateDOMElements();

//notify the viewer
var vp = $.WeblitzViewport('#weblitz-viewport');
var theT = vp.getTPos();
var theZ = vp.getZPos();

if (vp.viewportimg.get(0).refresh_rois) {
vp.viewportimg.get(0).setRoiZoom(this.scale*100);
}
if (vp.viewportimg.get(0).setRoiZoom) {
vp.viewportimg.get(0).refresh_rois(theZ, theT);
}
}

ROIControl.prototype.viewerZoomed = function(e) {
this.scale = e.scale;
this.viewerMoved(e);
}

ROIControl.prototype.viewerResized = function(e) {
this.viewerMoved(e);
}


Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,11 @@ $.fn.viewportImage = function(options) {
}
});

this.getBigImageContainer = function () {
return viewerBean;
}

this.setUpTiles = function (imagewidth, imageheight, xtilesize, ytilesize, init_zoom, levels, href, thref) {
$('<div id="weblitz-viewport-tiles" class="viewer" style="width: 100%; height: 100%;" ></div>').appendTo(wrapdiv);
jQuery('#weblitz-viewport-tiles').css({width: wrapwidth, height: wrapheight});
var myPyramid = new BisqueISPyramid( imagewidth, imageheight, xtilesize, ytilesize);
var myProvider = new PanoJS.TileUrlProvider('','','');
myProvider.assembleUrl = function(xIndex, yIndex, zoom) {
Expand All @@ -426,6 +428,8 @@ $.fn.viewportImage = function(options) {
myProvider.thumbnailUrl(thref);

if (viewerBean == null) {
$('<div id="weblitz-viewport-tiles" class="viewer" style="width: 100%; height: 100%;" ></div>').appendTo(wrapdiv);
jQuery('#weblitz-viewport-tiles').css({width: wrapwidth, height: wrapheight});

viewerBean = new PanoJS('weblitz-viewport-tiles', {
tileUrlProvider : myProvider,
Expand All @@ -439,6 +443,38 @@ $.fn.viewportImage = function(options) {
loadingTile : '/appmedia/webgateway/img/3rdparty/panojs/blank.gif'//'progress.gif'
});

viewerBean.mouseReleasedHandler = function(e) {
e = e ? e : window.event;
if (!this.pressed) return false;
var coords = this.resolveCoordinates(e);
var motion = {
'x' : (coords.x - this.mark.x),
'y' : (coords.y - this.mark.y)
};
var moved = this.mouse_have_moved;
this.release(coords);

if (!moved) return false;


// only if there was little movement
if (moved || motion.x>5 || motion.y>5) return false;

if (e.button == 2) {
this.blockPropagation(e);
this.zoom(-1);
} else
// move on one click
if (e.button < 2) {
//if (!this.pointExceedsBoundaries(coords)) {
this.resetSlideMotion();
this.recenter(coords);
//}
}

return false;
}

// thumbnail url overwritten
// bird-eye view cannot relay on levels in order to load thumbail,
// becuase of the way pyramid is generated.
Expand All @@ -456,14 +492,14 @@ $.fn.viewportImage = function(options) {
PanoJS.MSG_BEYOND_MIN_ZOOM = null;
PanoJS.MSG_BEYOND_MAX_ZOOM = null;
viewerBean.init();
if (this.thumbnail_control) this.thumbnail_control.update();
if (viewerBean.thumbnail_control) viewerBean.thumbnail_control.update();
if (!viewerBean.roi_control) viewerBean.roi_control = new ROIControl(viewerBean);

// not supported elements
jQuery('#wblitz-zoom').parent().hide();
jQuery('#wblitz-lp-enable').parent().hide();
jQuery('.multiselect').hide();
jQuery('#wblitz-invaxis').attr('disable', true);
jQuery('#roi_controls').hide();
} else {
viewerBean.tileUrlProvider = myProvider;
viewerBean.update_url();
Expand All @@ -479,7 +515,7 @@ $.fn.viewportImage = function(options) {
wrapwidth = wrapdiv.width();
wrapheight = wrapdiv.height();
//orig_width = image.get(0).clientWidth;
//orig_height = image.get(0).clientHeight;
//orig_height = image.get(0).clientHeight;

if (viewerBean != null) {
jQuery('#weblitz-viewport-tiles').css({width: wrapwidth, height: wrapheight});
Expand Down