omero-integration
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOMERO Integration
OMERO 集成
Overview
概述
OMERO is an open-source platform for managing, visualizing, and analyzing microscopy images and metadata. Access images via Python API, retrieve datasets, analyze pixels, manage ROIs and annotations, for high-content screening and microscopy workflows.
OMERO是一个用于管理、可视化和分析显微图像及元数据的开源平台。可通过Python API访问图像、检索数据集、分析像素、管理ROI和标注,适用于高内涵筛选和显微工作流。
When to Use This Skill
何时使用此技能
This skill should be used when:
- Working with OMERO Python API (omero-py) to access microscopy data
- Retrieving images, datasets, projects, or screening data programmatically
- Analyzing pixel data and creating derived images
- Creating or managing ROIs (regions of interest) on microscopy images
- Adding annotations, tags, or metadata to OMERO objects
- Storing measurement results in OMERO tables
- Creating server-side scripts for batch processing
- Performing high-content screening analysis
在以下场景中应使用此技能:
- 使用OMERO Python API(omero-py)访问显微数据
- 以编程方式检索图像、数据集、项目或筛选数据
- 分析像素数据并创建衍生图像
- 在显微图像上创建或管理ROI(感兴趣区域)
- 为OMERO对象添加标注、标签或元数据
- 将测量结果存储在OMERO表格中
- 创建用于批量处理的服务器端脚本
- 执行高内涵筛选分析
Core Capabilities
核心功能
This skill covers eight major capability areas. Each is documented in detail in the references/ directory:
此技能涵盖八大核心功能领域,每个领域的详细文档都在references/目录中:
1. Connection & Session Management
1. 连接与会话管理
File:
references/connection.mdEstablish secure connections to OMERO servers, manage sessions, handle authentication, and work with group contexts. Use this for initial setup and connection patterns.
Common scenarios:
- Connect to OMERO server with credentials
- Use existing session IDs
- Switch between group contexts
- Manage connection lifecycle with context managers
文件:
references/connection.md建立与OMERO服务器的安全连接,管理会话,处理身份验证,并在组上下文下工作。用于初始设置和连接模式配置。
常见场景:
- 使用凭据连接OMERO服务器
- 使用现有会话ID
- 在不同组上下文间切换
- 使用上下文管理器管理连接生命周期
2. Data Access & Retrieval
2. 数据访问与检索
File:
references/data_access.mdNavigate OMERO's hierarchical data structure (Projects → Datasets → Images) and screening data (Screens → Plates → Wells). Retrieve objects, query by attributes, and access metadata.
Common scenarios:
- List all projects and datasets for a user
- Retrieve images by ID or dataset
- Access screening plate data
- Query objects with filters
文件:
references/data_access.md浏览OMERO的层级数据结构(项目→数据集→图像)和筛选数据(筛选集→培养板→孔)。检索对象、按属性查询并访问元数据。
常见场景:
- 列出用户的所有项目和数据集
- 通过ID或数据集检索图像
- 访问筛选培养板数据
- 使用过滤器查询对象
3. Metadata & Annotations
3. 元数据与标注
File:
references/metadata.mdCreate and manage annotations including tags, key-value pairs, file attachments, and comments. Link annotations to images, datasets, or other objects.
Common scenarios:
- Add tags to images
- Attach analysis results as files
- Create custom key-value metadata
- Query annotations by namespace
文件:
references/metadata.md创建和管理标注,包括标签、键值对、文件附件和注释。将标注关联到图像、数据集或其他对象。
常见场景:
- 为图像添加标签
- 将分析结果作为文件附加
- 创建自定义键值元数据
- 按命名空间查询标注
4. Image Processing & Rendering
4. 图像处理与渲染
File:
references/image_processing.mdAccess raw pixel data as NumPy arrays, manipulate rendering settings, create derived images, and manage physical dimensions.
Common scenarios:
- Extract pixel data for computational analysis
- Generate thumbnail images
- Create maximum intensity projections
- Modify channel rendering settings
文件:
references/image_processing.md以NumPy数组形式访问原始像素数据,操作渲染设置,创建衍生图像,并管理物理尺寸。
常见场景:
- 提取像素数据用于计算分析
- 生成缩略图
- 创建最大强度投影
- 修改通道渲染设置
5. Regions of Interest (ROIs)
5. 感兴趣区域(ROIs)
File:
references/rois.mdCreate, retrieve, and analyze ROIs with various shapes (rectangles, ellipses, polygons, masks, points, lines). Extract intensity statistics from ROI regions.
Common scenarios:
- Draw rectangular ROIs on images
- Create polygon masks for segmentation
- Analyze pixel intensities within ROIs
- Export ROI coordinates
文件:
references/rois.md创建、检索和分析不同形状的ROI(矩形、椭圆、多边形、掩码、点、线)。提取ROI区域内的强度统计数据。
常见场景:
- 在图像上绘制矩形ROI
- 创建用于分割的多边形掩码
- 分析ROI内的像素强度
- 导出ROI坐标
6. OMERO Tables
6. OMERO表格
File:
references/tables.mdStore and query structured tabular data associated with OMERO objects. Useful for analysis results, measurements, and metadata.
Common scenarios:
- Store quantitative measurements for images
- Create tables with multiple column types
- Query table data with conditions
- Link tables to specific images or datasets
文件:
references/tables.md存储和查询与OMERO对象关联的结构化表格数据,适用于分析结果、测量数据和元数据。
常见场景:
- 存储图像的定量测量结果
- 创建包含多种列类型的表格
- 按条件查询表格数据
- 将表格关联到特定图像或数据集
7. Scripts & Batch Operations
7. 脚本与批量操作
File:
references/scripts.mdCreate OMERO.scripts that run server-side for batch processing, automated workflows, and integration with OMERO clients.
Common scenarios:
- Process multiple images in batch
- Create automated analysis pipelines
- Generate summary statistics across datasets
- Export data in custom formats
文件:
references/scripts.md创建在服务器端运行的OMERO.scripts,用于批量处理、自动化工作流以及与OMERO客户端集成。
常见场景:
- 批量处理多张图像
- 创建自动化分析流水线
- 生成跨数据集的汇总统计数据
- 以自定义格式导出数据
8. Advanced Features
8. 高级功能
File:
references/advanced.mdCovers permissions, filesets, cross-group queries, delete operations, and other advanced functionality.
Common scenarios:
- Handle group permissions
- Access original imported files
- Perform cross-group queries
- Delete objects with callbacks
文件:
references/advanced.md涵盖权限管理、文件集、跨组查询、删除操作及其他高级功能。
常见场景:
- 处理组权限
- 访问原始导入文件
- 执行跨组查询
- 通过回调删除对象
Installation
安装
bash
uv pip install omero-pyRequirements:
- Python 3.7+
- Zeroc Ice 3.6+
- Access to an OMERO server (host, port, credentials)
bash
uv pip install omero-py要求:
- Python 3.7+
- Zeroc Ice 3.6+
- 可访问OMERO服务器(主机、端口、凭据)
Quick Start
快速开始
Basic connection pattern:
python
from omero.gateway import BlitzGateway基础连接模式:
python
from omero.gateway import BlitzGatewayConnect to OMERO server
Connect to OMERO server
conn = BlitzGateway(username, password, host=host, port=port)
connected = conn.connect()
if connected:
# Perform operations
for project in conn.listProjects():
print(project.getName())
# Always close connection
conn.close()else:
print("Connection failed")
**Recommended pattern with context manager:**
```python
from omero.gateway import BlitzGateway
with BlitzGateway(username, password, host=host, port=port) as conn:
# Connection automatically managed
for project in conn.listProjects():
print(project.getName())
# Automatically closed on exitconn = BlitzGateway(username, password, host=host, port=port)
connected = conn.connect()
if connected:
# Perform operations
for project in conn.listProjects():
print(project.getName())
# Always close connection
conn.close()else:
print("Connection failed")
**推荐的上下文管理器模式**:
```python
from omero.gateway import BlitzGateway
with BlitzGateway(username, password, host=host, port=port) as conn:
# Connection automatically managed
for project in conn.listProjects():
print(project.getName())
# Automatically closed on exitSelecting the Right Capability
选择合适的功能
For data exploration:
- Start with to establish connection
references/connection.md - Use to navigate hierarchy
references/data_access.md - Check for annotation details
references/metadata.md
For image analysis:
- Use for pixel data access
references/image_processing.md - Use for region-based analysis
references/rois.md - Use to store results
references/tables.md
For automation:
- Use for server-side processing
references/scripts.md - Use for batch data retrieval
references/data_access.md
For advanced operations:
- Use for permissions and deletion
references/advanced.md - Check for cross-group queries
references/connection.md
用于数据探索:
- 从开始建立连接
references/connection.md - 使用浏览层级结构
references/data_access.md - 查看了解标注详情
references/metadata.md
用于图像分析:
- 使用访问像素数据
references/image_processing.md - 使用进行基于区域的分析
references/rois.md - 使用存储结果
references/tables.md
用于自动化:
- 使用进行服务器端处理
references/scripts.md - 使用进行批量数据检索
references/data_access.md
用于高级操作:
- 使用处理权限和删除操作
references/advanced.md - 查看了解跨组查询
references/connection.md
Common Workflows
常见工作流
Workflow 1: Retrieve and Analyze Images
工作流1:检索并分析图像
- Connect to OMERO server ()
references/connection.md - Navigate to dataset ()
references/data_access.md - Retrieve images from dataset ()
references/data_access.md - Access pixel data as NumPy array ()
references/image_processing.md - Perform analysis
- Store results as table or file annotation (or
references/tables.md)references/metadata.md
- 连接到OMERO服务器()
references/connection.md - 导航到数据集()
references/data_access.md - 从数据集检索图像()
references/data_access.md - 以NumPy数组形式访问像素数据()
references/image_processing.md - 执行分析
- 将结果存储为表格或文件标注(或
references/tables.md)references/metadata.md
Workflow 2: Batch ROI Analysis
工作流2:批量ROI分析
- Connect to OMERO server
- Retrieve images with existing ROIs ()
references/rois.md - For each image, get ROI shapes
- Extract pixel intensities within ROIs ()
references/rois.md - Store measurements in OMERO table ()
references/tables.md
- 连接到OMERO服务器
- 检索带有现有ROI的图像()
references/rois.md - 针对每张图像,获取ROI形状
- 提取ROI内的像素强度()
references/rois.md - 将测量结果存储在OMERO表格中()
references/tables.md
Workflow 3: Create Analysis Script
工作流3:创建分析脚本
- Design analysis workflow
- Use OMERO.scripts framework ()
references/scripts.md - Access data through script parameters
- Process images in batch
- Generate outputs (new images, tables, files)
- 设计分析工作流
- 使用OMERO.scripts框架()
references/scripts.md - 通过脚本参数访问数据
- 批量处理图像
- 生成输出(新图像、表格、文件)
Error Handling
错误处理
Always wrap OMERO operations in try-except blocks and ensure connections are properly closed:
python
from omero.gateway import BlitzGateway
import traceback
try:
conn = BlitzGateway(username, password, host=host, port=port)
if not conn.connect():
raise Exception("Connection failed")
# Perform operations
except Exception as e:
print(f"Error: {e}")
traceback.print_exc()
finally:
if conn:
conn.close()始终将OMERO操作包裹在try-except块中,并确保连接被正确关闭:
python
from omero.gateway import BlitzGateway
import traceback
try:
conn = BlitzGateway(username, password, host=host, port=port)
if not conn.connect():
raise Exception("Connection failed")
# Perform operations
except Exception as e:
print(f"Error: {e}")
traceback.print_exc()
finally:
if conn:
conn.close()Additional Resources
额外资源
- Official Documentation: https://omero.readthedocs.io/en/stable/developers/Python.html
- BlitzGateway API: https://omero.readthedocs.io/en/stable/developers/Python.html#omero-blitzgateway
- OMERO Model: https://omero.readthedocs.io/en/stable/developers/Model.html
- Community Forum: https://forum.image.sc/tag/omero
Notes
注意事项
- OMERO uses group-based permissions (READ-ONLY, READ-ANNOTATE, READ-WRITE)
- Images in OMERO are organized hierarchically: Project > Dataset > Image
- Screening data uses: Screen > Plate > Well > WellSample > Image
- Always close connections to free server resources
- Use context managers for automatic resource management
- Pixel data is returned as NumPy arrays for analysis
- OMERO使用基于组的权限(只读、可读可标注、可读可写)
- OMERO中的图像按层级组织:项目 > 数据集 > 图像
- 筛选数据的层级为:筛选集 > 培养板 > 孔 > 孔样本 > 图像
- 始终关闭连接以释放服务器资源
- 使用上下文管理器实现自动资源管理
- 像素数据以NumPy数组形式返回,便于分析