Skip to main content

Read, stitch and compress Leica LAS MatrixS Screener experiments

Project description

build-status-image pypi-version wheel

Overview

This is a python module for interfacing with Leica LAS AF/X Matrix Screener experiments.

The module can be used to:

  • stitch wells from an experiment exported with the LAS AF Data Exporter

  • batch compress images lossless

  • programmatically select slides/wells/fields/images given by attributes like

    • slide (S)

    • well position (U, V)

    • field position (X, Y)

    • z-stack position (Z)

    • channel (C)

Features

  • Access experiment as a python object

  • Compress to PNGs without loosing precision, metadata or colormap

  • ImageJ stitching (Fiji is installed via fijibin)

Installation

Install using pip

pip install leicaexperiment

Examples

stitch experiment

from leicaexperiment import Experiment

# path should contain AditionalData and slide--S*
experiment = Experiment('path/to/experiment')

# if path is omitted, experiment path is used for output files
stitched_images = experiment.stitch('/path/to/output/files/')

stitch specific well

from leicaexperiment import Experiment

# path should contain AditionalData and slide--S*
stitched_images = experiment.stitch('/path/to/well')

do stuff on all images

from leicaexperiment import Experiment

experiment = Experiment('path/to/experiment--')

for image in experiment.images:
    do stuff...

do stuff on specific wells/fields

from leicaexperiment import attribute

# select specific parts
selected_wells = [well for well in experiment.wells if 'U00' in well]
for well in selected_wells:
    do stuff...

def condition(path):
    x_above = attribute(path, 'X') > 1
    x_below = attribute(path, 'X') < 5
    return x_above and x_below

selected_fields = [field for field in experiment.fields if condition(field)]
for field in selected_fields:
    do stuff..

subtract data

from leicaexperiment import attribute

# get all channels
channels = [attribute(image, 'C') for image in experiment.images]
min_ch, max_ch = min(channels), max(channels)

batch lossless compress of experiment

from leicaexperiment import Experiment, compress

e = Experiment('/path/to/experiment')
pngs = compress(e.images)
print(pngs)

API reference

API reference is at http://leicaexperiment.rtfd.org.

Development

Install dependencies and link development version of leicaexperiment to pip:

git clone https://github.com/arve0/leicaexperiment
cd leicaexperiment
pip install -r dev-requirements.txt

run test

tox

extra output, jump into pdb upon error

DEBUG=leicaexperiment tox -- --pdb -s

build api reference

make docs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leicaexperiment-0.0.2.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

leicaexperiment-0.0.2-py2.py3-none-any.whl (10.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file leicaexperiment-0.0.2.tar.gz.

File metadata

File hashes

Hashes for leicaexperiment-0.0.2.tar.gz
Algorithm Hash digest
SHA256 19e2fd4002f0d1812cd5ed376eb7c17031e60e5bb575e7ca0c57076a9f182b3d
MD5 c96bcbd6d229acd5b089b860351f9b27
BLAKE2b-256 808ee06e6ea5d9c9fac7bab7494eeeab09281728df8dd36cc8c9b6adb304a744

See more details on using hashes here.

File details

Details for the file leicaexperiment-0.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for leicaexperiment-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 697a4c6399dd4c2c351711e13ce090480c51645e8da4db6c426b5645e8a5e02f
MD5 50ea555e7b9658ce29b94170a5561ba6
BLAKE2b-256 c81d7e85aa8a41797da6861e6f3123f82eefd1fb5c0d4298f9ed9579b00ec5b8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page