Skip to content

Commit ee1cc10

Browse files
committed
Add baseline comparison tests for time-series image registration
- TestTools: compare_result_to_baseline_transform and compare_result_to_baseline_image - TestRegisterTimeSeriesImages: baseline .hdf transforms and .mha images - pytest --create-baselines support; CI and test docs updated
1 parent b5be1c1 commit ee1cc10

21 files changed

Lines changed: 276 additions & 139 deletions

.cursor/rules/project-standards.mdc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,7 @@ The user prefers to review and stage changes manually.
100100
- Make atomic commits with clear messages
101101
- Don't commit large binary files (add to `.gitignore`)
102102
- Use `git status` to verify changes before committing
103+
104+
**Code and documentation versions:**
105+
- Refer to code and documentation in the folder reference_code to get examples and documentation of the APIs and best practices for the advanced libraries used in this project:
106+
- ITK, VTK, PyVista, Omniverse, PhysicsNeMo, Simpleware, MONAI, and OpenUSD

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.hdf filter=lfs diff=lfs merge=lfs -text
2+
*.mha filter=lfs diff=lfs merge=lfs -text

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
steps:
3636
- name: Checkout code
3737
uses: actions/checkout@v4
38+
with:
39+
lfs: true
3840

3941
- name: Free up disk space on Ubuntu
4042
if: matrix.os == 'ubuntu-latest'
@@ -134,6 +136,8 @@ jobs:
134136
steps:
135137
- name: Checkout code
136138
uses: actions/checkout@v4
139+
with:
140+
lfs: true
137141

138142
- name: Free up disk space
139143
run: |
@@ -264,6 +268,8 @@ jobs:
264268
steps:
265269
- name: Checkout code
266270
uses: actions/checkout@v4
271+
with:
272+
lfs: true
267273

268274
- name: Set up Python ${{ matrix.python-version }}
269275
uses: actions/setup-python@v5
@@ -341,6 +347,8 @@ jobs:
341347
steps:
342348
- name: Checkout code
343349
uses: actions/checkout@v4
350+
with:
351+
lfs: true
344352

345353
- name: Set up Python 3.10
346354
uses: actions/setup-python@v5

.github/workflows/test-slow.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
steps:
1818
- name: Checkout code
1919
uses: actions/checkout@v4
20+
with:
21+
lfs: true
2022

2123
- name: Set up Python 3.10
2224
uses: actions/setup-python@v5

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ network_weights
2424
# Data files
2525
*.gz
2626
*.mat
27-
*.mha
2827
*.mhd
2928
*.zip
3029
*.nii

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ PhysioMotion4D is a comprehensive medical imaging package that converts 4D CT sc
2929
- NVIDIA GPU with CUDA 12.6+ (for AI models and registration)
3030
- 16GB+ RAM (32GB+ recommended for large datasets)
3131
- NVIDIA Omniverse (for USD visualization)
32+
- **Git LFS** (required for running tests: baseline files in `tests/baselines/` are stored with Git LFS; install from [git-lfs.github.com](https://git-lfs.github.com), then run `git lfs install` and `git lfs pull` after cloning)
3233

3334
### Installation from PyPI
3435

@@ -43,10 +44,12 @@ pip install physiomotion4d[nim]
4344

4445
### Installation from Source
4546

46-
1. **Clone the repository**:
47+
1. **Clone the repository** (Git LFS is required for tests; install it first from [git-lfs.github.com](https://git-lfs.github.com)):
4748
```bash
4849
git clone <repository-url>
4950
cd PhysioMotion4D
51+
git lfs install # if not already done
52+
git lfs pull # fetch .hdf and .mha baselines in tests/baselines/
5053
```
5154

5255
2. **Create virtual environment**:

data/KCL-Heart-Model/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
training_cases*
22
pca*
33
surfaces*
4+
labelmap*

data/Slicer-Heart-CT/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.mha

experiments/Heart-GatedCT_To_USD/0-download_and_convert_4d_to_3d.ipynb

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": null,
66
"metadata": {
77
"execution": {
88
"iopub.execute_input": "2026-02-09T04:51:59.431418Z",
@@ -22,7 +22,7 @@
2222
},
2323
{
2424
"cell_type": "code",
25-
"execution_count": 2,
25+
"execution_count": null,
2626
"metadata": {
2727
"execution": {
2828
"iopub.execute_input": "2026-02-09T04:52:14.024235Z",
@@ -45,7 +45,7 @@
4545
},
4646
{
4747
"cell_type": "code",
48-
"execution_count": 3,
48+
"execution_count": null,
4949
"metadata": {
5050
"execution": {
5151
"iopub.execute_input": "2026-02-09T04:52:14.039220Z",
@@ -65,7 +65,7 @@
6565
},
6666
{
6767
"cell_type": "code",
68-
"execution_count": 4,
68+
"execution_count": null,
6969
"metadata": {
7070
"execution": {
7171
"iopub.execute_input": "2026-02-09T04:52:14.055215Z",
@@ -74,18 +74,7 @@
7474
"shell.execute_reply": "2026-02-09T04:52:57.153872Z"
7575
}
7676
},
77-
"outputs": [
78-
{
79-
"data": {
80-
"text/plain": [
81-
"'./results//slice_fixed.mha'"
82-
]
83-
},
84-
"execution_count": 4,
85-
"metadata": {},
86-
"output_type": "execute_result"
87-
}
88-
],
77+
"outputs": [],
8978
"source": [
9079
"conv = ConvertNRRD4DTo3D()\n",
9180
"conv.load_nrrd_4d(f\"{data_dir}/TruncalValve_4DCT.seq.nrrd\")\n",

0 commit comments

Comments
 (0)