Trees | Indices | Help |
|
---|
|
Connection wrapper. Handles connecting and keeping the session alive, creation of various services, context switching, security privilidges etc.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
ICE_CONFIG = None ICE_CONFIG - Defines the path to the Ice configuration |
|
|||
Inherited from |
|
Create the connection wrapper. Does not attempt to connect at this stage Initialises the omero.client :param username: User name. :type username: String :param passwd: Password. :type passwd: String :param client_obj: omero.client :param group: name of group to try to connect to :type group: String :param clone: If True, overwrite anonymous with False :type clone: Boolean :param try_super: Try to log on as super user ('system' group) :type try_super: Boolean :param host: Omero server host. :type host: String :param port: Omero server port. :type port: Integer :param extra_config: Dictionary of extra configuration :type extra_config: Dict :param secure: Initial underlying omero.client connection type (True=SSL/False=insecure) :type secure: Boolean :param anonymous: :type anonymous: Boolean :param useragent: Log which python clients use this connection. E.g. 'OMERO.webadmin' :type useragent: String
|
Returns the maximum plane size the server will allow for an image to not be considered big i.e. width or height larger than this will trigger image pyramids to be calculated. This is useful for the client to filter images based on them needing pyramids or not, without the full rendering engine overhead. :return: tuple holding (max_plane_width, max_plane_height) as set on the server :rtype: Tuple |
Returns the anonymous flag :return: Anonymous :rtype: Boolean |
Returns named property of the wrapped omero.client :return: named client property |
Returns a new instance of this class, with all matching properties. TODO: Add anonymous and userAgent parameters? :return: Clone of this connection wrapper :rtype: _BlitzGateway |
Saves the username and password for later use, creating session etc :param username: User name. :type username: String :param passwd: Password. :type passwd: String :param _internal: If False, set _anonymous = False :type _internal: Booelan |
If current user isAdmin, return new connection owned by 'username' :param username: Username for new connection :type username: String :param group: If specified, try to log in to this group :type group: String :param ttl: Timeout for new session :type ttl: Int :return: Clone of this connection, with username's new Session :rtype: _BlitzGateway or None if not admin or username unknown |
Keeps service alive. Returns True if connected. If connection was lost, reconnecting. If connection failed, returns False and error is logged. :return: True if connection alive. :rtype: Boolean |
Terminates connection with killSession(). If softclose is False, the session is really terminate disregarding its connection refcount. :param softclose: Boolean |
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. |
Switches between SSL and insecure (faster) connections to Blitz. The gateway must already be connected. :param secure: If False, use an insecure connection :type secure: Boolean |
Creates a new session for the principal given in the constructor. Used during connect method |
Creates or retrieves connection for the given sessionUuid. Returns True if connected. :param sUuid: omero_model_SessionI :return: Boolean |
Returns error if thrown by _BlitzGateway.connect connect. :return: String |
Returns last status of connection. :return: Boolean |
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 :return: Event Context from admin service. :rtype: |
Returns current experimenter id :return: Current Experimenter id :rtype: long |
Returns current Experimenter. :return: Current Experimenter :rtype: ExperimenterWrapper |
Returns Experimenters with administration privileges. :return: Current Experimenter :return: Generator of BlitzObjectWrapper subclasses |
Returns current omero_model_ExperimenterGroupI. :return: omero.model.ExperimenterGroupI |
Checks if a user has administration privileges. :return: Boolean |
Is the current group (or a specified group) led by the current user? :return: True if user leads the current group :rtype: Boolean |
Checks if a user is in system group, i.e. can have administration privileges. :return: Boolean |
Checks if a user has write privileges to the given object. :param obj: Given object :return: Boolean |
Returns isUserWrite() from the object's permissions :param obj: Given object :return: True if the objects's permissions allow owner to write |
Returns the existing session, or creates a new one if needed :return: The session from session service :rtype: |
Looks up the group by name, then delegates to setGroupForSession, returning the result :param group: Group name :type group: String :return: True if group set successfully :rtype: Boolean |
Sets the security context of this connection to the specified group :param groupid: The ID of the group to switch to :type groupid: Long :rtype: Boolean :return: True if the group was switched successfully |
Gets reference to the admin service from ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
Gets reference to the query service from ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
Gets reference to the container service from ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
Gets reference to the pixels service from ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
Gets reference to the metadata service from ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
Gets ROI service. :return: omero.gateway.ProxyObjectWrapper |
Gets script service. :return: omero.gateway.ProxyObjectWrapper |
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. :return: omero.gateway.ProxyObjectWrapper |
Gets reference to the repository info service from ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
Gets reference to the share service from ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
Gets reference to the sharedresources from ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
Gets reference to the timeline service from ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
Gets reference to the types service from ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
Gets reference to the config service from ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
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. :return: omero.gateway.ProxyObjectWrapper |
Gets reference to the rendering settings service from ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
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. :return: omero.gateway.ProxyObjectWrapper |
Gets a reference to the thumbnail store on this connection object or creates a new one if none exists. :rtype: omero.gateway.ProxyObjectWrapper :return: The proxy wrapper of the thumbnail store |
Gets a reference to the searching service on this connection object or creates a new one if none exists. :return: omero.gateway.ProxyObjectWrapper |
Gets reference to the update service from ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
Gets reference to the delete service from ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
Gets reference to the session service from ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
New instance of non cached Exporter, wrapped in ProxyObjectWrapper. :return: omero.gateway.ProxyObjectWrapper |
List every Project controlled by the security system. :param eid: Filters Projects by owner ID :rtype: ProjectWrapper list |
List every Screens controlled by the security system. :param eid: Filters Screens by owner ID :rtype: ProjectWrapper list |
List orphaned Datasets, Images, Plates controlled by the security system, Optionally filter by experimenter 'eid' :param obj_type: 'Dataset', 'Image', 'Plate' :param eid: experimenter id :type eid: Long :param params: omero.sys.ParametersI, can be used for pagination, filtering etc. :param attributes: Map of key-value pairs to filter results by. Key must be attribute of obj_type. E.g. 'name', 'ns' :return: Generator yielding Datasets :rtype: DatasetWrapper generator |
Look up all experimenters and related groups. Groups are also loaded :return: All experimenters :rtype: ExperimenterWrapper generator |
Retrieve the default group for the given user id. :param eid: Experimenter ID :type eid: Long :return: The default group for user :rtype: ExperimenterGroupWrapper |
Fetch all groups of which the given user is a member. The returned groups will have all fields filled in and all collections unloaded. :param eid: Experimenter ID :type eid: Long :return: Generator of groups for user :rtype: ExperimenterGroupWrapper generator |
Look up Groups where current user is a leader of. :return: Groups that current user leads :rtype: ExperimenterGroupWrapper generator |
Look up Groups where current user is a member of (except "user" group). :return: Current users groups :rtype: ExperimenterGroupWrapper generator |
Creates a new ExperimenterGroup. Must have Admin permissions to call this. :param name: New group name :param owner_Ids: Option to add existing Experimenters as group owners :param member_Ids: Option to add existing Experimenters as group members :param perms: New group permissions. E.g. 'rw----' (private), 'rwr---'(read-only), 'rwrw--' :param description: Group description |
Return a generator for all Experimenters whose omeName starts with 'start'. Experimenters ordered by omeName. :param start: omeName must start with these letters :type start: String :return: Generator of experimenters :rtype: ExperimenterWrapper generator |
Fetch all users contained in this group. The returned users will have all fields filled in and all collections unloaded. :param gid: Group ID :type gid: Long :return: Generator of experimenters :rtype: ExperimenterWrapper generator |
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 :return: Generator of Experimenters or None :rtype: ExperimenterWrapper generator |
Returns lists of 'leaders' and 'members' of the specified group (default is current group) as a dict with those keys. :return: {'leaders': list ExperimenterWrapper, 'colleagues': list ExperimenterWrapper} :rtype: dict |
Look up users who are members of groups lead by the current user. :return: Members of groups lead by current user :rtype: ExperimenterWrapper generator |
Looks up owned groups for the logged user. :return: Groups owned by current user :rtype: ExperimenterGroupWrapper generator |
Returns the free or available space on this file system including nested subdirectories. :return: Free space in bytes :rtype: Int |
Gets summary of Original Files that are part of the FS Fileset linked to images Returns a dict of files 'count' and sum of 'size' :param imageIds: Image IDs list :return: Dict of files 'count' and 'size' |
Gets summary of Original Files that are archived from OMERO 4 imports Returns a dict of files 'count' and sum of 'size' :param imageIds: Image IDs list :return: Dict of files 'count' and 'size' |
List images based on their creation times. If both tfrom and tto are None, grab the most recent batch. :param tfrom: milliseconds since the epoch for start date :param tto: milliseconds since the epoch for end date :param limit: maximum number of results :param only_owned: Only owned by the logged user. Boolean. :return: Generator yielding _ImageWrapper :rtype: ImageWrapper generator |
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. :param obj_type: Object type. E.g. "Project" see above :type obj_type: String :param ids: object IDs :type ids: List of Long :param params: omero.sys.Parameters, can be used for pagination, filtering etc. :param attributes: Map of key-value pairs to filter results by. Key must be attribute of obj_type. E.g. 'name', 'ns' :return: |
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} :param obj_type: Object type. E.g. "Project" see above :type obj_type: String :param ids: object IDs :type ids: List of Long :param params: omero.sys.Parameters, can be used for pagination, filtering etc. :param attributes: Map of key-value pairs to filter results by. Key must be attribute of obj_type. E.g. 'name', 'ns' :param respect_order: Returned items will be ordered according to the order of ids :return: Generator of BlitzObjectWrapper subclasses |
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. :param obj_type: Object type. E.g. "Project" see above :type obj_type: String :param ids: object IDs :type ids: List of Long :param params: omero.sys.Parameters, can be used for pagination, filtering etc. :param attributes: Map of key-value pairs to filter results by. Key must be attribute of obj_type. E.g. 'name', 'ns' :return: (query, params, wrapper) |
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. :param eid: Filter results by this owner Id :param toInclude: Only return annotations with these namespaces. List of strings. :param toExclude: Don't return annotations with these namespaces. List of strings. :return: Generator of FileAnnotationWrappers - with files loaded. |
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() :param obj_type: Object type. E.g. "Project" see above :type obj_type: String :param ids: object IDs :type ids: List of Long :return: Generator yielding wrapped objects. |
Retrieve all Annotations not linked to the given parents: Projects, Datasets, Images, Screens, Plates OR Wells etc. :param parent_type: E.g. 'Dataset', 'Image' etc. :param parent_ids: IDs of the parent. :param eid: Optional filter by Annotation owner :param ns: Filter by annotation namespace :param anntype: Optional specify 'Text', 'Tag', 'File', 'Long', 'Boolean' :return: Generator yielding AnnotationWrappers :rtype: AnnotationWrapper generator |
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() clist = range(sizeC) zctList = [] for z in range(sizeZ): for c in clist: 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, sourceImageId=1, channelList=clist) :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 :param sourceImageId If specified, copy this image with metadata, then add pixel data :param channelList Copies metadata from these channels in source image (if specified). E.g. [0,2] :return The new OMERO image: omero.model.ImageI |
Applies the rendering settings from one image to others. Returns a dict of success { True:[ids], False:[ids] } :param fromid: ID of Image to copy settings from. :param toids: List of Image IDs to apply setting to. :param to_type: toids refers to Images by default, but can refer to Project, Dataset, Image, Plate, Screen, Pixels |
Sets and saves new names for channels of specified Images. If an image has fewer channels than the max channel index in nameDict, then the channel names will not be set for that image. :param data_type: 'Image', 'Dataset', 'Plate' :param ids: Image, Dataset or Plate IDs :param nameDict: A dict of index:'name' ** 1-based ** E.g. {1:"DAPI", 2:"GFP"} :param channelCount: If specified, only rename images with this number of channels :return: {'imageCount':totalImages, 'updateCount':updateCount} |
Creates a OriginalFileWrapper from a local file. File is uploaded to create an omero.model.OriginalFileI. Returns a new OriginalFileWrapper :param conn: Blitz connection :param fo: The file object :param path: The file path :param name: The file name :param fileSize: The file size :param mimetype: The mimetype of the file. String. E.g. 'text/plain' :param ns: The file namespace :return: New OriginalFileWrapper |
Creates a OriginalFileWrapper from a local file. File is uploaded to create an omero.model.OriginalFileI. Returns a new OriginalFileWrapper :param conn: Blitz connection :param localPath: Location to find the local file to upload :param origFilePathAndName: Provides the 'path' and 'name' of the OriginalFile. If None, use localPath :param mimetype: The mimetype of the file. String. E.g. 'text/plain' :param ns: The namespace of the file. :return: New OriginalFileWrapper |
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 :param conn: Blitz connection :param localPath: Location to find the local file to upload :param origFilePathAndName: Provides the 'path' and 'name' of the OriginalFile. If None, use localPath :param mimetype: The mimetype of the file. String. E.g. 'text/plain' :param ns: The namespace of the file. :param desc: A description for the file annotation. :return: New FileAnnotationWrapper |
Retrieve objects linked to the given annotation IDs controlled by the security system. :param annids: Annotation IDs :type annids: Long :return: Generator yielding Objects :rtype: BlitzObjectWrapper generator |
Get all enumerations by class :param klass: Class :type klass: Class or string :return: Generator of Enumerations :rtype: EnumerationWrapper generator |
Get enumeration by class and value :param klass: Class :type klass: Class or string :param string: Enum value :type string: String :return: Enumeration or None :rtype: EnumerationWrapper |
Get enumeration by class and ID :param klass: Class :type klass: Class or string :param eid: Enum ID :type eid: Long :return: Enumeration or None :rtype: EnumerationWrapper |
Gets original enumerations. Returns a dictionary of enumeration class: list of Enumerations :return: Original enums :rtype: Dict of <string: EnumerationWrapper list > |
Gets list of enumeration types :return: List of enum types :rtype: List of Strings |
Get enumeration types, with lists of Enum entries :return: Dictionary of type: entries :rtype: Dict of <string: EnumerationWrapper list > |
Deletes an enumeration object :param obj: Enumeration object :type obj: omero.model.IObject |
Create an enumeration with given object :param obj: Object :type obj: omero.model.IObject |
Resets the enumerations by type :param klass: Type of enum to reset :type klass: String |
Updates enumerations with new entries :param new_entries: List of objects :type new_entries: List of omero.model.IObject |
Directly Delete object (removes row from database). This may fail with various constraint violations if the object is linked to others in the database :param obj: Object to delete :type obj: IObject |
Retrieves the current set of delete commands with type (graph spec)
and options filled. :return: Exhaustive list of available delete
commands. :rtype: |
Generic method for deleting using the delete queue. Options allow to delete 'independent' Annotations (Tag, Term, File) and to delete child objects. :param graph_spec: String to indicate the object type or graph specification. Examples include: * 'Project' * 'Dataset' * 'Image' * 'Screen' * 'Plate' * 'Well' * 'Annotation' * '/OriginalFile' * '/Image+Only' * '/Image/Pixels/Channel' As of OMERO 4.4.0 the correct case is now explicitly required, the use of 'project' or 'dataset' is no longer supported. :param obj_ids: List of IDs for the objects to delete :param deleteAnns: If true, delete linked Tag, Term and File annotations :param deleteChildren: If true, delete children. E.g. Delete Project AND it's Datasets & Images. :return: Delete handle :rtype: L{omero.api.delete.DeleteHandle} |
Change the permissions of a particluar Group. Returns the proxy 'prx' handle that can be processed like this: callback = CmdCallbackI(self.gateway.c, prx) callback.loop(20, 500) rsp = prx.getResponse() |
Change the Group for a specified objects using queue. :param graph_spec: String to indicate the object type or graph specification. Examples include: * '/Image' * '/Project' # will move contents too. * NB: Also supports 'Image' etc for convenience :param obj_ids: IDs for the objects to move. :param group_id: The group to move the data to. |
Search objects of type "Project", "Dataset", "Image", "Screen", "Plate" Returns a list of results :param obj_types: E.g. ["Dataset", "Image"]
:param text: The text to search for :param created: |
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Feb 7 10:11:13 2015 | http://epydoc.sourceforge.net |