读取、拼接和压缩莱卡LAS矩阵筛选器实验
项目描述
概述
这是一个用于与 莱卡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参考
开发
安装依赖项并将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的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 78cda68457d79ce09d65159f97588b1920f2b8fd9528608c52847e0c80772632 |
|
MD5 | ee3e27b77a2a397be8bfc0747124774e |
|
BLAKE2b-256 | 5863d3abf11d82be400633385e18962c0dc48f33eafc83cc2b1d4e44d1e81b8a |
关闭
leicaexperiment-0.2.0-py2.py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 22824af7bf5a17323a28d7343f99acdfd01444c5215b0ea44b5c591fd9ca36cd |
|
MD5 | c216e06899533b0722f44e9b658867c5 |
|
BLAKE2b-256 | d58793d65217ef326ee95e42eb39a33c7803e1b45b83b4c53296303b7c6181d2 |