The physiomotion4d-fit-statistical-model-to-patient command-line tool registers generic anatomical heart models to patient-specific imaging data and surface models. This workflow enables:
- Patient-specific anatomical modeling from generic templates
- Multi-stage registration combining ICP, PCA, and deformable methods
- Transfer of model attributes to patient-specific geometry
- Model-based segmentation refinement using shape priors
The registration pipeline consists of four stages:
- ICP Alignment: Rigid/affine alignment using surface matching
- PCA Registration (optional): Statistical shape model fitting
- Mask-to-Mask Registration: Deformable registration using distance maps
- Mask-to-Image Refinement (optional): Final intensity-based refinement
The script is included with PhysioMotion4D installation:
pip install physiomotion4dRegister a generic heart model to patient data:
physiomotion4d-fit-statistical-model-to-patient \
--template-model heart_model.vtu \
--template-labelmap heart_labelmap.nii.gz \
--patient-models lv.vtp rv.vtp myo.vtp \
--patient-image patient_ct.nii.gz \
--output-dir ./resultsInclude statistical shape model fitting:
physiomotion4d-fit-statistical-model-to-patient \
--template-model heart_model.vtu \
--template-labelmap heart_labelmap.nii.gz \
--patient-models lv.vtp rv.vtp myo.vtp \
--patient-image patient_ct.nii.gz \
--pca-json pca_model.json \
--pca-number-of-modes 10 \
--output-dir ./results--template-model PATH- Path to template/generic heart model file (.vtu, .vtk, .stl)
--template-labelmap PATH- Path to template labelmap image (.nii.gz, .nrrd, .mha)
--patient-models PATH [PATH ...]- Paths to patient-specific surface models (e.g., lv.vtp rv.vtp myo.vtp)
--patient-image PATH- Path to patient CT/MRI image (.nii.gz, .nrrd, .mha)
--output-dir DIR- Output directory for results
See :class:`physiomotion4d.WorkflowFitStatisticalModelToPatient` for API documentation.
--template-labelmap-muscle-ids ID [ID ...]- Label IDs for heart muscle in template labelmap (default: 1)
--template-labelmap-chamber-ids ID [ID ...]- Label IDs for heart chambers in template labelmap (default: 2)
--template-labelmap-background-ids ID [ID ...]- Label IDs for background in template labelmap (default: 0)
--pca-json PATH- Path to PCA JSON file for shape-based registration (optional)
--pca-group-key KEY- PCA group key in JSON file (default: All)
--pca-number-of-modes NUM- Number of PCA modes to use (default: 0, uses all if PCA enabled)
--no-mask-to-mask- Disable mask-to-mask deformable registration (default: enabled)
--no-mask-to-image- Disable mask-to-image refinement registration (default: enabled)
--use-icon-refinement- Enable ICON deep learning registration refinement (default: disabled)
--output-prefix PREFIX- Prefix for output files (default: registered)
- :doc:`heart_gated_ct` - Process cardiac gated CT data
- :doc:`vtk_to_usd` - Convert model meshes to USD format
- :doc:`lung_gated_ct` - Process lung gated CT data
physiomotion4d-fit-statistical-model-to-patient \
--template-model heart_model.vtu \
--template-labelmap heart_labelmap.nii.gz \
--patient-models lv.vtp rv.vtp myo.vtp \
--patient-image patient_ct.nii.gz \
--output-dir results/basicphysiomotion4d-fit-statistical-model-to-patient \
--template-model heart_model.vtu \
--template-labelmap heart_labelmap.nii.gz \
--patient-models lv.vtp rv.vtp \
--patient-image patient_ct.nii.gz \
--pca-json pca_model.json \
--pca-number-of-modes 10 \
--output-dir results/pca{prefix}_model.vtu- Final registered volumetric model{prefix}_model_surface.vtp- Final registered surface mesh{prefix}_labelmap.nii.gz- Final registered labelmap
{prefix}_icp_surface.vtp- Result after ICP alignment{prefix}_pca_surface.vtp- Result after PCA fitting (if used){prefix}_m2m_surface.vtp- Result after mask-to-mask registration
- :doc:`../api/workflows` - Workflow class API reference
- :doc:`heart_gated_ct` - Process cardiac gated CT data
- :doc:`overview` - CLI scripts overview