跳转到主要内容

读取、拼接和压缩莱卡LAS矩阵筛选器实验

项目描述

build-status-image pypi-version wheel

概述

这是一个用于与 莱卡LAS AF/X矩阵筛选器 实验交互的Python模块。

该模块可用于:

  • 使用 LAS AF数据导出器 导出的实验中的孔板拼接

  • 无损批量压缩图像

  • 根据属性(如

    • 幻灯片 (S)

    • 孔位置 (U, V)

    • 字段位置 (X, Y)

    • z堆栈位置 (Z)

    • 通道 (C)

进行选择程序化选择幻灯片/孔/字段/图像

  • 访问实验作为Python对象

  • 压缩为PNG而不丢失精度、元数据或色彩图

  • ImageJ拼接(Fiji通过fijibin安装)

安装

使用pip安装...

pip install leicaexperiment

示例

拼接实验

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/')

# get information about placement of images in the stitch
xs, ys, attrs = experiment.stitch_coordinates(well_x=0, well_y=0)

拼接特定孔

from leicaexperiment import stitch

stitched_images = stitch('/path/to/well')

对所有图像进行操作

from leicaexperiment import Experiment

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

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

对特定孔/字段进行操作

from leicaexperiment import Experiment
from PIL import Image

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

# on images in well --U00--V00
for well in experiment.well_images(0, 0):
    do stuff...

# rotate top left image in first row
rows = experiment.well_rows
for r in rows:
    img_path = experiment.image(r, 0, 0, 0)
    img = Image.open(img_path)
    img = img.rotate(90)
    img.save(img_path)

从文件名中减去属性

from leicaexperiment import attribute

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

批量无损压缩实验

from leicaexperiment import Experiment

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

API参考

API参考在http://leicaexperiment.rtfd.org

开发

安装依赖项并将leicaexperiment的开发版本链接到pip

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

运行测试

pip install tox
tox

额外输出,错误时跳转到pdb

DEBUG=leicaexperiment tox -- --pdb -s

构建API参考

pip install -r docs/requirements.txt
make docs

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源代码分发

leicaexperiment-0.2.0.tar.gz (1.3 MB 查看哈希值)

上传时间 源代码

构建分发

leicaexperiment-0.2.0-py2.py3-none-any.whl (11.9 kB 查看哈希值)

上传时间 Python 2 Python 3

支持