Skip to content

Instantly share code, notes, and snippets.

View sbesson's full-sized avatar

Sébastien Besson sbesson

View GitHub Profile
@sbesson
sbesson / test.companion.ome
Last active June 14, 2021 12:58
Companion / Unicode
<?xml version="1.0" encoding="UTF-8"?>
<OME xmlns="http://www.openmicroscopy.org/Schemas/OME/2016-06" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Creator="OME Bio-Formats 6.6.0" UUID="urn:uuid:d830ec74-9e12-43cd-b4d0-0a0c8a7c57c4" xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2016-06 http://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd">
<Image ID="Image:0" Name="test">
<Pixels BigEndian="false" DimensionOrder="XYZCT" ID="Pixels:0" Interleaved="false" SignificantBits="8" SizeC="1" SizeT="1" SizeX="512" SizeY="512" SizeZ="1" Type="uint8" PhysicalSizeX="1" PhysicalSizeXUnit="µm">
<Channel ID="Channel:0:0" SamplesPerPixel="1">
<LightPath/>
</Channel>
<TiffData FirstC="0" FirstT="0" FirstZ="0" IFD="0" PlaneCount="1">
<UUID FileName="test.ome.tiff">urn:uuid:faa8214a-e188-4fb7-bb85-262225e6bfb4</UUID>
</TiffData>
@sbesson
sbesson / find_travis_repos.py
Created December 1, 2020 15:13
Find all organization repository with Travis configuration file
#! /usr/bin/env python
from github import Github
gh = Github()
r = gh.search_code('org:ome filename:.travis.yml')
repos = sorted(set([i.repository.html_url for i in r]))
for repo in repos:
print(repo)
@sbesson
sbesson / hcs.companion.ome
Last active July 13, 2020 12:49
Companion sparse HCS OME-TIFF fileset
<?xml version="1.0" encoding="UTF-8"?>
<OME xmlns="http://www.openmicroscopy.org/Schemas/OME/2016-06"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2016-06
http://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd">
<Plate
ID="Plate:0"
Name="Control Plate"
ColumnNamingConvention="letter"
@sbesson
sbesson / writePyramidOMETIFF.m
Last active April 21, 2020 15:21
MATLAB example of writing tiled pyramidal OME-TIFF using the Bio-Formats API
writer = loci.formats.out.PyramidOMETiffWriter();
I0 = imread('rice.png');
I = cell(3,1);
I{1} = imresize(I0, 8);
I{2} = imresize(I0, 4);
I{3} = imresize(I0, 2);
I{4} = I0;
metadata = createMinimalOMEXMLMetadata(I{1});
@sbesson
sbesson / COPYING
Last active October 2, 2019 07:57
A prototype of OME-TIFF with sparse TiffData
Attribution 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
@sbesson
sbesson / idr0016_screens.txt
Last active August 7, 2019 16:14
Script to fix idr0016 broken symlinks
/data/OMERO/ManagedRepository/demo_2/2017-08/14/10-23-19.875/tmp/idr-metadata/idr0016-wawer-bioactivecompoundprofiling/screens/24277.screen
/data/OMERO/ManagedRepository/demo_2/2017-08/14/10-59-37.469/tmp/idr-metadata/idr0016-wawer-bioactivecompoundprofiling/screens/24280.screen
/data/OMERO/ManagedRepository/demo_2/2017-08/14/13-40-38.086/tmp/idr-metadata/idr0016-wawer-bioactivecompoundprofiling/screens/24294.screen
/data/OMERO/ManagedRepository/demo_2/2017-08/14/15-17-49.614/tmp/idr-metadata/idr0016-wawer-bioactivecompoundprofiling/screens/24295.screen
/data/OMERO/ManagedRepository/demo_2/2017-08/14/16-51-36.693/tmp/idr-metadata/idr0016-wawer-bioactivecompoundprofiling/screens/24296.screen
/data/OMERO/ManagedRepository/demo_2/2017-08/14/18-30-38.408/tmp/idr-metadata/idr0016-wawer-bioactivecompoundprofiling/screens/24300.screen
/data/OMERO/ManagedRepository/demo_2/2017-08/14/20-13-38.290/tmp/idr-metadata/idr0016-wawer-bioactivecompoundprofiling/screens/24301.screen
/data/OMERO/ManagedRepository/demo_2/2017-08
@sbesson
sbesson / cleanup_integration_branches.py
Created June 13, 2019 09:41
Remove obsolete integration branches
#! /usr/bin/env python
# Remove obsolete integration branches
import scc.git
import sys
# Login and check the organization
gh = scc.git.get_github(scc.git.get_token())
print "Authenticated as %s" % gh.get_user().login
branch = sys.argv[1]
#
git clone https://github.com/snoopycrimecop/bio-formats-build -b east_merge_trigger
pushd bio-formats-build
git submodule update --init
pushd bioformats
popd
docker build -t bf --build-arg BUILD_IMAGE=gradle:jdk8 .
popd
git clone https://github.com/snoopycrimecop/omero-build -b west_merge_trigger
@sbesson
sbesson / README.md
Last active March 15, 2019 20:53
OME-TIFF pyramidal files generation
import bioformats.omexml as ome
import javabridge as jv
import bioformats
import os
import sys
import numpy as np
# Write file to disk
def writeOMETIFF(img_XYCZT, path, type='uint16', verbose=True):