Skip to content

Instantly share code, notes, and snippets.

@emilroz
emilroz / Segment_image_and_upload_masks.m
Last active August 29, 2015 14:04
OMERO Matlab toolbox example for binary masks.
% Copyright (C) 2014 Glencoe Software, Inc.
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are met:
%
% 1. Redistributions of source code must retain the above copyright notice, this
% list of conditions and the following disclaimer.
% 2. Redistributions in binary form must reproduce the above copyright notice,
% this list of conditions and the following disclaimer in the documentation
@emilroz
emilroz / getFilePaths.m
Last active August 29, 2015 14:08
Get Fileset file paths.
function [original_file_paths, client_file_paths] = ...
getFilePaths(session, image_id)
% GETFILEPATHS Retrieve the fileset's file paths.
%
% [original_file_path, client_file_paths] = getFilePaths(session, image_id)
% returns file paths to the Original Files and Client Paths (recorded on import).
%
% author: Emil Rozbicki <emil@glencoesoftware.com
% Copyright (C) 2014 Glencoe Software, Inc.
% All rights reserved.
@emilroz
emilroz / getOriginalMetadata.m
Created November 5, 2014 12:42
Retrieve Original Metadata from OMERO using MATLAB toolbox
function [global_metadata, series_metadata] = ...
getOriginalMetadata(client, session, image_id)
% GETORIGINALMETADATA Retrieves the global and the series orignal metadata.
%
% author: Emil Rozbicki <emil@glencoesoftware.com
% Copyright (C) 2014 Glencoe Software, Inc.
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are met:
@emilroz
emilroz / CMakeLists.txt
Last active August 29, 2015 14:08
Example use of Bio-formats CPP library
cmake_minimum_required(VERSION 2.8)
project(test_bio)
set(CMAKE_PREFIX_PATH "/usr/local/lib/cmake/;${CMAKE_PREFIX_PATH}")
set(CMAKE_MODULE_PATH "/usr/local/lib/cmake/;${CMAKE_MODULE_PATH}")
find_package(ome-bioformats REQUIRED)
include_directories(${OME_BIOFORMATS_INCLUDE_DIR})
MESSAGE(STATUS "OME BIOFORMATS: " ${OME_BIOFORMATS_INCLUDE_DIR})
@emilroz
emilroz / downloadOriginalFiles
Last active August 29, 2015 14:08
Download Original Files belonging to the fileset (OMERO)
function downloadedFileList = ...
downloadOriginalFiles(session, imageId, folder, chunkSize)
% DOWNLOADORIGINALFILES downloaded original files assosiated with the Image.
%
% downloadedFileList = getFilePaths(session, image_id, folder, chunkSize)
% returns list of paths to downloaded files.
%
% author: Emil Rozbicki <emil@glencoesoftware.com
% Copyright (C) 2014 Glencoe Software, Inc.
% All rights reserved.
@emilroz
emilroz / update_image_names.py
Last active August 29, 2015 14:10
Script shows how to change file names after import. Custom filter are used to select images of interest.
'''
Copyright (C) 2014 Glencoe Software, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
@emilroz
emilroz / check_thumbnails.py
Last active August 29, 2015 14:11
Check for permission issues with thumbnails.
'''
Copyright (C) 2014 Glencoe Software, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
@emilroz
emilroz / getImageListFromPlate.m
Last active August 29, 2015 14:15
Retrieve a list of image ids contained in a plate.
function well_list_return = ...
getImageListFromPlate(session, plate_id)
% GETIMAGELISTFROMPLATE retrieves a list of image ids belonging to plate id.
%
% well_list_return = getImageListFromPlate(session, plate_id)
% returns 3D array of Image ID of size (# of columns, # of rows, # of
% fields)
%
% author: Emil Rozbicki <emil@glencoesoftware.com
% Copyright (C) 2015 Glencoe Software, Inc.
@emilroz
emilroz / Create_mask.py
Created January 18, 2016 12:47
Create masks in OMERO.
import omero
from omero.rtypes import rint, rdouble
from omero.gateway import ColorHolder
from omero.gateway import BlitzGateway
import numpy
import struct
import math
@emilroz
emilroz / TiledWriter.java
Last active January 19, 2017 13:55
Basic ome.tif tile writer
public void dummyTiledTiff(
String directory, String imageName)
throws DependencyException, ServiceException,
FormatException, IOException
{
Integer sizeX = 1024;
Integer sizeY = 1024;
Integer sizeC = 4;
Integer bpp = 2;
Integer tileSizeX = 256;