Skip to content

Instantly share code, notes, and snippets.

View dominikl's full-sized avatar

Dominik Lindner dominikl

  • University of Dundee
  • Dundee
View GitHub Profile
Dataset:name:Mouse_HE /uod/idr/filesets/idr0154-queen-hdbr/851 2 RBP1 KO P1 T Sectioned head to tail 11.tif
Dataset:name:Mouse_HE /uod/idr/filesets/idr0154-queen-hdbr/872 2 RBP1 KO 15.5 T Sectioned tail to head 5.tif
Dataset:name:RNAscope /uod/idr/filesets/idr0154-queen-hdbr/1268_CS16_11_MXRA5-Change Scaling-04.ome.tiff
import os
os.environ["ZARR_V3_EXPERIMENTAL_API"] = "1"
import zarr
import argparse
parser = argparse.ArgumentParser(description="Convert ome.zarr from zarr spec 2 to 3")
parser.add_argument("input", help="The input zarr")
parser.add_argument("output", nargs="?", help="Optional output zarr")
import re
import subprocess
from experimental import Plate, Image, create_companion
# https://github.com/ome/ome-model/blob/master/ome_model/experimental.py
# (pip install ome-model)
# R44821_160620150002i3t001A06f01d2.ome.tif
pat = re.compile(r"^(?P<plate>.*?)i3t(?P<timepoint>\d+)(?P<wellrow>\w)(?P<wellcol>\d{2,})f(?P<field>\d{2})d(?P<channel>\d)\.*")
plate_name = "R44821_160620150002"
order = "XYCZT"
@dominikl
dominikl / segment.py
Created November 6, 2020 11:05
Segement an OMERO image and add the result as masks
import matplotlib.pyplot as plt
import numpy as np
import omero
from omero.gateway import BlitzGateway, ColorHolder
from omero.model import MaskI, RoiI
from omero.rtypes import rdouble, rint, rstring
from skimage.filters import threshold_otsu
from skimage.measure import label, regionprops
OME_HOST = "merge-ci"
import omero.api.IQueryPrx;
import omero.gateway.Gateway;
import omero.gateway.LoginCredentials;
import omero.gateway.SecurityContext;
import omero.gateway.model.ExperimenterData;
import omero.gateway.model.FilesetData;
import omero.log.SimpleLogger;
import omero.model.Fileset;
import omero.sys.ParametersI;