Migration Guide - 2026.11.3
Breaking changes in this release, and how to update code that depends on them.
MONAI Physio prefers compatibility: public APIs are broken only when the change is generally beneficial to future users. When a break is unavoidable, the project does not ship deprecation shims or removed-symbol stubs. Instead, substantial changes ship with code that automates the conversion, and every break is recorded here in the commit that introduces it.
At release time this file is renamed migration_<version>.md and a fresh
migration_next.md is started for the next cycle.
Entry template
Append one section per breaking change, newest last, using this shape:
## <symbol, module, or CLI flag> - <one-line summary>
**Change:** what moved, was renamed, or changed signature.
**Why:** the benefit to future users that justified the break.
**Before**
```python
old_call(argument)
```
**After**
```python
new_call(argument, required_option="value")
```
**Automated conversion:** `<path to script or CLI>`, or `None needed`.
Exterior falloff distance - replaced by a fade proportional to the surface displacement
Change: ProcessTransforms.restrict_deformation_field_to_normal_falloff_outside_mask
no longer takes falloff_distance_mm, and
WorkflowInferMovement.process_time_series no longer takes
exterior_falloff_distance_mm. Outside the mask, the displacement now comes
from the nearest mask voxel and fades over
falloff_length_per_displacement (in process_time_series,
exterior_falloff_length_per_displacement; default 3.0) times that voxel’s
displacement, never less than the smallest voxel spacing.
Why: a fixed fade distance shorter than about 1.5 times the organ’s displacement folds the warp. When a heart or lung contracts, the space it vacates was then filled with its own unmoved tissue instead of the tissue around it. A fade proportional to the displacement cannot fold, adapts to each point of the surface, and no longer reads the unreliable far tail of the spread field.
Before
transform_tools.restrict_deformation_field_to_normal_falloff_outside_mask(
field, normals, mask, direction_offset_mm, direction_transition_mm, 2.5
)
WorkflowInferMovement(infer).process_time_series(
..., exterior_mask=mask, exterior_falloff_distance_mm=10.0
)
After
transform_tools.restrict_deformation_field_to_normal_falloff_outside_mask(
field, normals, mask, direction_offset_mm, direction_transition_mm
)
WorkflowInferMovement(infer).process_time_series(..., exterior_mask=mask)
Pass falloff_length_per_displacement (or
exterior_falloff_length_per_displacement) only to change the default 3.0;
values below 1.5 can fold the warp.
Automated conversion: None needed. Delete the falloff_distance_mm /
exterior_falloff_distance_mm argument.
combine_transforms_with_masks, reduce_folding_in_field - removed
Change: ProcessTransforms.combine_transforms_with_masks and
ProcessTransforms.reduce_folding_in_field are removed.
detect_folding_in_field and compute_jacobian_determinant_from_field remain.
Why: nothing in MONAI Physio used them. Scaling the displacement only where the Jacobian determinant is low does not remove folding; it creates new steps at the edges of the scaled region, and on a heart warp it grew 982 folded voxels to 4,098. Keeping them suggested a fix that does not work.
Before
combined = transform_tools.combine_transforms_with_masks(
heart_transform, lung_transform, heart_mask, lung_mask, reference_ct
)
field = transform_tools.reduce_folding_in_field(field, jacobian)
After
jacobian = transform_tools.compute_jacobian_determinant_from_field(field)
if transform_tools.detect_folding_in_field(jacobian, threshold=0.0):
... # fix the field's source, e.g. a smoother or longer falloff
To combine two motions, restrict each with
restrict_deformation_field_to_normal_falloff_outside_mask against its own
organ mask and compose them, as tutorial 13 does for heart and lung motion.
Automated conversion: None needed; no replacement is one-to-one.
monai_physio.visualize_flow_fields.MMHG - replaced by ProcessFlowBoundaries.MMHG_PA
Change: the module-level constant MMHG (133.322) is removed. The
conversion is now the class constant ProcessFlowBoundaries.MMHG_PA
(133.322387415, Pa per mmHg) of the new monai_physio.process_flow_boundaries
module, which the viewers, the flow models and the monai_physio.aorta
subpackage share.
Why: MONAI Physio keeps constants on the classes that use them, and the mmHg unit belongs with the other solver-independent flow boundary conditions, not with one viewer. One exact value now serves every flow model, instead of a rounded module constant.
Before
from monai_physio.visualize_flow_fields import MMHG
pressure_mmhg = pressure_pa / MMHG
After
from monai_physio import ProcessFlowBoundaries
pressure_mmhg = pressure_pa / ProcessFlowBoundaries.MMHG_PA
The exact value differs from 133.322 in the sixth significant digit.
Automated conversion: python utils/migrate_flow_ns.py PATH --apply.
Physics-informed cardiac Tutorial 00 notebook - renamed
Change: tutorials/tutorial_00_infer_physics_informed_motion_duke_heart_4d_labelmaps.ipynb
is now tutorials/tutorial_00_infer_physics_informed_cardiac_motion_duke_heart_4d_labelmaps.ipynb,
and it writes to the matching
tutorials/output/tutorial_00_infer_physics_informed_cardiac_motion_duke_heart_4d_labelmaps/
directory.
Why: the name now states the organ, like its sibling
tutorial_00_infer_cardiac_motion_duke_heart_4d_labelmaps.ipynb, so the
physics-informed demo is not read as a general motion tool.
Before
jupyter notebook tutorials/tutorial_00_infer_physics_informed_motion_duke_heart_4d_labelmaps.ipynb
After
jupyter notebook tutorials/tutorial_00_infer_physics_informed_cardiac_motion_duke_heart_4d_labelmaps.ipynb
To keep the outputs of an earlier run, rename its
tutorials/output/tutorial_00_infer_physics_informed_motion_duke_heart_4d_labelmaps/
directory to the new name.
Automated conversion: None needed.
Installation extras - cuda12, cuda13, dev_cuda12 and dev_cuda13 removed; CuPy and torch-scatter no longer installed
Change: monai-physio no longer selects a PyTorch CUDA build or installs
GPU packages for you. The cuda12, cuda13, dev_cuda12 and dev_cuda13
extras are removed, with the uv index routing that pinned torch to the
CUDA 12.8 or 13.0 PyTorch index. CuPy is no longer used: the one computation
that used it, the DeformationMagnitude array of
ProcessTransforms.transform_dataset, uses NumPy and gives the same values.
torch-scatter is no longer a dependency; install the build matching your
PyTorch yourself to use MeshGraphNet
(ProcessPhysicsNemo.import_meshgraphnet raises an ImportError that says so
when it is missing). dev now includes the aorta and netgen extras.
import monai_physio no longer warns that CuPy is missing or that pip was
used.
Why: installation follows the usual PyTorch-ecosystem order - install
PyTorch for your GPU, then the packages built against it, then MONAI Physio -
so any PyTorch/CUDA combination the user chooses is accepted, pip install monai-physio installs only prebuilt wheels and never starts a
torch-scatter source build, and no uv-specific flags or CUDA-named extras
are needed. CuPy added a CUDA-specific install for no measurable gain.
Before
uv pip install "monai-physio[cuda12]" --torch-backend=cu128 -f https://data.pyg.org/whl/torch-2.11.0+cu128.html
uv pip install -e ".[dev_cuda12]" --torch-backend=cu128 -f https://data.pyg.org/whl/torch-2.11.0+cu128.html
After
pip install torch==2.11.0 torchvision --index-url https://download.pytorch.org/whl/cu128
pip install torch-scatter --only-binary torch-scatter -f https://data.pyg.org/whl/torch-2.11.0+cu128.html # MeshGraphNet
pip install nvidia-cudss-cu12 # Warp flow solvers
pip install --upgrade monai-physio # or, from a source checkout: pip install -e ".[dev]"
dev now includes netgen-mesher, which has no Linux aarch64 wheel; on
that platform install pip install -e . plus the dev tools you need.
nvidia-physicsnemo is now capped below 2.3, which requires torch>=2.13;
the cap lets pip keep an older installed torch, such as 2.11, instead of
replacing it. Upgrading an environment that has 2.3 installs 2.2.
Existing environments keep working: an installed torch-scatter stays
installed, and CuPy can be removed with pip uninstall cupy-cuda12x (or
cupy-cuda13x).
Automated conversion: None needed.