Skip to content

Commit 1e24731

Browse files
authored
Merge pull request #107 from Hendrik-code/coverage
Coverage
2 parents 597a205 + d0aa88d commit 1e24731

15 files changed

Lines changed: 1190 additions & 3 deletions

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
[![Stable Version](https://img.shields.io/pypi/v/tptbox?label=stable)](https://pypi.python.org/pypi/tptbox/)
99
[![tests](https://github.com/Hendrik-code/TPTBox/actions/workflows/tests.yml/badge.svg)](https://github.com/Hendrik-code/TPTBox/actions/workflows/tests.yml)
1010
[![codecov](https://codecov.io/gh/Hendrik-code/TPTBox/graph/badge.svg?token=A7FWUKO9Y4)](https://codecov.io/gh/Hendrik-code/TPTBox)
11+
[![Documentation](https://readthedocs.org/projects/tptbox/badge/?version=latest)](https://tptbox.readthedocs.io/en/latest/)
1112
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
1213

1314

@@ -22,6 +23,31 @@ It can find, filter, search any BIDS_Family and subjects, and has many functiona
2223
- Logging everything consistently
2324
- ...
2425

26+
## Documentation
27+
28+
Full API reference and usage guides are available at **https://tptbox.readthedocs.io**.
29+
30+
The docs cover all sub-packages — `NII`, `POI`, `BIDS_FILE`, NumPy utilities,
31+
vertebra constants, spine analysis, registration, segmentation, mesh3D,
32+
stitching, and the logger — with hyperlinks back to the GitHub source.
33+
34+
## Modules
35+
36+
Each sub-package has its own README with API tables and examples:
37+
38+
| Module | Description |
39+
|---|---|
40+
| [`core`](TPTBox/core/README.md) | `NII` (NIfTI I/O and transforms), `POI` (anatomical landmarks), BIDS dataset navigation, NumPy utilities, vertebra constants |
41+
| [`core/poi_fun`](TPTBox/core/poi_fun/README.md) | Internal POI computation strategies (surface points, corpus centers, disc points) |
42+
| [`spine`](TPTBox/spine/README.md) | Spine-specific tools: 2D snapshot generation and statistical measurements |
43+
| [`spine/snapshot2D`](TPTBox/spine/snapshot2D/README.md) | Modular 2D image generation — axial/sagittal/coronal slices, MIPs, segmentation overlays |
44+
| [`spine/spinestats`](TPTBox/spine/spinestats/README.md) | Clinical spine measurements: distances, angles, disc heights, IVD landmarks |
45+
| [`registration`](TPTBox/registration/README.md) | Rigid and deformable image registration via ANTs and DeepALI |
46+
| [`segmentation`](TPTBox/segmentation/README.md) | Integration with SPINEPS, VibeSeg/TotalVibeSeg, and nnU-Net pipelines |
47+
| [`mesh3D`](TPTBox/mesh3D/README.md) | 3D surface mesh generation and rendering from segmentation volumes |
48+
| [`stitching`](TPTBox/stitching/README.md) | Multi-station NIfTI stitching for whole-body or long-spine acquisitions |
49+
| [`logger`](TPTBox/logger/README.md) | Structured, consistent logging for medical image processing pipelines |
50+
2551
## Install the package
2652
```bash
2753
conda create -n 3.10 python=3.10
@@ -93,7 +119,7 @@ Python function and script for arbitrary image stitching. [See Details](TPTBox/s
93119

94120
![Example of two lumbar vertebrae. The left example is derived from 1 mm isotropic CT, the right from sagittal MRI with a resolution of 3.3 mm in the left–right direction. Top row: Subregion of the vertebra used for analysis. Middle row: Extreme points. Bottom row: Corpus edge and ligamentum flavum points.](TPTBox/images/poi_preview.png)
95121
For our Spine segmentation pipline follow the installation of [SPINEPS](https://github.com/Hendrik-code/spineps).
96-
Image Source: Rule-based Key-Point Extraction for MR-Guided Biomechanical Digital Twins of the Spine;
122+
Image Source: Rule-based Key-Point Extraction for MR-Guided Biomechanical Digital Twins of the Spine;
97123

98124

99125

@@ -252,4 +278,4 @@ TBD
252278
253279
> [!IMPORTANT]
254280
> Importantly
255-
-->
281+
-->

docs/modules/core.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "TPTBox/core/README.md"

docs/modules/logger.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "TPTBox/logger/README.md"

docs/modules/mesh3d.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "TPTBox/mesh3D/README.md"

docs/modules/poi_fun.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "TPTBox/core/poi_fun/README.md"

docs/modules/registration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "TPTBox/registration/README.md"

docs/modules/segmentation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "TPTBox/segmentation/README.md"

docs/modules/snapshot2d.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "TPTBox/spine/snapshot2D/README.md"

docs/modules/spine.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Spine (`TPTBox.spine`)
2+
3+
Spine-specific utilities built on top of the core `NII` and `POI` abstractions.
4+
Contains two sub-modules: 2D snapshot generation and statistical spine measurements.
5+
6+
## Sub-modules
7+
8+
| Sub-module | Description |
9+
|---|---|
10+
| [`snapshot2D/`](snapshot2d.md) | Modular 2D image snapshot generation (slices, MIPs, overlays) |
11+
| [`spinestats/`](spinestats.md) | Clinical measurements: distances, Cobb angles, IVD POIs, endplates |
12+
13+
## Quick Example
14+
15+
```python
16+
from TPTBox import NII, calc_centroids
17+
from TPTBox.spine.snapshot2D.snapshot_modular import Snapshot_Frame, create_snapshot
18+
19+
ct = NII.load("ct.nii.gz", seg=False)
20+
seg = NII.load("seg.nii.gz", seg=True)
21+
22+
# Generate a 2D sagittal snapshot with a segmentation overlay
23+
create_snapshot(
24+
[Snapshot_Frame(image=ct, segmentation=seg, mode="CT")],
25+
to="snapshot.png",
26+
)
27+
```

docs/modules/spinestats.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "TPTBox/spine/spinestats/README.md"

0 commit comments

Comments
 (0)