omero/files.py
OMERO File utiltities
download_file_annotation(file_annot, outdir='.')
Downloads FileAnnotation from OMERO into a local directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_annot | FileAnnotationWrapper | Remote Omero File Annotation object. | required |
out_dir | Where to download this file. | required |
Returns:
| Type | Description |
|---|---|
str | String path to downloaded file. |
Source code in lavlab/omero/files.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
get_script_by_name(conn, fn, absolute=False, check_user_scripts=False)
Searches for an omero script in the host with the given name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conn | BlitzGateway | An Omero BlitzGateway with a session. | required |
fn | str | Name of remote Omero.Script | required |
absolute | Absolute uses getScriptID(). This method does not accept wildcards and requires a path. Default will get all remote script names and compare the remote filename to fn. | False | |
checkUserScripts | Not implemented. | required |
Returns:
| Type | Description |
|---|---|
int | Omero.Script Id |
Source code in lavlab/omero/files.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
upload_file_as_annotation(parent_obj, file_path, namespace, mime=None, overwrite=True)
Uploads a given filepath to omero as an annotation for parent_obj under namespace.
parent_obj: omero.gateway.ParentWrapper Object that should own the annotation. (typically an ImageWrapper) file_path: str Local path of file to upload as annotation. namespace: str Remote namespace to put the file annotation mime: str, optional Mimetype for filetype. If None this will be assumed based on file extension overwrite: bool, Default: True Overwrites existing file annotation in this namespace. return: omero.gateway.FileAnnotationWrapper Uploaded FileAnnotation object.
Source code in lavlab/omero/files.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |