Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .agents/agents/architecture.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: PhysioMotion4D Architecture Agent
description: Analyzes the PhysioMotion4D codebase and produces numbered design plans with trade-offs. Does not write implementation code. Flags coordinate-system and ITK/PyVista boundary risks.
name: PhysioTwin4D Architecture Agent
description: Analyzes the PhysioTwin4D codebase and produces numbered design plans with trade-offs. Does not write implementation code. Flags coordinate-system and ITK/PyVista boundary risks.
tools: Read, Bash, Glob, Grep
---

You are an architecture agent for PhysioMotion4D. Analyze the codebase and produce
You are an architecture agent for PhysioTwin4D. Analyze the codebase and produce
clear numbered design plans with explicit trade-offs. Do not write implementation code.

## Codebase map

```text
src/physiomotion4d/
physiomotion4d_base.py — base class with shared logger
src/physiotwin4d/
physiotwin4d_base.py — base class with shared logger
segment_anatomy_base.py — abstract segmentation interface
segment_chest_*.py — TotalSegmentator, VISTA-3D, NIM, Ensemble
register_images_*.py — ICON, ANTs, Greedy, time-series wrappers
Expand All @@ -27,7 +27,7 @@ Use `docs/API_MAP.md` to locate classes and signatures without manual searching.

## Design invariants to preserve

- `PhysioMotion4DBase` inheritance for runtime workflow / segmentation /
- `PhysioTwin4DBase` inheritance for runtime workflow / segmentation /
registration / USD classes. Helper, data-container, and standalone-script
classes do not inherit.
- Segmenters return anatomy group masks with consistent label IDs.
Expand Down
6 changes: 3 additions & 3 deletions .agents/agents/docs.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
name: PhysioMotion4D Docs Agent
description: Updates docstrings, inline comments, and docs/API_MAP.md for PhysioMotion4D. Keeps claims factual, states image shapes explicitly, and does not create new .md files.
name: PhysioTwin4D Docs Agent
description: Updates docstrings, inline comments, and docs/API_MAP.md for PhysioTwin4D. Keeps claims factual, states image shapes explicitly, and does not create new .md files.
tools: Read, Edit, Bash, Glob, Grep
---

You are a documentation agent for PhysioMotion4D. Keep docstrings, type annotations,
You are a documentation agent for PhysioTwin4D. Keep docstrings, type annotations,
and the API map accurate and concise.

## Scope
Expand Down
12 changes: 6 additions & 6 deletions .agents/agents/implementation.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: PhysioMotion4D Implementation Agent
description: Implements features, bug fixes, or refactors in PhysioMotion4D. Reads source first, summarizes current behavior, proposes a numbered plan, then implements in small diffs. Calls out breaking changes.
name: PhysioTwin4D Implementation Agent
description: Implements features, bug fixes, or refactors in PhysioTwin4D. Reads source first, summarizes current behavior, proposes a numbered plan, then implements in small diffs. Calls out breaking changes.
tools: Read, Edit, Write, Bash, Glob, Grep
---

You are an implementation agent for PhysioMotion4D, an early-alpha scientific Python library
You are an implementation agent for PhysioTwin4D, an early-alpha scientific Python library
that converts 4D CT scans into animated USD models for NVIDIA Omniverse.

## Pipeline

4D CT → Segmentation → Registration → Contour Extraction → USD Export

Key modules: `physiomotion4d_base.py`, `segment_chest_*.py`, `register_images_*.py`,
Key modules: `physiotwin4d_base.py`, `segment_chest_*.py`, `register_images_*.py`,
`register_models_*.py`, `contour_tools.py`, `convert_vtk_to_usd.py`, `vtk_to_usd/`,
`workflow_*.py`. Use `docs/API_MAP.md` to locate classes before searching manually.

Expand All @@ -27,9 +27,9 @@ Key modules: `physiomotion4d_base.py`, `segment_chest_*.py`, `register_images_*.
## Code rules

- Runtime workflow / segmentation / registration / USD classes inherit from
`PhysioMotion4DBase`. Standalone scripts, data containers, and helper
`PhysioTwin4DBase`. Standalone scripts, data containers, and helper
classes do not.
- In `PhysioMotion4DBase` subclasses use `self.log_info()` / `self.log_debug()`,
- In `PhysioTwin4DBase` subclasses use `self.log_info()` / `self.log_debug()`,
never `print()`. Standalone scripts may use `print()`.
- No emojis in `.py` files. Windows cp1252 has bitten this project; keep
emojis out of code and minimize them in docs.
Expand Down
8 changes: 4 additions & 4 deletions .agents/agents/testing.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
name: PhysioMotion4D Testing Agent
description: Writes and updates pytest tests for PhysioMotion4D. Strongly prefers real downloaded data via session fixtures, states tensor shapes explicitly, and uses baseline utilities for regression.
name: PhysioTwin4D Testing Agent
description: Writes and updates pytest tests for PhysioTwin4D. Strongly prefers real downloaded data via session fixtures, states tensor shapes explicitly, and uses baseline utilities for regression.
tools: Read, Edit, Write, Bash, Glob, Grep
---

You are a testing agent for PhysioMotion4D. Write correct pytest tests that
You are a testing agent for PhysioTwin4D. Write correct pytest tests that
exercise the library's scientific pipelines using real downloaded data
wherever practical.

## Test architecture

- `tests/conftest.py` — session-scoped fixtures chaining: download → convert → segment → register
- `tests/baselines/` — stored via Git LFS; fetch with `git lfs pull`
- `src/physiomotion4d/test_tools.py` — baseline comparison utilities (`TestTools`)
- `src/physiotwin4d/test_tools.py` — baseline comparison utilities (`TestTools`)
- Markers (all opt-in via `--run-<bucket>`): `slow`, `requires_gpu`,
`requires_simpleware`, `experiment`, `tutorial`. The `requires_data` marker
no longer exists — tests that need downloadable data pull it through the
Expand Down
14 changes: 7 additions & 7 deletions .agents/skills/check-conventions/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
description: Audit changed files (or a given path) against PhysioMotion4D's hard project rules — base-class inheritance, logging, coordinate conventions, USD entry point, Windows multiprocessing guard, quoting, type-hint style, line length, and emoji ban. Reports violations without auto-fixing.
description: Audit changed files (or a given path) against PhysioTwin4D's hard project rules — base-class inheritance, logging, coordinate conventions, USD entry point, Windows multiprocessing guard, quoting, type-hint style, line length, and emoji ban. Reports violations without auto-fixing.
---

Audit PhysioMotion4D source for hard-rule violations.
Audit PhysioTwin4D source for hard-rule violations.

$ARGUMENTS

Expand All @@ -26,15 +26,15 @@ context such as class inheritance), then flag every occurrence of:

### Base class and logging
- [ ] A class that orchestrates workflow / segmentation / registration / USD
conversion but does **not** inherit from `PhysioMotion4DBase`.
conversion but does **not** inherit from `PhysioTwin4DBase`.
- [ ] A `print(` call inside the body of a class that inherits from
`PhysioMotion4DBase` (it must use `self.log_info()` / `self.log_debug()`).
`PhysioTwin4DBase` (it must use `self.log_info()` / `self.log_debug()`).
Standalone scripts and helper / data-container classes may use `print()`.

### USD / coordinate conventions
- [ ] An `import` of `physiomotion4d.vtk_to_usd` (or `from ... vtk_to_usd ...`)
from a file that is **not** `src/physiomotion4d/convert_vtk_to_usd.py`
and is **not** itself inside `src/physiomotion4d/vtk_to_usd/`.
- [ ] An `import` of `physiotwin4d.vtk_to_usd` (or `from ... vtk_to_usd ...`)
from a file that is **not** `src/physiotwin4d/convert_vtk_to_usd.py`
and is **not** itself inside `src/physiotwin4d/vtk_to_usd/`.
Experiments, CLIs, tests, and tutorials must use `ConvertVTKToUSD`.
- [ ] A docstring or comment claiming PyVista surfaces are in **RAS** — they
are in **LPS** internally; convert to USD Y-up only at export.
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/commit/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description: Stage all tracked modifications and deletions, draft a commit message from the diff, fix any pre-commit hook failures, and repeat until the commit succeeds.
---

Commit all tracked pending changes in the PhysioMotion4D repository
Commit all tracked pending changes in the PhysioTwin4D repository
(equivalent to `git commit -a`, excluding new untracked files).

$ARGUMENTS
Expand Down
4 changes: 2 additions & 2 deletions .agents/skills/doc-feature/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
description: Inspect changed PhysioMotion4D code and existing docstrings, update docstrings and inline comments with accurate shape/axis information, and regenerate docs/API_MAP.md if public APIs changed.
description: Inspect changed PhysioTwin4D code and existing docstrings, update docstrings and inline comments with accurate shape/axis information, and regenerate docs/API_MAP.md if public APIs changed.
---

Update documentation for the following in PhysioMotion4D:
Update documentation for the following in PhysioTwin4D:

$ARGUMENTS

Expand Down
4 changes: 2 additions & 2 deletions .agents/skills/impl/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
description: Read relevant PhysioMotion4D source files, summarize current behavior, propose a brief plan, then implement the requested feature or refactor in small diffs. Calls out breaking changes.
description: Read relevant PhysioTwin4D source files, summarize current behavior, propose a brief plan, then implement the requested feature or refactor in small diffs. Calls out breaking changes.
---

Implement the following in the PhysioMotion4D repository:
Implement the following in the PhysioTwin4D repository:

$ARGUMENTS

Expand Down
4 changes: 2 additions & 2 deletions .agents/skills/plan/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
description: Inspect PhysioMotion4D source files, summarize the current design, and produce a numbered implementation plan with open questions. Does not write code unless explicitly asked.
description: Inspect PhysioTwin4D source files, summarize the current design, and produce a numbered implementation plan with open questions. Does not write code unless explicitly asked.
---

Analyze the following and produce a design plan for the PhysioMotion4D repository.
Analyze the following and produce a design plan for the PhysioTwin4D repository.

Task: $ARGUMENTS

Expand Down
4 changes: 2 additions & 2 deletions .agents/skills/regen-api-map/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
description: Regenerate docs/API_MAP.md from the current source tree and report whether the public API surface changed. Run after editing any public class, method, or function signature in src/physiomotion4d.
description: Regenerate docs/API_MAP.md from the current source tree and report whether the public API surface changed. Run after editing any public class, method, or function signature in src/physiotwin4d.
---

Regenerate the PhysioMotion4D API map and report what changed.
Regenerate the PhysioTwin4D API map and report what changed.

$ARGUMENTS

Expand Down
4 changes: 2 additions & 2 deletions .agents/skills/test-feature/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
description: Inspect a PhysioMotion4D implementation and its existing tests, propose a real-data-driven test plan with baseline comparisons, then create or update pytest tests. Explains how to run them.
description: Inspect a PhysioTwin4D implementation and its existing tests, propose a real-data-driven test plan with baseline comparisons, then create or update pytest tests. Explains how to run them.
---

Write or update tests for the following in PhysioMotion4D:
Write or update tests for the following in PhysioTwin4D:

$ARGUMENTS

Expand Down
4 changes: 2 additions & 2 deletions .cursor/rules/project-standards.mdc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
description: PhysioMotion4D project standards and workflow preferences
description: PhysioTwin4D project standards and workflow preferences
alwaysApply: true
---

# PhysioMotion4D Project Standards
# PhysioTwin4D Project Standards

## File Operations

Expand Down
20 changes: 10 additions & 10 deletions .github/scripts/build_dashboard.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""
Build the nightly health dashboard for PhysioMotion4D.
Build the nightly health dashboard for PhysioTwin4D.

Reads JUnit XML test results and coverage JSON from --results-dir,
generates an HTML dashboard (index.html), a shields.io-compatible
Expand All @@ -11,7 +11,7 @@
python .github/scripts/build_dashboard.py \\
--results-dir results/ \\
--output-dir dashboard/ \\
--run-url "https://github.com/Project-MONAI/physiomotion4d/actions/runs/123" \\
--run-url "https://github.com/Project-MONAI/physiotwin4d/actions/runs/123" \\
--timestamp "2026-03-31T07:05:42Z" \\
--health-outcome "success"

Expand Down Expand Up @@ -205,11 +205,11 @@ def build_html(data: dict) -> str:
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>PhysioMotion4D — Nightly Health</title>
<title>PhysioTwin4D — Nightly Health</title>
<style>{_CSS}</style>
</head>
<body>
<h1>PhysioMotion4D &mdash; Nightly Health</h1>
<h1>PhysioTwin4D &mdash; Nightly Health</h1>
<p class="sub">
Last run: {ts_display}&nbsp;&middot;&nbsp;
<span class="badge {badge_class}">{badge_label}</span>&nbsp;&middot;&nbsp;
Expand Down Expand Up @@ -240,11 +240,11 @@ def build_html(data: dict) -> str:

<footer>
Generated by the
<a href="https://github.com/Project-MONAI/physiomotion4d/actions/workflows/nightly-health.yml"
<a href="https://github.com/Project-MONAI/physiotwin4d/actions/workflows/nightly-health.yml"
target="_blank" rel="noopener">nightly-health</a> workflow
&middot;
<a href="https://github.com/Project-MONAI/physiomotion4d"
target="_blank" rel="noopener">physiomotion4d</a>
<a href="https://github.com/Project-MONAI/physiotwin4d"
target="_blank" rel="noopener">physiotwin4d</a>
</footer>
</body>
</html>
Expand All @@ -260,7 +260,7 @@ def build_status_json(data: dict) -> dict:
"""Return a shields.io dynamic endpoint object.

Usage in README:
![Health](https://img.shields.io/endpoint?url=https://project-monai.github.io/physiomotion4d/status.json)
![Health](https://img.shields.io/endpoint?url=https://project-monai.github.io/physiotwin4d/status.json)
"""
junit = data["junit"]

Expand Down Expand Up @@ -313,7 +313,7 @@ def build_summary_md(data: dict) -> str:
status_text = "Passing"

lines = [
f"# {status_icon} PhysioMotion4D Nightly Health — {ts_display}",
f"# {status_icon} PhysioTwin4D Nightly Health — {ts_display}",
"",
f"**Status:** {status_text} &nbsp; | &nbsp; [View run]({run_url})",
"",
Expand Down Expand Up @@ -354,7 +354,7 @@ def build_summary_md(data: dict) -> str:

def main() -> None:
parser = argparse.ArgumentParser(
description="Build PhysioMotion4D nightly health dashboard"
description="Build PhysioTwin4D nightly health dashboard"
)
parser.add_argument(
"--results-dir",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ pip install -e ".[test]"
pytest tests/ -m "unit and not requires_gpu"

# Run with coverage
pytest tests/ -m "unit and not requires_gpu" --cov=physiomotion4d
pytest tests/ -m "unit and not requires_gpu" --cov=physiotwin4d
```

### GPU Tests
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
xvfb-run -a --server-args="-screen 0 1024x768x24" \
pytest tests/ -v --cov=physiomotion4d --cov-report=xml --cov-report=term --cov-report=html
pytest tests/ -v --cov=physiotwin4d --cov-report=xml --cov-report=term --cov-report=html

- name: Run unit tests (fast, no GPU/slow/experiment) - Windows
if: matrix.os == 'windows-latest'
run: |
pytest tests/ -v --cov=physiomotion4d --cov-report=xml --cov-report=term --cov-report=html
pytest tests/ -v --cov=physiotwin4d --cov-report=xml --cov-report=term --cov-report=html

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down Expand Up @@ -220,29 +220,29 @@ jobs:

- name: Run data download tests
run: |
pytest tests/test_download_heart_data.py -v --cov=physiomotion4d --cov-report=xml
pytest tests/test_download_heart_data.py -v --cov=physiotwin4d --cov-report=xml
continue-on-error: true

- name: Run data conversion tests
run: |
pytest tests/test_convert_image_4d_to_3d.py -v --cov=physiomotion4d --cov-append --cov-report=xml
pytest tests/test_convert_image_4d_to_3d.py -v --cov=physiotwin4d --cov-append --cov-report=xml
continue-on-error: true

- name: Run contour tools tests
run: |
pytest tests/test_contour_tools.py -v --cov=physiomotion4d --cov-append --cov-report=xml
pytest tests/test_contour_tools.py -v --cov=physiotwin4d --cov-append --cov-report=xml
continue-on-error: true

- name: Run USD conversion tests
run: |
xvfb-run -a --server-args="-screen 0 1024x768x24" \
pytest tests/test_convert_vtk_to_usd_polymesh.py -v --cov=physiomotion4d --cov-append --cov-report=xml
pytest tests/test_convert_vtk_to_usd_polymesh.py -v --cov=physiotwin4d --cov-append --cov-report=xml
continue-on-error: true

- name: Run USD utility tests
run: |
xvfb-run -a --server-args="-screen 0 1024x768x24" \
pytest tests/test_usd_merge.py tests/test_usd_time_preservation.py -v --cov=physiomotion4d --cov-append --cov-report=xml
pytest tests/test_usd_merge.py tests/test_usd_time_preservation.py -v --cov=physiotwin4d --cov-append --cov-report=xml
continue-on-error: true

- name: Run all integration tests
Expand Down Expand Up @@ -285,8 +285,8 @@ jobs:
# Python 3.11 is required because the [physicsnemo] extra pulls in
# nvidia-physicsnemo, which requires Python >= 3.11.
run: |
& "C:\Program Files\Python311\python.exe" -m venv "$env:RUNNER_TEMP\physiomotion4d-venv"
echo "$env:RUNNER_TEMP\physiomotion4d-venv\Scripts" >> $env:GITHUB_PATH
& "C:\Program Files\Python311\python.exe" -m venv "$env:RUNNER_TEMP\physiotwin4d-venv"
echo "$env:RUNNER_TEMP\physiotwin4d-venv\Scripts" >> $env:GITHUB_PATH

- name: Check GPU availability
run: nvidia-smi
Expand Down Expand Up @@ -340,7 +340,7 @@ jobs:
# aren't met on the runner will runtime-skip cleanly via their
# internal availability guards.
run: |
pytest tests/ -v --run-all --cov=physiomotion4d --cov-report=xml --cov-report=term --cov-report=html
pytest tests/ -v --run-all --cov=physiotwin4d --cov-report=xml --cov-report=term --cov-report=html
env:
CUDA_VISIBLE_DEVICES: 0

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/nightly-health.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name: Nightly Health
# documentation site published by docs.yml. Use the workflow status badge
# for a live pass/fail indicator in README:
#
# [![Nightly Health](https://github.com/Project-MONAI/physiomotion4d/actions/workflows/nightly-health.yml/badge.svg)](https://github.com/Project-MONAI/physiomotion4d/actions/workflows/nightly-health.yml)
# [![Nightly Health](https://github.com/Project-MONAI/physiotwin4d/actions/workflows/nightly-health.yml/badge.svg)](https://github.com/Project-MONAI/physiotwin4d/actions/workflows/nightly-health.yml)

on:
schedule:
Expand Down Expand Up @@ -58,8 +58,8 @@ jobs:
# Python 3.11 is required because the [physicsnemo] extra pulls in
# nvidia-physicsnemo, which requires Python >= 3.11.
run: |
& py -m venv "$env:RUNNER_TEMP\physiomotion4d-venv"
echo "$env:RUNNER_TEMP\physiomotion4d-venv\Scripts" >> $env:GITHUB_PATH
& py -m venv "$env:RUNNER_TEMP\physiotwin4d-venv"
echo "$env:RUNNER_TEMP\physiotwin4d-venv\Scripts" >> $env:GITHUB_PATH

- name: Cache uv packages
uses: actions/cache@v4
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
continue-on-error: true
run: |
pytest tests/ -v --run-all `
--cov=physiomotion4d `
--cov=physiotwin4d `
--cov-report=xml `
--cov-report=json `
--junitxml=test-results.xml
Expand Down
Loading
Loading