Package omero :: Package gateway :: Class _BlitzGateway
[hide private]
[frames] | no frames]

Class _BlitzGateway

source code


Connection wrapper. Handles connecting and keeping the session alive, creation of various services, context switching, security privilidges etc.

Instance Methods [hide private]
 
__init__(self, username=None, passwd=None, client_obj=None, group=None, clone=False, try_super=False, host=None, port=None, extra_config=None, secure=False, anonymous=True, useragent=None)
Create the connection wrapper.
source code
Boolean
isAnonymous(self)
Returns the anonymous flag
source code
 
getProperty(self, k)
Returns named property of the wrapped omero.client
source code
_BlitzGateway
clone(self)
Returns a new instance of this class, with all matching properties.
source code
 
setIdentity(self, username, passwd, _internal=False)
Saves the username and password for later use, creating session etc
source code
_BlitzGateway or None if not admin or username unknown
suConn(self, username, group=None, ttl=60000)
If current user isAdmin, return new connection owned by 'username'
source code
Boolean
keepAlive(self)
Keeps service alive.
source code
 
seppuku(self, softclose=False)
Terminates connection with killSession().
source code
 
_createProxies(self)
Creates proxies to the server services.
source code
 
setSecure(self, secure=True)
Switches between SSL and insecure (faster) connections to Blitz.
source code
 
isSecure(self)
Returns 'True' if the underlying omero.clients.BaseClient is connected using SSL
source code
 
_getSessionId(self) source code
 
_createSession(self)
Creates a new session for the principal given in the constructor.
source code
 
_closeSession(self)
Close session.
source code
 
_resetOmeroClient(self)
Creates new omero.client object using self.host or self.ice_config (if host is None) Also tries to setAgent for the client
source code
 
connect(self, sUuid=None)
Creates or retrieves connection for the given sessionUuid.
source code
 
getLastError(self)
Returns error if thrown by _BlitzGateway.connect connect.
source code
 
isConnected(self)
Returns last status of connection.
source code
omero.sys.EventContext
getEventContext(self)
Returns omero_System_ice.EventContext.
source code
ExperimenterWrapper
getUser(self)
Returns current Experimenter.
source code
 
getGroupFromContext(self)
Returns current omero_model_ExperimenterGroupI.
source code
 
isAdmin(self)
Checks if a user has administration privileges.
source code
 
canBeAdmin(self)
Checks if a user is in system group, i.e.
source code
 
isOwner(self, gid=None)
Checks if a user has owner privileges of a particular group or any group if gid is not specified.
source code
 
canWrite(self, obj)
Checks if a user has write privileges to the given object.
source code
omero.model.session
getSession(self)
Returns the existing session, or creates a new one if needed
source code
Boolean
setGroupNameForSession(self, group)
Looks up the group by name, then delegates to setGroupForSession, returning the result
source code
Boolean
setGroupForSession(self, groupid)
Sets the security context of this connection to the specified group
source code
 
revertGroupForSession(self)
Switches the group to the previous group
source code
 
getAdminService(self)
Gets reference to the admin service from ProxyObjectWrapper.
source code
 
getQueryService(self)
Gets reference to the query service from ProxyObjectWrapper.
source code
 
getContainerService(self)
Gets reference to the container service from ProxyObjectWrapper.
source code
 
getPixelsService(self)
Gets reference to the pixels service from ProxyObjectWrapper.
source code
 
getMetadataService(self)
Gets reference to the metadata service from ProxyObjectWrapper.
source code
 
getRoiService(self)
Gets ROI service.
source code
 
getScriptService(self)
Gets script service.
source code
 
createRawFileStore(self)
Creates a new raw file store.
source code
 
getRepositoryInfoService(self)
Gets reference to the repository info service from ProxyObjectWrapper.
source code
 
getShareService(self)
Gets reference to the share service from ProxyObjectWrapper.
source code
 
getSharedResources(self)
Gets reference to the sharedresources from ProxyObjectWrapper.
source code
 
getTimelineService(self)
Gets reference to the timeline service from ProxyObjectWrapper.
source code
 
getTypesService(self)
Gets reference to the types service from ProxyObjectWrapper.
source code
 
getConfigService(self)
Gets reference to the config service from ProxyObjectWrapper.
source code
 
createRenderingEngine(self)
Creates a new rendering engine.
source code
 
getRenderingSettingsService(self)
Gets reference to the rendering settings service from ProxyObjectWrapper.
source code
 
createRawPixelsStore(self)
Creates a new raw pixels store.
source code
omero.gateway.ProxyObjectWrapper
createThumbnailStore(self)
Gets a reference to the thumbnail store on this connection object or creates a new one if none exists.
source code
 
createSearchService(self)
Gets a reference to the searching service on this connection object or creates a new one if none exists.
source code
 
getUpdateService(self)
Gets reference to the update service from ProxyObjectWrapper.
source code
 
getDeleteService(self)
Gets reference to the delete service from ProxyObjectWrapper.
source code
 
getSessionService(self)
Gets reference to the session service from ProxyObjectWrapper.
source code
 
createExporter(self)
New instance of non cached Exporter, wrapped in ProxyObjectWrapper.
source code
ProjectWrapper list
listProjects(self, eid=None, only_owned=False)
List every Project controlled by the security system.
source code
ProjectWrapper list
listScreens(self, eid=None, only_owned=False)
List every Screens controlled by the security system.
source code
ExperimenterWrapper generator
listGroups(self)
Look up all experimenters and related groups.
source code
ExperimenterGroupWrapper
getDefaultGroup(self, eid)
Retrieve the default group for the given user id.
source code
ExperimenterGroupWrapper generator
getOtherGroups(self, eid)
Fetch all groups of which the given user is a member.
source code
ExperimenterGroupWrapper generator
getGroupsLeaderOf(self)
Look up Groups where current user is a leader of.
source code
ExperimenterGroupWrapper generator
getGroupsMemberOf(self)
Look up Groups where current user is a member of (except "user" group).
source code
ExperimenterWrapper generator
findExperimenters(self, start='')
Return a generator for all Experimenters whose omeName starts with 'start'.
source code
ExperimenterWrapper generator
containedExperimenters(self, gid)
Fetch all users contained in this group.
source code
ExperimenterWrapper generator
listColleagues(self)
Look up users who are a member of the current user active group.
source code
ExperimenterWrapper generator
listStaffs(self)
Look up users who are members of groups lead by the current user.
source code
ExperimenterGroupWrapper generator
listOwnedGroups(self)
Looks up owned groups for the logged user.
source code
Int
getFreeSpace(self)
Returns the free or available space on this file system including nested subdirectories.
source code
ImageWrapper generator
timelineListImages(self, tfrom=None, tto=None, limit=10, only_owned=True)
List images based on their creation times.
source code
 
getObject(self, obj_type, oid=None, params=None, attributes=None)
Retrieve single Object by type E.g.
source code
 
getObjects(self, obj_type, ids=None, params=None, attributes=None)
Retrieve Objects by type E.g.
source code
 
buildQuery(self, obj_type, ids=None, params=None, attributes=None)
Prepares a query for iQuery.
source code
 
listFileAnnotations(self, eid=None, toInclude=[], toExclude=[])
Lists FileAnnotations created by users, filtering by namespaces if specified.
source code
 
getAnnotationLinks(self, parent_type, parent_ids=None, ann_ids=None, ns=None, params=None)
Retrieve Annotation Links by parent_type E.g.
source code
 
createImageFromNumpySeq(self, zctPlanes, imageName, sizeZ=1, sizeC=1, sizeT=1, description=None, dataset=None)
Creates a new multi-dimensional image from the sequence of 2D numpy arrays in zctPlanes.
source code
 
createFileAnnfromLocalFile(self, localPath, origFilePathAndName=None, mimetype=None, ns=None, desc=None)
Class method to create a FileAnnotationWrapper from a local file.
source code
BlitzObjectWrapper generator
getObjectsByAnnotations(self, obj_type, annids)
Retrieve objects linked to the given annotation IDs controlled by the security system.
source code
EnumerationWrapper generator
getEnumerationEntries(self, klass)
Get all enumerations by class
source code
EnumerationWrapper
getEnumeration(self, klass, string)
Get enumeration by class and value
source code
EnumerationWrapper
getEnumerationById(self, klass, eid)
Get enumeration by class and ID
source code
Dict of <string: EnumerationWrapper list >
getOriginalEnumerations(self)
Gets original enumerations.
source code
List of Strings
getEnumerations(self)
Gets list of enumeration types
source code
Dict of <string: EnumerationWrapper list >
getEnumerationsWithEntries(self)
Get enumeration types, with lists of Enum entries
source code
 
deleteEnumeration(self, obj)
Deletes an enumeration object
source code
 
createEnumeration(self, obj)
Create an enumeration with given object
source code
 
resetEnumerations(self, klass)
Resets the enumerations by type
source code
 
updateEnumerations(self, new_entries)
Updates enumerations with new entries
source code
 
deleteObjectDirect(self, obj)
Directly Delete object (removes row from database).
source code
omero.api.delete.DeleteHandle
deleteObjects(self, obj_type, obj_ids, deleteAnns=False, deleteChildren=False)
Generic method for deleting using the delete queue.
source code
 
searchObjects(self, obj_types, text, created=None)
Search objects of type "Project", "Dataset", "Image", "Screen", "Plate" Returns a list of results
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  CONFIG = {}
Holder for class wide configuration properties:
  ICE_CONFIG = None
ICE_CONFIG - Defines the path to the Ice configuration
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, username=None, passwd=None, client_obj=None, group=None, clone=False, try_super=False, host=None, port=None, extra_config=None, secure=False, anonymous=True, useragent=None)
(Constructor)

source code 

Create the connection wrapper. Does not attempt to connect at this stage Initialises the omero.client

Parameters:
  • username (String) - User name. If not specified, use 'omero.gateway.anon_user'
  • passwd (String) - Password.
  • client_obj - omero.client
  • group (String) - name of group to try to connect to
  • clone (Boolean) - If True, overwrite anonymous with False
  • try_super (Boolean) - Try to log on as super user ('system' group)
  • host (String) - Omero server host.
  • port (Integer) - Omero server port.
  • extra_config (Dict) - Dictionary of extra configuration
  • secure (Boolean) - Initial underlying omero.client connection type (True=SSL/False=insecure)
  • anonymous (Boolean)
  • useragent (String) - Log which python clients use this connection. E.g. 'OMERO.webadmin'
Overrides: object.__init__

isAnonymous(self)

source code 

Returns the anonymous flag

Returns: Boolean
Anonymous

getProperty(self, k)

source code 

Returns named property of the wrapped omero.client

Returns:
named client property

clone(self)

source code 

Returns a new instance of this class, with all matching properties. TODO: Add anonymous and userAgent parameters?

Returns: _BlitzGateway
Clone of this connection wrapper

setIdentity(self, username, passwd, _internal=False)

source code 

Saves the username and password for later use, creating session etc

Parameters:
  • username (String) - User name.
  • passwd (String) - Password.
  • _internal (Booelan) - If False, set _anonymous = False

suConn(self, username, group=None, ttl=60000)

source code 

If current user isAdmin, return new connection owned by 'username'

Parameters:
  • username (String) - Username for new connection
  • group (String) - If specified, try to log in to this group
  • ttl (Int) - Timeout for new session
Returns: _BlitzGateway or None if not admin or username unknown
Clone of this connection, with username's new Session

keepAlive(self)

source code 

Keeps service alive. Returns True if connected. If connection was lost, reconnecting. If connection failed, returns False and error is logged.

Returns: Boolean
True if connection alive.

seppuku(self, softclose=False)

source code 

Terminates connection with killSession(). If softclose is False, the session is really terminate disregarding its connection refcount.

Parameters:
  • softclose - Boolean

_createProxies(self)

source code 

Creates proxies to the server services. Called on connection or security switch. Doesn't actually create any services themselves. Created if/when needed. If proxies have been created already, they are resynced and reused.

setSecure(self, secure=True)

source code 

Switches between SSL and insecure (faster) connections to Blitz. The gateway must already be connected.

Parameters:
  • secure (Boolean) - If False, use an insecure connection

_createSession(self)

source code 

Creates a new session for the principal given in the constructor. Used during connect method

connect(self, sUuid=None)

source code 

Creates or retrieves connection for the given sessionUuid. Returns True if connected.

Parameters:
  • sUuid - omero_model_SessionI
Returns:
Boolean

getLastError(self)

source code 

Returns error if thrown by _BlitzGateway.connect connect.

Returns:
String

isConnected(self)

source code 

Returns last status of connection.

Returns:
Boolean

getEventContext(self)

source code 

Returns omero_System_ice.EventContext. It containes:

   shareId, sessionId, sessionUuid, userId, userName, 
   groupId, groupName, isAdmin, isReadOnly, 
   eventId, eventType, eventType,
   memberOfGroups, leaderOfGroups

Also saves context to self._ctx

Returns: omero.sys.EventContext
Event Context from admin service.

getUser(self)

source code 

Returns current Experimenter.

Returns: ExperimenterWrapper
Current Experimenter

getGroupFromContext(self)

source code 

Returns current omero_model_ExperimenterGroupI.

Returns:
omero.model.ExperimenterGroupI

isAdmin(self)

source code 

Checks if a user has administration privileges.

Returns:
Boolean

canBeAdmin(self)

source code 

Checks if a user is in system group, i.e. can have administration privileges.

Returns:
Boolean

isOwner(self, gid=None)

source code 

Checks if a user has owner privileges of a particular group or any group if gid is not specified.

Parameters:
  • gid (Long) - ID of group to check for ownership
Returns:
True if gid specified and owner belongs to that group Otherwise True if owner belongs to any group

canWrite(self, obj)

source code 

Checks if a user has write privileges to the given object.

Parameters:
  • obj - Given object
Returns:
Boolean

getSession(self)

source code 

Returns the existing session, or creates a new one if needed

Returns: omero.model.session
The session from session service

setGroupNameForSession(self, group)

source code 

Looks up the group by name, then delegates to setGroupForSession, returning the result

Parameters:
  • group (String) - Group name
Returns: Boolean
True if group set successfully

setGroupForSession(self, groupid)

source code 

Sets the security context of this connection to the specified group

Parameters:
  • groupid (Long) - The ID of the group to switch to
Returns: Boolean
True if the group was switched successfully

getAdminService(self)

source code 

Gets reference to the admin service from ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

getQueryService(self)

source code 

Gets reference to the query service from ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

getContainerService(self)

source code 

Gets reference to the container service from ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

getPixelsService(self)

source code 

Gets reference to the pixels service from ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

getMetadataService(self)

source code 

Gets reference to the metadata service from ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

getRoiService(self)

source code 

Gets ROI service.

Returns:
omero.gateway.ProxyObjectWrapper

getScriptService(self)

source code 

Gets script service.

Returns:
omero.gateway.ProxyObjectWrapper

createRawFileStore(self)

source code 

Creates a new raw file store. This service is special in that it does not get cached inside BlitzGateway so every call to this function returns a new object, avoiding unexpected inherited states.

Returns:
omero.gateway.ProxyObjectWrapper

getRepositoryInfoService(self)

source code 

Gets reference to the repository info service from ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

getShareService(self)

source code 

Gets reference to the share service from ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

getSharedResources(self)

source code 

Gets reference to the sharedresources from ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

getTimelineService(self)

source code 

Gets reference to the timeline service from ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

getTypesService(self)

source code 

Gets reference to the types service from ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

getConfigService(self)

source code 

Gets reference to the config service from ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

createRenderingEngine(self)

source code 

Creates a new rendering engine. This service is special in that it does not get cached inside BlitzGateway so every call to this function returns a new object, avoiding unexpected inherited states.

Returns:
omero.gateway.ProxyObjectWrapper

getRenderingSettingsService(self)

source code 

Gets reference to the rendering settings service from ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

createRawPixelsStore(self)

source code 

Creates a new raw pixels store. This service is special in that it does not get cached inside BlitzGateway so every call to this function returns a new object, avoiding unexpected inherited states.

Returns:
omero.gateway.ProxyObjectWrapper

createThumbnailStore(self)

source code 

Gets a reference to the thumbnail store on this connection object or creates a new one if none exists.

Returns: omero.gateway.ProxyObjectWrapper
The proxy wrapper of the thumbnail store

createSearchService(self)

source code 

Gets a reference to the searching service on this connection object or creates a new one if none exists.

Returns:
omero.gateway.ProxyObjectWrapper

getUpdateService(self)

source code 

Gets reference to the update service from ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

getDeleteService(self)

source code 

Gets reference to the delete service from ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

getSessionService(self)

source code 

Gets reference to the session service from ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

createExporter(self)

source code 

New instance of non cached Exporter, wrapped in ProxyObjectWrapper.

Returns:
omero.gateway.ProxyObjectWrapper

listProjects(self, eid=None, only_owned=False)

source code 

List every Project controlled by the security system.

Parameters:
  • eid - Filters Projects by owner ID
  • only_owned - Short-cut for filtering Projects by current user
Returns: ProjectWrapper list

listScreens(self, eid=None, only_owned=False)

source code 

List every Screens controlled by the security system.

Parameters:
  • eid - Filters Screens by owner ID
  • only_owned - Short-cut for filtering Screens by current user
Returns: ProjectWrapper list

listGroups(self)

source code 

Look up all experimenters and related groups. Groups are also loaded

Returns: ExperimenterWrapper generator
All experimenters

getDefaultGroup(self, eid)

source code 

Retrieve the default group for the given user id.

Parameters:
  • eid (Long) - Experimenter ID
Returns: ExperimenterGroupWrapper
The default group for user

getOtherGroups(self, eid)

source code 

Fetch all groups of which the given user is a member. The returned groups will have all fields filled in and all collections unloaded.

Parameters:
  • eid (Long) - Experimenter ID
Returns: ExperimenterGroupWrapper generator
Generator of groups for user

getGroupsLeaderOf(self)

source code 

Look up Groups where current user is a leader of.

Returns: ExperimenterGroupWrapper generator
Groups that current user leads

getGroupsMemberOf(self)

source code 

Look up Groups where current user is a member of (except "user" group).

Returns: ExperimenterGroupWrapper generator
Current users groups

findExperimenters(self, start='')

source code 

Return a generator for all Experimenters whose omeName starts with 'start'. Experimenters ordered by omeName.

Parameters:
  • start (String) - omeName must start with these letters
Returns: ExperimenterWrapper generator
Generator of experimenters

containedExperimenters(self, gid)

source code 

Fetch all users contained in this group. The returned users will have all fields filled in and all collections unloaded.

Parameters:
  • gid (Long) - Group ID
Returns: ExperimenterWrapper generator
Generator of experimenters

listColleagues(self)

source code 

Look up users who are a member of the current user active group. Returns None if the group is private and isn't lead by the current user

Returns: ExperimenterWrapper generator
Generator of Experimenters or None

listStaffs(self)

source code 

Look up users who are members of groups lead by the current user.

Returns: ExperimenterWrapper generator
Members of groups lead by current user

listOwnedGroups(self)

source code 

Looks up owned groups for the logged user.

Returns: ExperimenterGroupWrapper generator
Groups owned by current user

getFreeSpace(self)

source code 

Returns the free or available space on this file system including nested subdirectories.

Returns: Int
Free space in bytes

timelineListImages(self, tfrom=None, tto=None, limit=10, only_owned=True)

source code 

List images based on their creation times. If both tfrom and tto are None, grab the most recent batch.

Parameters:
  • tfrom - milliseconds since the epoch for start date
  • tto - milliseconds since the epoch for end date
  • limit - maximum number of results
  • only_owned - Only owned by the logged user. Boolean.
Returns: ImageWrapper generator
Generator yielding _ImageWrapper

getObject(self, obj_type, oid=None, params=None, attributes=None)

source code 

Retrieve single Object by type E.g. "Image" or None if not found. If more than one object found, raises ome.conditions.ApiUsageException See getObjects for more info.

Parameters:
  • obj_type (String) - Object type. E.g. "Project" see above
  • ids (List of Long) - object IDs
  • params - omero.sys.Parameters, can be used for pagination, filtering etc.
  • attributes - Map of key-value pairs to filter results by. Key must be attribute of obj_type. E.g. 'name', 'ns'

getObjects(self, obj_type, ids=None, params=None, attributes=None)

source code 

Retrieve Objects by type E.g. "Image" Returns generator of appropriate BlitzObjectWrapper type. E.g. ImageWrapper. If ids is None, all available objects will be returned. i.e. listObjects() Filter objects by attributes. E.g. attributes={'name':name}

Parameters:
  • obj_type (String) - Object type. E.g. "Project" see above
  • ids (List of Long) - object IDs
  • params - omero.sys.Parameters, can be used for pagination, filtering etc.
  • attributes - Map of key-value pairs to filter results by. Key must be attribute of obj_type. E.g. 'name', 'ns'
Returns:
Generator of BlitzObjectWrapper subclasses

buildQuery(self, obj_type, ids=None, params=None, attributes=None)

source code 

Prepares a query for iQuery. Also prepares params and determines appropriate wrapper for result Returns (query, params, wrapper) which can be used with the appropriate query method. Used by getObjects and getObject above.

Parameters:
  • obj_type (String) - Object type. E.g. "Project" see above
  • ids (List of Long) - object IDs
  • params - omero.sys.Parameters, can be used for pagination, filtering etc.
  • attributes - Map of key-value pairs to filter results by. Key must be attribute of obj_type. E.g. 'name', 'ns'
Returns:
(query, params, wrapper)

listFileAnnotations(self, eid=None, toInclude=[], toExclude=[])

source code 

Lists FileAnnotations created by users, filtering by namespaces if specified. If NO namespaces are specified, then 'known' namespaces are excluded by default, such as original files and companion files etc. File objects are loaded so E.g. file name is available without lazy loading.

Parameters:
  • eid - Filter results by this owner Id
  • toInclude - Only return annotations with these namespaces. List of strings.
  • toExclude - Don't return annotations with these namespaces. List of strings.
Returns:
Generator of FileAnnotationWrappers - with files loaded.

getAnnotationLinks(self, parent_type, parent_ids=None, ann_ids=None, ns=None, params=None)

source code 

Retrieve Annotation Links by parent_type E.g. "Image". Not Ordered. Returns generator of AnnotationLinkWrapper If parent_ids is None, all available objects will be returned. i.e. listObjects()

Parameters:
  • obj_type (String) - Object type. E.g. "Project" see above
  • ids (List of Long) - object IDs
Returns:
Generator yielding wrapped objects.

createImageFromNumpySeq(self, zctPlanes, imageName, sizeZ=1, sizeC=1, sizeT=1, description=None, dataset=None)

source code 

Creates a new multi-dimensional image from the sequence of 2D numpy arrays in zctPlanes.
zctPlanes should be a generator of numpy 2D arrays of shape (sizeY, sizeX) ordered
to iterate through T first, then C then Z.
Example usage:
original = conn.getObject("Image", 1)
sizeZ = original.getSizeZ()
sizeC = original.getSizeC()
sizeT = original.getSizeT()
zctList = []
for z in range(sizeZ):
    for c in range(sizeC):
        for t in range(sizeT):
            zctList.append( (z,c,t) )
def planeGen():
    planes = original.getPrimaryPixels().getPlanes(zctList)
    for p in planes:
        # perform some manipulation on each plane
        yield p
createImageFromNumpySeq (planeGen(), imageName, sizeZ=sizeZ, sizeC=sizeC, sizeT=sizeT

@param session          An OMERO service factory or equivalent with getQueryService() etc.
@param zctPlanes        A generator of numpy 2D arrays, corresponding to Z-planes of new image.
@param imageName        Name of new image
@param description      Description for the new image
@param dataset          If specified, put the image in this dataset. omero.model.Dataset object

@return The new OMERO image: omero.model.ImageI

createFileAnnfromLocalFile(self, localPath, origFilePathAndName=None, mimetype=None, ns=None, desc=None)

source code 

Class method to create a FileAnnotationWrapper from a local file. File is uploaded to create an omero.model.OriginalFileI referenced from this File Annotation. Returns a new FileAnnotationWrapper

Parameters:
  • conn - Blitz connection
  • localPath - Location to find the local file to upload
  • origFilePathAndName - Provides the 'path' and 'name' of the OriginalFile. If None, use localPath
  • mimetype - The mimetype of the file. String. E.g. 'text/plain'
Returns:
New FileAnnotationWrapper

getObjectsByAnnotations(self, obj_type, annids)

source code 

Retrieve objects linked to the given annotation IDs controlled by the security system.

Parameters:
  • annids (Long) - Annotation IDs
Returns: BlitzObjectWrapper generator
Generator yielding Objects

getEnumerationEntries(self, klass)

source code 

Get all enumerations by class

Parameters:
  • klass (Class or string) - Class
Returns: EnumerationWrapper generator
Generator of Enumerations

getEnumeration(self, klass, string)

source code 

Get enumeration by class and value

Parameters:
  • klass (Class or string) - Class
  • string (String) - Enum value
Returns: EnumerationWrapper
Enumeration or None

getEnumerationById(self, klass, eid)

source code 

Get enumeration by class and ID

Parameters:
  • klass (Class or string) - Class
  • eid (Long) - Enum ID
Returns: EnumerationWrapper
Enumeration or None

getOriginalEnumerations(self)

source code 

Gets original enumerations. Returns a dictionary of enumeration class: list of Enumerations

Returns: Dict of <string: EnumerationWrapper list >
Original enums

getEnumerations(self)

source code 

Gets list of enumeration types

Returns: List of Strings
List of enum types

getEnumerationsWithEntries(self)

source code 

Get enumeration types, with lists of Enum entries

Returns: Dict of <string: EnumerationWrapper list >
Dictionary of type: entries

deleteEnumeration(self, obj)

source code 

Deletes an enumeration object

Parameters:
  • obj (omero.model.IObject) - Enumeration object

createEnumeration(self, obj)

source code 

Create an enumeration with given object

Parameters:
  • obj (omero.model.IObject) - Object

resetEnumerations(self, klass)

source code 

Resets the enumerations by type

Parameters:
  • klass (String) - Type of enum to reset

updateEnumerations(self, new_entries)

source code 

Updates enumerations with new entries

Parameters:
  • new_entries (List of omero.model.IObject) - List of objects

deleteObjectDirect(self, obj)

source code 

Directly Delete object (removes row from database). This may fail with various constraint violations if the object is linked to others in the database

Parameters:
  • obj (IObject) - Object to delete

deleteObjects(self, obj_type, obj_ids, deleteAnns=False, deleteChildren=False)

source code 

Generic method for deleting using the delete queue. Supports deletion of 'Project', 'Dataset', 'Image', 'Screen', 'Plate', 'Well', 'Annotation'. Options allow to delete 'independent' Annotations (Tag, Term, File) and to delete child objects.

Parameters:
  • obj_type - String to indicate 'Project', 'Image' etc.
  • obj_ids - List of IDs for the objects to delete
  • deleteAnns - If true, delete linked Tag, Term and File annotations
  • deleteChildren - If true, delete children. E.g. Delete Project AND it's Datasets & Images.
Returns: omero.api.delete.DeleteHandle
Delete handle

searchObjects(self, obj_types, text, created=None)

source code 

Search objects of type "Project", "Dataset", "Image", "Screen", "Plate" Returns a list of results

Parameters:
  • obj_types - E.g. ["Dataset", "Image"]
  • text - The text to search for
  • created - omero.rtime list or tuple (start, stop)
Returns:
List of Object wrappers. E.g. ImageWrapper

Class Variable Details [hide private]

CONFIG

Holder for class wide configuration properties:

  • IMG_RDEFNS: a namespace for annotations linked on images holding the default rendering settings object id.
  • IMG_ROPTSNS: a namespace for annotations linked on images holding default rendering options that don't get saved in the rendering settings.

One good place to define this is on the extending class' connect() method.

Value:
{}