You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: replace absolute intra-package imports with relative imports (#67)
* fix: replace absolute intra-package imports with relative imports
All submodules imported `from physiomotion4d.X import Y` (or
`from physiomotion4d import Y`), which causes a circular import error
at package initialization time — `__init__.py` imports each submodule
while the submodules try to reach back into the partially-initialized
package. This fails consistently regardless of install method (pip
install ., editable install, or PyPI wheel).
Replaced all 34 affected files with PEP 328 relative imports
(`from .X import Y` for package submodules, `from ..X import Y` for
the cli/ sub-package). Docstring examples left unchanged.
* BUG: Affine transform mask when pre-transforming moving image
* BUG: Fixed enum name
Copy file name to clipboardExpand all lines: experiments/Heart-Create_Statistical_Model/3-registration_based_correspondence.py
+13-17Lines changed: 13 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -2,19 +2,19 @@
2
2
# %% [markdown]
3
3
# # Registration-Based Correspondence
4
4
#
5
-
# This notebook aligns ICP-aligned models from step 2 to the average surface using **ANTs SyN (Symmetric Normalization)** deformable registration via mask-based registration.
5
+
# This notebook aligns ICP-aligned models from step 2 to the average surface using **Greedy affine + ICON deformable** registration via mask-based registration.
6
6
#
7
7
# **Workflow:**
8
8
# 1. Load ICP-aligned models from `kcl-heart-model/surfaces_aligned/`
9
9
# 2. Load average surface (`average_surface.vtp`)
10
-
# 3. Use `RegisterModelsDistanceMaps` to perform ANTs SyN deformable registration
10
+
# 3. Use `RegisterModelsDistanceMaps` to perform Greedy affine + ICON deformable registration
11
11
# 4. Save corresponded models to `kcl-heart-model/surfaces_aligned_corresponded/`
12
12
# 5. Visualize before/after comparisons
13
13
# 6. Analyze deformation magnitude and registration statistics
# This notebook performed mask-based deformable registration using **ANTs SyN (Symmetric Normalization)** to establish correspondence between the ICP-aligned models and the average surface.
330
+
# This notebook performed mask-based deformable registration using **Greedy affine + ICON deformable** to establish correspondence between the ICP-aligned models and the average surface.
333
331
#
334
332
# **Next Steps:**
335
333
# - Proceed to step 4: `4-surfaces_aligned_correspond_to_pca_inputs.ipynb` to prepare data for PCA analysis
336
334
# - The corresponded models in `kcl-heart-model/surfaces_aligned_corresponded/` now have improved point-to-point correspondence
337
335
# - The registration statistics show the deformation applied to each model
338
336
#
339
337
# **Registration Details:**
340
-
# - The `RegisterModelsDistanceMaps` class uses **ANTs SyN** for progressive registration:
341
-
# 1. Rigid alignment
342
-
# 2. Affine transformation
343
-
# 3. SyN deformable registration (diffeomorphic)
344
-
# - Setting `use_ICON=True` in the `register()` call would add ICON deep learning refinement after SyN
338
+
# - The `RegisterModelsDistanceMaps` class uses a two-stage pipeline:
@@ -75,15 +75,15 @@ This experiment uses a fully automated approach combining:
75
75
76
76
Instead of traditional mesh parameterization methods (e.g., SPHARM-PDM), this pipeline uses **deformable image registration** to establish correspondences:
77
77
78
-
-**ANTs SyN (Symmetric Normalization)** performs diffeomorphic registration
78
+
-**Greedy affine** (PICSL Greedy) performs fast CPU-based affine pre-alignment
79
+
-**ICON deformable** applies deep learning registration on the affine-pre-aligned masks
79
80
- Distance maps from surface meshes create continuous fields for registration
80
-
- Progressive registration stages: rigid → affine → SyN deformable
81
81
- Mask-based approach focuses registration on anatomical structures
python 5-compute_pca_model.py # Compute PCA and export JSON model
114
114
```
115
115
116
-
**Total Runtime:** Approximately 2-4 hours depending on hardware (20 heart meshes, ANTs registration is computationally intensive).
116
+
**Total Runtime:** Approximately 1-3 hours depending on hardware (20 heart meshes; Greedy affine is fast on CPU, ICON requires a GPU for reasonable speed).
- Time: ~2-4 hours total (ANTs deformable registration is computationally intensive)
181
+
- GPU: Recommended for ICON deformable registration (CUDA-capable GPU)
182
+
- Time: ~1-3 hours total (Greedy is fast; ICON speed depends on GPU availability)
183
183
184
184
## Citation
185
185
186
186
If you use this experiment or the KCL dataset, please cite:
187
187
188
188
> Rodero et al. (2021), "Linking statistical shape models and simulated function in the healthy adult human heart". *PLOS Computational Biology*. DOI: [10.1371/journal.pcbi.1008851](https://doi.org/10.1371/journal.pcbi.1008851)
189
189
190
-
For ANTs registration:
191
-
> Avants BB, et al. (2011). "A reproducible evaluation of ANTs similarity metric performance in brain image registration". *NeuroImage*. DOI: [10.1016/j.neuroimage.2010.09.025](https://doi.org/10.1016/j.neuroimage.2010.09.025)
190
+
For ICON registration:
191
+
> Greer et al. (2021). "ICON: Learning Regular Maps Through Inverse Consistency". *ICCV*. DOI: [10.1109/ICCV48922.2021.00129](https://doi.org/10.1109/ICCV48922.2021.00129)
0 commit comments