Package omero :: Package util :: Module figureUtil
[hide private]
[frames] | no frames]

Module figureUtil

source code


 components/tools/OmeroPy/src/omero/util/figureUitl.py

-----------------------------------------------------------------------------
  Copyright (C) 2006-2009 University of Dundee. All rights reserved.


  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public License along
  with this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

------------------------------------------------------------------------------

A collection of utility methods used by Figure scripts for producing 
publication type of figures. 

@author  William Moore     
<a href="mailto:will@lifesci.dundee.ac.uk">will@lifesci.dundee.ac.uk</a>
@author  Jean-Marie Burel &nbsp;&nbsp;&nbsp;&nbsp;
<a href="mailto:j.burel@dundee.ac.uk">j.burel@dundee.ac.uk</a>
@author Donald MacDonald &nbsp;&nbsp;&nbsp;&nbsp;
<a href="mailto:donald@lifesci.dundee.ac.uk">donald@lifesci.dundee.ac.uk</a>
@version 3.0
<small>
(<b>Internal version:</b> $Revision: $Date: $)
</small>
@since 3.0-Beta4.1
 

Functions [hide private]
 
getDatasetsProjectsFromImages(queryService, imageIds)
Query returns a map where each key is the imageId and the value is a list of (projectName, datasetName) tuples.
source code
 
getTagsFromImages(metadataService, imageIds)
Query returns a map of key = imageId, value = [tagNames] for the image
source code
 
getTimes(queryService, pixelsId, tIndexes, theZ=None, theC=None)
Get the time in seconds (float) for the first plane (C = 0 & Z = 0) at each time-point for the defined pixels.
source code
 
formatTime(seconds, timeUnits)
Returns a string formatting of the time (in seconds) according to the chosen timeUnits: "SECS_MILLIS", "SECS", "MINS", "HOURS", "MINS_SECS", "HOURS_MINS", HOURS_MINS_SECS, HOURS_MINS_SECS_MILLIS
source code
 
getTimeLabels(queryService, pixelsId, tIndexes, sizeT, timeUnits=None, showRoiDuration=False)
Returns a list of time labels e.g.
source code
Variables [hide private]
  SECS_MILLIS = "SECS_MILLIS"
  SECS = "SECS"
  MINS = "MINS"
  HOURS = "HOURS"
  MINS_SECS = "MINS_SECS"
  HOURS_MINS = "HOURS_MINS"
  HOURS_MINS_SECS = "HOURS_MINS_SECS"
  HOURS_MINS_SECS_MILLIS = "HOURS_MINS_SECS_MILLIS"
  TIME_UNITS = [SECS_MILLIS, SECS, MINS, HOURS, MINS_SECS, HOURS...
Function Details [hide private]

getDatasetsProjectsFromImages(queryService, imageIds)

source code 

Query returns a map where each key is the imageId and the value is a list of (projectName, datasetName) tuples. If the image does not have a Dataset AND Project, the map will hold an empty list for that imageId.

Parameters:
  • queryService - The Omero query service
  • imageIds - A list of image IDs. [long]
Returns:
A map imageId:[(projectName, datasetName)]

getTagsFromImages(metadataService, imageIds)

source code 

Query returns a map of key = imageId, value = [tagNames] for the image

Parameters:
  • metadataService - The Omero metadata service
  • imageIds - A list of image IDs. [long]
Returns:
A map of imageId:[tagName]

getTimes(queryService, pixelsId, tIndexes, theZ=None, theC=None)

source code 

Get the time in seconds (float) for the first plane (C = 0 & Z = 0) at each time-point for the defined pixels. Returns a map of tIndex: timeInSecs

Parameters:
  • queryService - The Omero queryService
  • pixelsId - The ID of the pixels object. long
  • tIndexes - List of time indexes. [int]
  • theZ - The Z plane index. Default is 0
  • theC - The Channel index. Default is 0
Returns:
A map of tIndex: timeInSecs

formatTime(seconds, timeUnits)

source code 

Returns a string formatting of the time (in seconds) according to the chosen timeUnits: "SECS_MILLIS", "SECS", "MINS", "HOURS", "MINS_SECS", "HOURS_MINS", HOURS_MINS_SECS, HOURS_MINS_SECS_MILLIS

Parameters:
  • seconds - Time in seconds. float or int
  • timeUnits - A string denoting the format. One of the choices above.
Returns:
A string, such as "10" or "3:20"

getTimeLabels(queryService, pixelsId, tIndexes, sizeT, timeUnits=None, showRoiDuration=False)

source code 

Returns a list of time labels e.g. "10", "20" for the first plane at each t-index (C=0 and Z=0). If no planeInfo is available, returns plane number/total e.g "3/10" If time units are not specified, the most suitable units are chosen based on the max time. The list of label returned includes the timeUnits as the last string in the list, in case you didn't specify it.

Parameters:
  • queryService - The Omero query service
  • pixelsId - The ID of the pixels you want info for
  • tIndexes - List of t-index to get the times for. Assumed to be in t order.
  • sizeT - The T dimension size of the pixels. Used if no plane info
  • timeUnits - Format choice of "SECS", "MINS", "HOURS", "MINS_SECS", "HOURS_MINS". String
  • showRoiDuration - if true, times shown are from the start of the ROI frames, otherwise use movie timestamp.
Returns:
A list of strings, ordered same as tIndexes

Variables Details [hide private]

TIME_UNITS

Value:
[SECS_MILLIS, SECS, MINS, HOURS, MINS_SECS, HOURS_MINS, HOURS_MINS_SEC\
S, HOURS_MINS_SECS_MILLIS]