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.

Blood-flow modules - split into general and Navier-Stokes (NS) parts

Change: the Warp blood-flow modules of 2026.11.2 are split into solver-independent parts and Navier-Stokes (NS) parts. NS classes and modules carry an NS / _ns suffix and the parts solvers share a Base / _base one:

2026.11.2

2026.11.3

warp_navier_stokes.WarpNavierStokes

warp_flow_ns.WarpFlowNS, deriving from the new warp_flow_base.WarpFlowBase

warp_navier_stokes.Windkessel

process_flow_boundaries.Windkessel (still monai_physio.Windkessel)

warp_navier_stokes.inlet_flow(times, interval_flux, interval_s, sigma_s)

ProcessFlowBoundaries.inlet_flow(times_s, interval_fluxes_m3_s, interval_s, smoothing_s)

warp_navier_stokes.CuDssFactor

warp_cudss_factor.WarpCuDssFactor

warp_navier_stokes.find_cudss_library()

WarpCuDssFactor.find_library()

warp_navier_stokes.tetrahedron_edges, triangle_nodes

ProcessVolumetricMesh.tetrahedron_edges, ProcessVolumetricMesh.triangle_nodes

warp_navier_stokes.LENGTH, SPEED, PRECISIONS, CELL_CHUNK

WarpFlowNS.LENGTH, .SPEED, .PRECISIONS, .CELL_CHUNK

warp_navier_stokes integrands and kernels (velocity_form, …)

the same names in warp_flow_ns

warp_fluid_structure.WarpHyperelasticWall

warp_hyperelastic_wall.WarpHyperelasticWall (still monai_physio.WarpHyperelasticWall)

warp_fluid_structure.wall_stress, wall_tangent, linear_stress

the same names in warp_hyperelastic_wall

warp_fluid_structure.TRIANGLE_MASS, to_scipy

WarpHyperelasticWall.TRIANGLE_MASS, WarpHyperelasticWall.to_scipy

warp_fluid_structure.WarpFluidStructure

warp_fluid_structure_ns.WarpFluidStructureNS

warp_fluid_structure.laplacian, quasi_newton_update

WarpFluidStructureNS.laplacian, WarpFluidStructureNS.quasi_newton_update

visualize_flow_fields.VisualizeFlowFields

visualize_flow_fields_ns.VisualizeFlowFieldsNS, deriving from visualize_flow_fields_base.VisualizeFlowFieldsBase

visualize_flow_fields.create_app(viewer, title, notes)

viewer.create_app(title, notes)

visualize_flow_fields.VTK_TET_EDGES

VisualizeFlowFieldsNS.VTK_TET_EDGES

monai_physio.__all__ drops WarpNavierStokes, WarpFluidStructure and VisualizeFlowFields and adds ProcessFlowBoundaries, WarpFlowBase, WarpFlowNS, WarpCuDssFactor, WarpFluidStructureNS, VisualizeFlowFieldsBase and VisualizeFlowFieldsNS. The solvers’ numerics are unchanged.

Why: lattice-Boltzmann (LB) flow solvers are planned beside the Navier-Stokes one. The boundary conditions, the cuDSS factorization, the mesh helpers, the wall and most of the viewer do not depend on the Navier-Stokes discretization, so they now live where an LB solver can reuse them, and the solver-specific classes carry the NS tag that an LB class would mirror.

Before

from monai_physio import VisualizeFlowFields, WarpFluidStructure, WarpNavierStokes
from monai_physio.visualize_flow_fields import create_app
from monai_physio.warp_navier_stokes import Windkessel, find_cudss_library, inlet_flow

find_cudss_library()
flow, derivative = inlet_flow(times, fluxes, 0.03, 0.03)
solver = WarpNavierStokes(
    points,
    tetrahedra,
    faces,
    regions,
    inlet_region=1,
    outlets={2: Windkessel(1e7, 9e7, 1e-8, 0.0)},
    dt=0.005,
)
coupled = WarpFluidStructure(solver, wall, regions, reference_pressure=1e4)
viewer = VisualizeFlowFields(results)
create_app(viewer, "Flow", []).start(port=8702)

After

from monai_physio import (
    ProcessFlowBoundaries,
    VisualizeFlowFieldsNS,
    WarpCuDssFactor,
    WarpFlowNS,
    WarpFluidStructureNS,
    Windkessel,
)

WarpCuDssFactor.find_library()
flow, derivative = ProcessFlowBoundaries.inlet_flow(times, fluxes, 0.03, 0.03)
solver = WarpFlowNS(
    points,
    tetrahedra,
    faces,
    regions,
    inlet_region=1,
    outlets={2: Windkessel(1e7, 9e7, 1e-8, 0.0)},
    dt=0.005,
)
coupled = WarpFluidStructureNS(solver, wall, regions, reference_pressure=1e4)
viewer = VisualizeFlowFieldsNS(results)
viewer.create_app("Flow", []).start(port=8702)

Calls of inlet_flow that pass times=, interval_flux= or sigma_s= by keyword use times_s=, interval_fluxes_m3_s= and smoothing_s=.

Automated conversion: python utils/migrate_flow_ns.py PATH previews the changes to every .py, .rst and .md file under PATH, and --apply writes them. In Python files it follows the syntax tree: imports from the old modules (with or without as), the names they bound where those names are read, attributes read through an imported old module or its dotted path, the renamed classes, the renamed keyword arguments of inlet_flow, and create_app(viewer, ...) calls of the imported create_app. A name that a function, lambda or comprehension binds itself is left alone there. In all files it then rewrites dotted paths and class names left in strings, comments and documentation. It leaves for review, printing a warning for the first five:

  • a moved name that is also bound at module or class level in the same file (its uses are rewritten, its bindings are not);

  • moved names or old modules read inside f-strings;

  • a moved name read in a function, lambda or comprehension that binds the name it would become, such as ns.Windkessel in a function with a Windkessel parameter;

  • an import statement that mixes an old module with other names;

  • an old module used other than by reading its attributes, such as monkeypatch.setattr(wns, ...) or wns.CELL_CHUNK = 4;

  • create_app called without a positional viewer (by keyword or from *args), or used other than in a call;

  • star imports from the old modules, names reached through getattr or importlib, and code that does not parse (which gets only the text pass);

  • attributes of the old classes that moved elsewhere, such as VisualizeFlowFields.MMHG_PA of the development branch, which becomes VisualizeFlowFieldsNS.MMHG_PA; write ProcessFlowBoundaries.MMHG_PA.

The converted imports may repeat a name or be unsorted; run ruff check --fix and ruff format afterwards.

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.