Skip to content

Commit

Permalink
Merge pull request #40 from will-moore/4-3-4-hotfixes
Browse files Browse the repository at this point in the history
4 3 4 hotfixes
  • Loading branch information
chris-allan committed Feb 6, 2012
2 parents f3e2c1f + a41f1c0 commit 6a7acaa
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
Expand Up @@ -410,7 +410,7 @@ def runScript():

client = scripts.client('Batch_Image_Export.py', """Save multiple images as jpegs or pngs in a zip
file available for download as a batch export.
See http://www.openmicroscopy.org/site/support/omero4/getting-started/tutorial/running-util-scripts""",
See http://www.openmicroscopy.org/site/support/omero4/getting-started/tutorial/running-scripts/running-util-scripts/""",

scripts.String("Data_Type", optional=False, grouping="1",
description="The data you want to work with.", values=dataTypes, default="Image"),
Expand Down
Expand Up @@ -276,15 +276,15 @@ def calculateRanges(sizeZ, sizeT, commandArgs):
if "Plane_Map" not in commandArgs:
zStart = 0
zEnd = sizeZ
if "Z_Start" in commandArgs and commandArgs["Z_Start"] > 0 and commandArgs["Z_Start"] < sizeZ:
if "Z_Start" in commandArgs and commandArgs["Z_Start"] >= 0 and commandArgs["Z_Start"] < sizeZ:
zStart = commandArgs["Z_Start"]
if "Z_End" in commandArgs and commandArgs["Z_End"] > 0 and commandArgs["Z_End"] < sizeZ:
if "Z_End" in commandArgs and commandArgs["Z_End"] >= 0 and commandArgs["Z_End"] < sizeZ and commandArgs["Z_End"] >= zStart:
zEnd = commandArgs["Z_End"]+1
tStart = 0
tEnd = sizeT-1
if "T_Start" in commandArgs and commandArgs["T_Start"] > 0 and commandArgs["T_Start"] < sizeT:
if "T_Start" in commandArgs and commandArgs["T_Start"] >= 0 and commandArgs["T_Start"] < sizeT:
tStart = commandArgs["T_Start"]
if "T_End" in commandArgs and commandArgs["T_End"] > 0 and commandArgs["T_End"] < sizeT:
if "T_End" in commandArgs and commandArgs["T_End"] >= 0 and commandArgs["T_End"] < sizeT and commandArgs["T_End"] >= tStart:
tEnd = commandArgs["T_End"]+1
if(zEnd==zStart):
zEnd=zEnd+1;
Expand Down
Expand Up @@ -165,6 +165,7 @@ def getROIsplitView (re, pixels, zStart, zEnd, splitIndexes, channelNames, me
re.setActive(i, False)

# for each channel in the splitview...
box = (roiX, roiY, roiX+roiWidth, roiY+roiHeight)
for index in splitIndexes:
if index >= sizeC:
channelMismatch = True # can't turn channel on - simply render black square!
Expand All @@ -180,7 +181,6 @@ def getROIsplitView (re, pixels, zStart, zEnd, splitIndexes, channelNames, me
re.setRGBA(index,255,255,255,255) # if not colourChannels - channels are white
info = (channelNames[index], re.getChannelWindowStart(index), re.getChannelWindowEnd(index))
log(" Render channel: %s start: %d end: %d" % info)
box = (roiX, roiY, roiX+roiWidth, roiY+roiHeight)
if proStart == proEnd:
# if it's a single plane, we can render a region (region not supported with projection)
planeDef = omero.romio.PlaneDef()
Expand Down Expand Up @@ -236,7 +236,10 @@ def getROIsplitView (re, pixels, zStart, zEnd, splitIndexes, channelNames, me

if channelMismatch:
log(" WARNING channel mismatch: The current image has fewer channels than the primary image.")


if panelWidth == 0: # E.g. No split-view panels
panelWidth = roiMergedImage.size[0]

# now assemble the roi split-view canvas
font = imgUtil.getFont(fontsize)
textHeight = font.getsize("Textq")[1]
Expand All @@ -248,7 +251,8 @@ def getROIsplitView (re, pixels, zStart, zEnd, splitIndexes, channelNames, me
topSpacer = textHeight + spacer
imageCount = len(renderedImages) + 1 # extra image for merged image
canvasWidth = ((panelWidth + spacer) * imageCount) - spacer # no spaces around panels
canvasHeight = renderedImages[0].size[1] + topSpacer
canvasHeight = roiMergedImage.size[1] + topSpacer
print "imageCount", imageCount, "canvasWidth", canvasWidth, "canvasHeight", canvasHeight
size = (canvasWidth, canvasHeight)
canvas = Image.new(mode, size, white) # create a canvas of appropriate width, height

Expand Down Expand Up @@ -678,14 +682,11 @@ def getTags(name, tagsList, pdList):
for c in range(sizeC):
channelNames[c] = str(c)

# Make split-indexes list. If argument wasn't specified, include them all.
# Make split-indexes list. If no "Split_Indexes", show none: http://www.openmicroscopy.org/community/viewtopic.php?f=4&t=940
splitIndexes = []
if "Split_Indexes" in commandArgs:
for index in commandArgs["Split_Indexes"]:
splitIndexes.append(index.getValue())
else:
for c in range(sizeC):
splitIndexes = range(sizeC)

colourChannels = True
if "Split_Panels_Grey" in commandArgs and commandArgs["Split_Panels_Grey"]:
Expand Down
2 changes: 1 addition & 1 deletion components/tools/OmeroPy/src/omero/gateway/__init__.py
Expand Up @@ -3408,7 +3408,7 @@ def isOriginalMetadata(self):
"""

try:
if self._obj.ns is not None and self._obj.ns.val == omero.constants.namespaces.NSCOMPANIONFILE and self._obj.file.name.val.startswith("original_metadata"):
if self._obj.ns is not None and self._obj.ns.val == omero.constants.namespaces.NSCOMPANIONFILE and self.getFile().getName() == omero.constants.annotation.file.ORIGINALMETADATA:
return True
except:
logger.info(traceback.format_exc())
Expand Down
Expand Up @@ -84,6 +84,7 @@ ThumbnailControl.prototype.init = function() {
this.thumbscale = this.tw / this.viewer.imageSize().width;

this.viewer.notifyViewerZoomed();
this.viewer.notifyViewerMoved();
}

ThumbnailControl.prototype.createDOMElements = function() {
Expand Down Expand Up @@ -170,6 +171,7 @@ ThumbnailControl.prototype.toggleMinimize = function(e) {
}

ThumbnailControl.prototype.viewerMoved = function(e) {
if (this.dom_image.onload) return
if (!this.dom_roi || typeof this.dom_roi == 'undefined') return;
var img_x = -1.0 * (e.x / this.scale);
var img_y = -1.0 * (e.y / this.scale);
Expand Down

0 comments on commit 6a7acaa

Please sign in to comment.