Open will-moore opened 3 years ago
In general, having this be user-friendly is a big win. Some things to think about though:
conn
method?)Are you thinking like:
from omero.gateway import download
download(conn, "Image", [image_id], "download_loc_local_dir")
This has some overlap with omero-downloader, but allows you to combine it with other python code. It's relatively small amount of code, equivalent to this (from https://gist.github.com/will-moore/dab2148ef566125b60625f7773aa1b64):
for used_file in fileset.listFiles():
rel_path = getTargetPath(used_file, templatePrefix)
file_path = os.path.join(tmpdirname, rel_path)
dir_name = os.path.dirname(file_path)
if not os.path.exists(dir_name):
os.makedirs(dir_name)
print('downloading file to', file_path)
with open(str(file_path), "wb") as f:
for chunk in used_file.getFileInChunks():
f.write(chunk)
I don't think it has anything to do with Zarr. These files are just the original imported files, so they are already a PFF, but not a new one.
These files are just the original imported files, so they are already a PFF, but not a new one.
:+1:
This has some overlap with omero-downloader, but ... It's relatively small amount of code, equivalent to this
:+1: Just want to be clear on the scope, since we have N of these efforts at the moment.
from omero.gateway import download
Possibly. We just generally need to start working to reduce the size of omero/gateway/__init__.py
(importing things into the omero.gateway namespace is probably still fine in the interim)
See https://github.com/ome/omero-documentation/issues/2179#issuecomment-810225179 For example, download files:
conn.download("Image", [image_id], "download_loc_local_dir")
conn.download("Dataset", [dataset_id], "download_loc_local_dir")
conn.download("Fileset", [fileset_id], "download_loc_local_dir")
For import of files to OMERO, needs some decisions on what to do with https://gitlab.com/openmicroscopy/incubator/omero-python-importer/-/blob/master/import.py I have referred quite a few users to this recently (don't know how much it's been used, but haven't heard about any problems), so it probably needs to be more accessible.
cc @joshmoore