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

4-3-3 fixes. #2

Merged
merged 30 commits into from
Oct 18, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2ed3a26
Turning off Volume Viewer for multi-C images. See #6919
Oct 6, 2011
d67000f
Allow user to configure Open-Astex viewer parameters. See #6919
Oct 7, 2011
609f3f2
UI changes to Web scripting results (not AJAX yet). See #6925
Oct 10, 2011
84d90f5
Fix comments ordering in web: latest comment at top.
Oct 10, 2011
c9b26aa
Web script results handles AJAX to show err, info etc. See #6925
Oct 10, 2011
69b02ad
Renaming 'STATUS' link to 'ACTIVITIES' in web toolbar. See #6925
Oct 10, 2011
5b591aa
Truncating of script result names if > 30 chars. See #6925
Oct 10, 2011
095bcbd
Error in running script gives 'Failure' link to submit bug. See #6925
Oct 10, 2011
9b46020
Web Activities window is smaller and centred on screen. See #6925
Oct 12, 2011
ca2162f
Removing old status.html page. No longer used.
Oct 12, 2011
91ca374
Web 'Activities' window refreshes on runScript() callback. See #6964
Oct 12, 2011
3eab5d3
Web toolbar ACTIVITIES updates immediately. '0 jobs' if none running.…
Oct 12, 2011
1685fb9
Web script 'failure' doesn't allow 'Submit'. See #6925
Oct 13, 2011
e6d6522
Removing 'console.log' from header.html
Oct 13, 2011
0329053
Setting the OPEN_ASTEX_MAX_VOXELS to 300*300*300 by default
Oct 13, 2011
e7fc6f7
Removing Open Astex Viewer resize-map option. See #6379
Oct 13, 2011
d5378a6
Fixing various IE8 bugs in web scripting. See #6925
Oct 14, 2011
ea1caf0
Changing order of parameters in Channel_Offsets.py
Oct 14, 2011
e5135ad
Web scripts Activities window pop-up blocker workaround. See #6925
Oct 15, 2011
3a971c4
Script failure updates 'Activities' toolbar. See #6925
Oct 17, 2011
30e19b8
Webclient window handles 'Activities' window refresh. See #6925
Oct 17, 2011
aa72be3
Merge branch 'develop' of ssh://git.openmicroscopy.org/home/git/ome i…
Oct 17, 2011
6fd28b8
Fix initial setting of webclient_window when opening Activities from …
Oct 17, 2011
0bbbbd7
Use AJAX to refresh Activities window
Oct 17, 2011
685c7c8
Re-organisation to get refresh working correctly.
chris-allan Oct 17, 2011
bbc0d95
Fix to size of temp image_as_map file.
Oct 17, 2011
de2a19f
Merge branch 'for_will' of git://github.com/chris-allan/openmicroscop…
Oct 17, 2011
85910d8
Removing lots of console.log() statements.
Oct 17, 2011
b3ac3ab
Closing script_ui after runScript() and improving 'Activities' open &…
Oct 17, 2011
6e5acd9
Mini fix to <info> and <error> display by AJAX in Activities window.
Oct 18, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -230,57 +230,57 @@ def runAsScript():
scripts.List("IDs", optional=False, grouping="2",
description="List of Dataset IDs or Image IDs to process.").ofType(rlong(0)),

scripts.Bool("Channel_1", grouping="3", default=True,
scripts.String("New_Dataset_Name", grouping="3",
description="If you want the new image(s) in a new Dataset, put name here"),

scripts.Bool("Channel_1", grouping="4", default=True,
description="Choose to include this channel in the output image"),

scripts.Int("Channel1_X_shift", grouping="3.1", default=0,
scripts.Int("Channel1_X_shift", grouping="4.1", default=0,
description="Number of pixels to shift this channel in the X direction. (negative to shift left)"),

scripts.Int("Channel1_Y_shift", grouping="3.2", default=0,
scripts.Int("Channel1_Y_shift", grouping="4.2", default=0,
description="Number of pixels to shift this channel in the Y direction. (negative to shift up)"),

scripts.Int("Channel1_Z_shift", grouping="3.3", default=0,
scripts.Int("Channel1_Z_shift", grouping="4.3", default=0,
description="Offset channel by a number of Z-sections"),

scripts.Bool("Channel_2", grouping="4", default=True,
scripts.Bool("Channel_2", grouping="5", default=True,
description="Choose to include this channel in the output image"),

scripts.Int("Channel2_X_shift", grouping="4.1", default=0,
scripts.Int("Channel2_X_shift", grouping="5.1", default=0,
description="Number of pixels to shift this channel in the X direction. (negative to shift left)"),

scripts.Int("Channel2_Y_shift", grouping="4.2", default=0,
scripts.Int("Channel2_Y_shift", grouping="5.2", default=0,
description="Number of pixels to shift this channel in the Y direction. (negative to shift up)"),

scripts.Int("Channel2_Z_shift", grouping="4.3", default=0,
scripts.Int("Channel2_Z_shift", grouping="5.3", default=0,
description="Offset channel by a number of Z-sections"),

scripts.Bool("Channel_3", grouping="5", default=False,
scripts.Bool("Channel_3", grouping="6", default=False,
description="Choose to include this channel in the output image"),

scripts.Int("Channel3_X_shift", grouping="5.1", default=0,
scripts.Int("Channel3_X_shift", grouping="6.1", default=0,
description="Number of pixels to shift this channel in the X direction. (negative to shift left)"),

scripts.Int("Channel3_Y_shift", grouping="5.2", default=0,
scripts.Int("Channel3_Y_shift", grouping="6.2", default=0,
description="Number of pixels to shift this channel in the Y direction. (negative to shift up)"),

scripts.Int("Channel3_Z_shift", grouping="5.3", default=0,
scripts.Int("Channel3_Z_shift", grouping="6.3", default=0,
description="Offset channel by a number of Z-sections"),

scripts.Bool("Channel_4", grouping="6", default=False,
scripts.Bool("Channel_4", grouping="7", default=False,
description="Choose to include this channel in the output image"),

scripts.Int("Channel4_X_shift", grouping="6.1", default=0,
scripts.Int("Channel4_X_shift", grouping="7.1", default=0,
description="Number of pixels to shift this channel in the X direction. (negative to shift left)"),

scripts.Int("Channel4_Y_shift", grouping="6.2", default=0,
scripts.Int("Channel4_Y_shift", grouping="7.2", default=0,
description="Number of pixels to shift this channel in the Y direction. (negative to shift up)"),

scripts.Int("Channel4_Z_shift", grouping="6.3", default=0,
scripts.Int("Channel4_Z_shift", grouping="7.3", default=0,
description="Offset channel by a number of Z-sections"),

scripts.String("New_Dataset_Name", grouping="7",
description="If you want the new image(s) in a new Dataset, put name here"),

version = "4.2.0",
authors = ["William Moore", "OME Team"],
institutions = ["University of Dundee"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ function openPopup(url) {
return false;
}

var activitiesWindow = null;

function popupActivites(url) {
// IE8 doesn't support arbitrary text for 'name' 2nd arg. #6118
activitiesWindow = window.open(url, 'Activities', config='height=600,width=850,left=50,top=50,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no');
var w = 650;
var h = 400;
var left = parseInt((screen.availWidth/2) - (w/2));
var top = parseInt((screen.availHeight - h)/3);
var activitiesWindow = window.open(url, 'Activities', config='height='+h+',width='+w+',left='+left+',top='+top+',toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no');
if(!activitiesWindow.closed) activitiesWindow.focus();
return false;
}
function refreshActivitiesWindow(url) {
if (activitiesWindow != undefined) {
if(!activitiesWindow.closed) activitiesWindow.location.href = url;
}
return activitiesWindow;
}


function openCenteredWindow(url) {
var width = 550;
var height = 600;
Expand Down
5 changes: 5 additions & 0 deletions components/tools/OmeroWeb/omeroweb/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ def leave_none_unset(s):
"omero.web.server_email": ["SERVER_EMAIL", None, identity],
"omero.web.server_list": ["SERVER_LIST", '[["localhost", 4064, "omero"]]', json.loads],
"omero.web.use_eman2": ["USE_EMAN2", "false", parse_boolean],
# the following parameters configure when to show/hide the 'Volume viewer' icon in the Image metadata panel
"omero.web.open_astex_max_side": ["OPEN_ASTEX_MAX_SIDE", 400, int],
"omero.web.open_astex_min_side": ["OPEN_ASTEX_MIN_SIDE", 20, int],
"omero.web.open_astex_max_voxels": ["OPEN_ASTEX_MAX_VOXELS", 27000000, int], # 300 x 300 x 300

"omero.web.scripts_to_ignore": ["SCRIPTS_TO_IGNORE", '["/omero/figure_scripts/Movie_Figure.py", "/omero/figure_scripts/Split_View_Figure.py", "/omero/figure_scripts/Thumbnail_Figure.py", "/omero/figure_scripts/ROI_Split_Figure.py", "/omero/export_scripts/Make_Movie.py"]', parse_paths],
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,24 +143,29 @@ def openAstexViewerCompatible(self):
Is the image suitable to be viewed with the Volume viewer 'Open Astex Viewer' applet?
Image must be a 'volume' of suitable dimensions and not too big.
"""
MIN_Z = 20
from django.conf import settings
MAX_SIDE = settings.OPEN_ASTEX_MAX_SIDE # default is 400
MIN_SIDE = settings.OPEN_ASTEX_MIN_SIDE # default is 20
MAX_VOXELS = settings.OPEN_ASTEX_MAX_VOXELS # default is 15625000 (250 * 250 * 250)

MAX_VOL = (400 * 400 * 400)
print "Max side, min side, max voxels", MAX_SIDE, MIN_SIDE, MAX_VOXELS
if self.image is None:
return False
sizeZ = self.image.getSizeZ()
if sizeZ < MIN_Z: return False
if self.image.getSizeC() > 1: return False
sizeX = self.image.getSizeX()
sizeY = self.image.getSizeY()
if sizeZ < MIN_SIDE or sizeX < MIN_SIDE or sizeY < MIN_SIDE: return False
if sizeX > MAX_SIDE or sizeY > MAX_SIDE or sizeZ > MAX_SIDE: return False
voxelCount = (sizeX * sizeY * sizeZ)
if voxelCount > MAX_VOL: return False
if voxelCount > MAX_VOXELS: return False

try: # if scipy ndimage is not available for interpolation, can only handle smaller images
import scipy.ndimage
except ImportError:
logger.debug("Failed to import scipy.ndimage - Open Astex Viewer limited to display of smaller images.")
MAX_VOL = (160 * 160 * 160)
if voxelCount > MAX_VOL: return False
MAX_VOXELS = (160 * 160 * 160)
if voxelCount > MAX_VOXELS: return False

return True

Expand Down Expand Up @@ -419,7 +424,7 @@ def annotationList(self):
else:
annTypes[annClass].append(ann)

self.text_annotations.sort(key=lambda x: x.creationEventDate())
self.text_annotations.sort(key=lambda x: x.creationEventDate(), reverse=True)
self.file_annotations.sort(key=lambda x: x.creationEventDate())
self.rating_annotations.sort(key=lambda x: x.creationEventDate())
self.tag_annotations.sort(key=lambda x: x.textValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,15 @@ <h3>{{ image.getName|slice:":20" }}</h3>
<!-- {% if pixelRange %} ({{ pixelRange.0|floatformat:4 }} - {{ pixelRange.1|floatformat:4 }}) {% endif %} -->
<hr />
<form onsubmit="return false">
Map Size:
<div id="data_urls">
Map Size: {{ image.getSizeX }} x {{ image.getSizeY }} x {{ image.getSizeZ }}
{% if sizeOptions.small %}
<div>
(scaled to: {{ sizeOptions.small.x|floatformat:0 }} x {{ sizeOptions.small.y|floatformat:0 }} x {{ sizeOptions.small.z|floatformat:0 }})
</div>

{% endif %}
<!-- Hiding resize options for now - Not performing as expected -->
<div id="data_urls" style="display:none">
{% if sizeOptions.small %}
<div>
<input type="radio" name="sizeMap" checked="true" value="small" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,43 @@

{% ifnotequal nav.menu "status" %}
<script>

var launchActivities = function() {
activities_Window = popupActivites('{% url status %}');
}

// this is called by the setInterval loop below
var progressAjaxUpdate = function(i) {
$.ajaxSetup({ cache: false }); // IE8 etc caches json by default
$.getJSON("{% url progress %}", function(data) {
if (data.inprogress==0) {
if (i != undefined) clearInterval(i);
$("#progress").hide();
$("#jobstatus").html(data.inprogress + ' job(s) in progress');
if(data.failure>0) {
$("#jobstatus").html(data.failure + ' job(s) failed');
} else {
$("#jobstatus").html('0 job(s)');
} return;
}
$("#progress").show();
$("#jobstatus").html(data.inprogress + ' job(s) in progress');
$.ajaxSetup({ cache: true });
});
}

var refreshProgressBar = function() {
refreshActivitiesWindow('{% url status %}');
if (window.activities_Window) {
if (window.activities_Window.refresh_page) {
window.activities_Window.refresh_page();
};
window.activities_Window.webclient_window = window;
//activities_Window.testBrowseParent();
}
progressAjaxUpdate();
var i = setInterval(function (){
$.getJSON("{% url progress %}", function(data) {
if (data.inprogress==0) {
clearInterval(i);
$("#progress").hide();
if(data.failure>0) {
$("#jobstatus").html(data.failure + ' job(s) failed');
} else {
$("#jobstatus").html(data.jobs + ' job(s)');
} return;
}
$("#progress").show();
$("#jobstatus").html(data.inprogress + ' job(s) in progress');
});
}, 10000);
progressAjaxUpdate(i);
}, 5000);
}
$(document).ready(function() {
refreshProgressBar();
Expand All @@ -54,7 +73,7 @@
{% endifnotequal %}
{% ifnotequal nav.menu "status" %}
<div id="queue">
<a href="#" onClick="popupActivites('{% url status %}');" class="align_left">STATUS:</a>
<a href="#" onClick="launchActivities();" class="align_left">ACTIVITIES:</a>
<div id="jobstatus">0 job(s)</div>
<img src="{% url webstatic "images/spinner.gif" %}" id="progress" style="display: none;"/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,44 +39,55 @@
<link rel="stylesheet" href="{% url webstatic "css/tooltip.css" %}" type="text/css" media="screen"/>

<script type="text/javascript">
jQuery.fn.runScript = function() {
jQuery.fn.runScript = function(actWindow) {
var $form = $(this);
var postData = $form.serialize();
var actionUrl = $form.attr('action');
var actionUrl="{% url script_run paramData.id %}";
$.ajaxSetup({ cache: false });
$.ajax({
type: "POST",
url: actionUrl,
data: postData,
contentType:'json',
success: function(data){
$.ajaxSetup({ cache: true });
if(data.status == 'in progress') {
// we don't try to open 'Activities' window here, since it triggers popup blockers
window.opener.refreshProgressBar();
window.opener.refreshProgressBar(); // also refreshes Activities window
self.close();
}
else {
// error is stored in http session - displayed in 'Activities' window.
window.opener.refreshProgressBar(); // also refreshes Activities window
self.close();
}
},
error: function(data) {
window.opener.refreshProgressBar();
self.close();
}
});
return false;
};


$(document).ready(function() {
$('form').submit(function() {
$("#submit").attr("disabled", true); // make sure we don't submit twice.
$(this).runScript();
$("#submit").click(function(e){
window.open('', 'Activities').close();

var actWindow = popupActivites('{% url status %}');
window.opener.activities_Window = actWindow; // allows webclient window to update Activities window
actWindow.webclient_window = window.opener;
$('#script_form').runScript(actWindow);
e.preventDefault();
return false;
});

// if an "existing" window is opened by the window behind this one, we can't focus it...
window.open("", 'Activities').close(); // make sure there is no existing 'Activities' window
window.opener.popupActivites('{% url status %}');
// this simply prevents any attempt to 'submit' the form (default behavior)
$('form').submit(function(e){
e.preventDefault();
return false;
});


// for any 'list' parameters with enum options, controls to add / remove
$(".addListSelect").click(function(e) {
var $lastSelect = $(this).parent().children('select').last();
Expand Down Expand Up @@ -177,7 +188,7 @@

<body>

<form method="post" action="{% url script_run paramData.id %}">
<form id='script_form' method="post">
<div style="padding:10px; margin-bottom:40px">
<h3 id="scriptName">{{ paramData.name }}</h3>
<div id='script_desc'>{{ paramData.description|linebreaks }}
Expand Down
Loading