Skip to content

Instantly share code, notes, and snippets.

@will-moore
will-moore / max_intensity_projection.py
Created March 21, 2022 15:50
Python script to create a Max Intensity Projection for an OMERO Image
# see https://forum.image.sc/t/maximum-intensity-projection-feature-in-omero-web/54392/5
import argparse
import sys
import omero.clients
from omero.cli import cli_login
from omero.rtypes import wrap
from omero.gateway import BlitzGateway
import numpy as np
@will-moore
will-moore / omero_rois.csv
Created October 30, 2021 22:07
Batch_ROI_Export from OMERO
We can't make this file beautiful and searchable because it's too large.
image_id,image_name,roi_id,shape_id,type,text,z,t,channel,area (µm),length (µm),points,min,max,sum,mean,std_dev,X,Y,Width,Height,RadiusX,RadiusY,X1,Y1,X2,Y2,Points
806,"Centrin_PCNT_Cep215_20110506_Fri-1545_0_SIR_PRJ.dv",179764,179764,polygon,"0001-0001-0125",1,1,CENT2,0.15367967833454133,,98,631.5927124023438,2212.172119140625,103127.09680175781,1052.317314303651,409.68381187031326,,,,,,,,,,,"130,117 131,117 131,126 130,126 130,134 128,134 128,133 127,133 127,132 124,132 124,133 123,133 123,132 122,132 122,130 123,130 123,128 122,128 122,127 121,127 121,126 123,126 123,125 124,125 124,124 125,124 125,123 127,123 127,124 128,124 128,122 127,122 127,117 128,117 128,116 130,116"
806,"Centrin_PCNT_Cep215_20110506_Fri-1545_0_SIR_PRJ.dv",179765,179765,polygon,"0001-0002-0127",1,1,CENT2,0.015681599830055237,,10,656.56787109375,877.3853759765625,7558.601013183594,755.8601013183594,74.44378384463185,,,,,,,,,,,"134,126 135,126 135,129 133,129 133,128 132,128 132,125 134,125"
806,"Centrin_PCNT_Cep215_20110506_Fri-1545_
@will-moore
will-moore / download_pdi.py
Created October 8, 2021 11:03
Python script to download original files from Project/Dataset/Image in OMERO using cli download command
import argparse
import sys
import os
from omero.cli import cli_login, CLI
from omero.gateway import BlitzGateway
from omero.plugins.download import DownloadControl
import argparse
import json
import sys
from omero.gateway import BlitzGateway
from omero.cli import cli_login
from omero.model import StatsInfoI
from omero.rtypes import rdouble
#!/usr/bin/env python
import pandas
import omero.clients
import omero.cli
import omero
import os
<docs>
# NGFF image file Loader for ImageJ.JS
[Next-generation file formats](https://ngff.openmicroscopy.org/latest/) is a specification for storing bioimaging
data in the cloud.
This plugin enalbes loading NGFF image into ImageJ.JS.
The implementation is adapted from the [OMERO ImJoy](https://github.com/will-moore/omero-imjoy) made by @will-moore
@will-moore
will-moore / copy_masks_2_polygons.py
Last active May 21, 2021 10:05
Copy Masks from an Image in one OMERO server and turn them into Polygons on a different OMERO server
import omero
from omero.gateway import BlitzGateway
from omero.rtypes import rint, rstring
from skimage import morphology
from skimage import measure
import argparse
import sys
@will-moore
will-moore / metadata_queries.py
Created April 1, 2021 13:36
Examples for how to query OMERO for Images based on pixel type of Map Annotations
# https://forum.image.sc/t/harmonization-of-image-metadata-for-different-file-formats-omero-mde/50827/8
import omero
from omero.gateway import BlitzGateway
conn = BlitzGateway('username', 'password', port=4064, host='omero.server.org')
conn.connect()
# current group
@will-moore
will-moore / copy_dataset.py
Last active May 12, 2021 14:10
This script copies a Dataset or Image from one OMERO.server to another. By default it requires https://gitlab.com/openmicroscopy/incubator/omero-python-importer/-/blob/master/import.py and transfers original files. Alternative is to use --pixels to only transfer pixel data (this doesn't support big images).
# -----------------------------------------------------------------------------
# Copyright (C) 2021 University of Dundee. All rights reserved.
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of