BrainGlobe Atlas API 项目教程
1. 项目的目录结构及介绍
BrainGlobe Atlas API 项目的目录结构如下:
brainglobe-atlasapi/
├── brainglobe_atlasapi/
│ ├── __init__.py
│ ├── atlas.py
│ ├── utils.py
│ └── ...
├── tests/
│ ├── test_atlas.py
│ ├── test_utils.py
│ └── ...
├── tutorials/
│ ├── tutorial_1.ipynb
│ ├── tutorial_2.ipynb
│ └── ...
├── .gitignore
├── .pre-commit-config.yaml
├── CITATION.cff
├── LICENSE
├── MANIFEST.in
├── README.md
├── pyproject.toml
└── ...
目录结构介绍
brainglobe_atlasapi/
: 包含项目的主要代码文件,如__init__.py
,atlas.py
,utils.py
等。tests/
: 包含项目的测试文件,如test_atlas.py
,test_utils.py
等。tutorials/
: 包含项目的教程文件,如tutorial_1.ipynb
,tutorial_2.ipynb
等。.gitignore
: 指定 Git 忽略的文件和目录。.pre-commit-config.yaml
: 配置预提交钩子。CITATION.cff
: 项目的引用信息。LICENSE
: 项目的许可证。MANIFEST.in
: 指定打包时包含的文件。README.md
: 项目的介绍和使用说明。pyproject.toml
: 项目的配置文件。
2. 项目的启动文件介绍
BrainGlobe Atlas API 项目的启动文件主要是 brainglobe_atlasapi/__init__.py
。这个文件负责初始化项目并导入必要的模块。
__init__.py
文件内容
from .atlas import BrainGlobeAtlas
from .utils import show_atlases
__all__ = ['BrainGlobeAtlas', 'show_atlases']
启动文件介绍
BrainGlobeAtlas
: 这是项目的主要类,用于创建和管理脑图谱对象。show_atlases
: 这是一个实用函数,用于显示可用的脑图谱列表。
3. 项目的配置文件介绍
BrainGlobe Atlas API 项目的配置文件主要是 pyproject.toml
。这个文件用于配置项目的构建系统和依赖项。
pyproject.toml
文件内容
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "brainglobe-atlasapi"
version = "0.1.0"
description = "A common interface for neuroanatomical atlases"
authors = [
{ name="F. Claudi", email="f.claudi@ucl.ac.uk" },
{ name="L. Petrucco", email="l.petrucco@ucl.ac.uk" },
{ name="A. L. Tyson", email="a.tyson@ucl.ac.uk" },
{ name="T. Branco", email="t.branco@ucl.ac.uk" },
{ name="T. W. Margrie", email="t.margrie@ucl.ac.uk" },
{ name="R. Portugues", email="r.portugues@ucl.ac.uk" }
]
dependencies = [
"numpy>=1.18.0",
"scipy>=1.4.0",
"matplotlib>=3.1.0",
"pandas>=1.0.0"
]
配置文件介绍
build-system
: 指定构建系统的要求和后端。project
: 包含项目的基本信息,如名称、版本、描述、作者和依赖项。
通过以上内容,您可以了解 BrainGlobe Atlas API 项目的目录结构、启动文件和配置文件的基本信息。