跳转到主要内容

Blue Brain BioExplorer的Python API

项目描述

Blue Brain BioExplorer Python SDK

bioexplorer软件包为Blue Brain BioExplorer应用程序提供扩展的Python API

安装

1. 从Python包索引

(venv)$ pip install bioexplorer

2. 从源代码

克隆存储库并安装

(venv)$ git clone https://github.com/BlueBrain/BioExplorer.git
(venv)$ cd BioExplorer/bioexplorer/pythonsdk
(venv)$ pip install .

API

连接到运行的Blue Brain BioExplorer实例

from bioexplorer import BioExplorer
bio_explorer = BioExplorer('localhost:5000')

快照

以下示例说明如何连接到Blue Brain BioExplorer并将当前视图的快照导出到磁盘。快照以512x512的分辨率导出到/tmp文件夹,每个像素有16个样本。

from bioexplorer import BioExplorer, MovieMaker

bio_explorer = BioExplorer('localhost:5000')
movie_maker = MovieMaker(bio_explorer)

movie_maker.create_snapshot(
    renderer='bio_explorer', path='/tmp', base_name='test', ,size=[512, 512], samples_per_pixel=16)

电影

以下示例说明如何连接到Blue Brain BioExplorer并根据给定的相机控制点生成一系列帧。帧导出到/tmp文件夹。

from bioexplorer import BioExplorer, MovieMaker

bio_explorer = BioExplorer('localhost:5000')
movie_maker = MovieMaker(bio_explorer)

control_points = [
    {
        'apertureRadius': 0.0,
        'direction': [0.0, 0.0, -1.0],
        'focusDistance': 0.0,
        'origin': [0.5, 0.5, 1.5],
        'up': [0.0, 1.0, 0.0]
    },
    {
        'apertureRadius': 0.0,
        'direction': [-0.482, -0.351, -0.802],
        'focusDistance': 0.0,
        'origin': [2.020, 1.606, 3.030],
        'up': [-0.199, 0.936, -0.289]
    }
]

movie_maker.build_camera_path(
    control_points=control_points, nb_steps_between_control_points=50,
    smoothing_size=50)

movie_maker.set_current_frame(10)
movie_maker.create_movie(
    path='/tmp', size=[512, 512], samples_per_pixel=16, start_frame=10, end_frame=20)

上传到pypi

twine upload dist/*

项目详情


下载文件

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

源分布

bioexplorer-1.7.1.tar.gz (67.1 kB 查看哈希值)

上传

由...

AWSAWS 云计算和安全赞助商DatadogDatadog 监控FastlyFastly CDNGoogleGoogle 下载分析MicrosoftMicrosoft PSF赞助商PingdomPingdom 监控SentrySentry 错误日志StatusPageStatusPage 状态页面