$(document).ready(function () {
$.ajaxSettings.cache = false;
});
var viewport;
var show_rois = function() {
var theT = viewport.getTPos();
var theZ = viewport.getZPos();
if (!viewport.viewportimg.get(0).show_rois) {
var options = {'width':viewport.loadedImg.size.width,
'height':viewport.loadedImg.size.height,
'json_url':'https://learning.openmicroscopy.org/dundee/webgateway/get_rois_json/'+viewport.loadedImg.id};
if (viewport.loadedImg.tiles) {
options['tiles'] = true;
}
viewport.viewportimg.roi_display(options);
viewport.viewportimg.get(0).setRoiZoom(viewport.viewportimg.get(0).getZoom());
}
// loads ROIs (if needed) and shows.
viewport.viewportimg.get(0).show_rois(theZ, theT);
}
var refresh_rois = function () {
// re-plots the ROIs (if currently shown) for new Z and T position
if (viewport.viewportimg.get(0).refresh_rois) {
var theT = viewport.getTPos();
var theZ = viewport.getZPos();
viewport.viewportimg.get(0).refresh_rois(theZ, theT);
}
}
var hide_rois = function() {
// hides the display of ROIs.
if (viewport.viewportimg.get(0).hide_rois) {
viewport.viewportimg.get(0).hide_rois();
}
}
var show_scalebar = function () {
if (!viewport.viewportimg.get(0).show_scalebar) {
// if the Scalebar plugin has not been initialised (method not available...) init and load Scalebar...
var options = {'pixSizeX': viewport.getPixelSizes().x,
'imageWidth': viewport.getSizes().width};
if (viewport.loadedImg.tiles) {
options['tiles'] = true;
}
viewport.viewportimg.scalebar_display(options);
}
viewport.viewportimg.get(0).setScalebarZoom(viewport.getZoom()/100 );
viewport.viewportimg.get(0).show_scalebar();
}
var hide_scalebar = function () {
viewport.viewportimg.get(0).hide_scalebar();
}
var _imageLoad = function (ev,...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.