Skip to content

Instantly share code, notes, and snippets.

joshmoore /
Created Nov 2, 2022
Simple CLI for querying for certain tags
#!/usr/bin/env python
from argparse import (
from collections import (
from datetime import (
joshmoore /
Created Jan 26, 2022
Open zarr issues (2022-01-26)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import omero.scripts as scripts
client = scripts.client(
scripts.Long("Image_ID", optional=False),
scripts.String("Logical_Path", optional=False),
from pyshacl import validate
from rdflib import Graph
import pytest
import json
def assert_graph(shacl, graph, valid=True):
s = Graph().parse(data=shacl, format="turtle")
d = Graph().parse(data=graph, format="json-ld")
#!/usr/bin/env python
<Image ID="Image:0" Name="image_0000247585 (R0)">
<Description>Collection ImageCollection__0000042467</Description>
<InstrumentRef ID="Instrument:0"/>
<ObjectiveSettings ID="Objective:0:0"/>
<Pixels BigEndian="false" DimensionOrder="XYCZT" ID="Pixels:0" Interleaved="false" PhysicalSizeX="16.438446163366336" PhysicalSizeXUnit="µm" PhysicalSizeY="16.438446015424162" PhysicalSizeYUnit="µm" SignificantBits="8" SizeC="3" SizeT="1" SizeX="1616" SizeY="4668" SizeZ="1" Type="uint8">
<Channel ID="Channel:0:0" IlluminationType="Transmitted" SamplesPerPixel="3">
joshmoore /
Last active Apr 1, 2019
OMERO DropBox Test
docker run -ti --rm --entrypoint=python -v $PWD:/dropbox openmicroscopy/omero-server /dropbox/
joshmoore / Dockerfile
Last active Aug 17, 2018
OMERO ubuntu/docker test
View Dockerfile
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8
env OMERO_OPT_DIR=/opt/omero
RUN apt-get update
joshmoore / example.txt
Created Aug 16, 2018
Simple search test
View example.txt
$ NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
$ echo $NEW_UUID
$ bin/omero -q obj new Dataset name=$NEW_UUID
$ bin/omero search Dataset $NEW_UUID
Using session for root@localhost:4064. Idle timeout: 10 min. Current group: system
# | Class | Id | name | details
from fileinput import input
import requests
# cat image ids to this script to loop over annotations
# e.g.: cut -f2 image_ids.tsv | python
def connect():
import omero
from omero.gateway import BlitzGateway
from omero.sys import ParametersI
import omero
compounds = unwrap(q.projection(("select distinct mv1.value, mv2.value from Image i "
"join i.annotationLinks l1 join l1.child as a1 join a1.mapValue as mv1 "
"join i.annotationLinks l2 join l2.child as a2 join a2.mapValue as mv2 "
"join i.wellSamples ws join ws.well w join w.plate p "
"where = 4403 and = 'Product Use Annotation' and = 'Compound Name'"), None))