ome / omero-cli-zarr

https://pypi.org/project/omero-cli-zarr/
GNU General Public License v2.0
16 stars 10 forks source link

Plate multiscales #29

Closed will-moore closed 4 years ago

will-moore commented 4 years ago

On top of #28.

Adds multiresolutions for each Image, scaling each 2D plane down by a factor of 2, until smaller than 96 on longest side.

NB: this doesn't use ome-zarr-py to do the scaling (but uses the same underlying cv2 method) because we're scaling a 2D plane each time, not 5D.

cc @sbesson, @dominikl, @joshmoore

TODO:

joshmoore commented 4 years ago

With the additional commits, https://github.com/ome/ome-zarr-py/pull/56 shows:

ome_zarr info 1.zarr/
/private/tmp/1.zarr [zgroup]
 - metadata
   - Plate
 - data
/private/tmp/1.zarr/PlateAcquisition Name 0/A/1/Field_1 [zgroup]
 - metadata
   - Multiscales
   - OMERO
 - data
   - (1, 1, 1, 512, 512)
   - (1, 1, 1, 256, 256)
   - (1, 1, 1, 128, 128)
   - (1, 1, 1, 64, 64)
joshmoore commented 4 years ago

@dominikl : do you want to take care of the linting failure in your follow up PR?

joshmoore commented 4 years ago

Got an "ok" elsewhere. Merging to be fixed in the follow-up.

sbesson commented 4 years ago

4d7850d was tested against the first illumination corrected plate of idr0033 using the following Docker pipeline

FROM centos:7

RUN yum install -y git python3 fontconfig

RUN useradd -ms /bin/bash converter
USER converter

RUN python3 -m venv /tmp/venv && /tmp/venv/bin/pip install -U pip wheel && /tmp/venv/bin/pip install https://github.com/ome/zeroc-ice-py-centos7/releases/download/0.2.1/zeroc_ice-3.6.5-cp36-cp36m-linux_x86_64.whl
RUN /tmp/venv/bin/pip install ome-zarr scikit-image omero-py
RUN /tmp/venv/bin/pip install git+https://github.com/will-moore/omero-cli-zarr@plate_multiscales

RUN /tmp/venv/bin/omero login public@idr.openmicroscopy.org -w public
ENTRYPOINT ["/tmp/venv/bin/omero", "zarr", "--output", "/data/41744_illum_corrected/", "export", "Plate:5966"]

It should be straightforward to adjust the pip install command to consume the master branch/any branch and reconvert the data including to include the omero metadata. #30 should simplify the installation step but is not a requirement. /cc @will-moore