Data Downloads

Helpers for downloading and verifying optional example datasets used by the tutorials and experiments.

Module Reference

Dataset download and verification helpers.

Slicer-Heart-CT, KCL-Heart-Model, CHOP-Valve4D, Chest-CT, TCIA-4DLung, and Duke-Heart-4DLabelmaps are downloaded automatically. Other datasets require manual download, and the verification helpers check the file layouts used by the repository tutorials, experiments, and tests.

class monai_physio.download_data.DownloadData[source]

Bases: object

Download and verify optional MONAI Physio example datasets.

SLICER_HEART_CT_URL = 'https://github.com/Project-MONAI/monai-physio/releases/download/2026.07.1/TruncalValve_4DCT.seq.nrrd'
SLICER_HEART_CT_FILENAME = 'TruncalValve_4DCT.seq.nrrd'
SLICER_HEART_CT_SLICE_BASENAME = 'slice'
static download_slicer_heart_ct_data(dirname)[source]

Download the Slicer-Heart-CT 4-D CT sample into dirname.

Also splits the downloaded 4-D sequence into per-frame slice_???.mha volumes in the same directory (via ConvertImage4DTo3D), skipping the split if those files already exist.

Parameters:

dirname (Union[str, Path]) – Directory where TruncalValve_4DCT.seq.nrrd and the converted slice_???.mha files should live.

Return type:

Path

Returns:

Path to the downloaded or already-cached .seq.nrrd file.

static verify_slicer_heart_ct_data(dirname)[source]

Return True when Slicer-Heart-CT has the expected 4-D CT file.

Return type:

bool

KCL_HEART_MODEL_MESH_COUNT = 20
KCL_HEART_MODEL_INDIVIDUAL_URL_TEMPLATE = 'https://zenodo.org/records/4590294/files/{index:02d}.tar.gz?download=1'
KCL_HEART_MODEL_AVERAGE_URL = 'https://zenodo.org/records/4593739/files/average.tar.gz?download=1'
static download_kcl_heart_model_data(dirname)[source]

Download the KCL-Heart-Model dataset into dirname.

Downloads and extracts the 20 individual four-chamber heart meshes from https://zenodo.org/records/4590294 into dirname/input_meshes/01.vtk through 20.vtk, and the average heart mesh from https://zenodo.org/records/4593739 into dirname/average_mesh.vtk. Already-extracted files are reused.

Parameters:

dirname (Union[str, Path]) – Directory where the KCL-Heart-Model dataset should live.

Return type:

Path

Returns:

Path to dirname.

CHOP_VALVE4D_RELEASE_URL = 'https://github.com/Project-MONAI/monai-physio/releases/download/2026.07.1/'
CHOP_VALVE4D_ASSETS: ClassVar[dict[str, str]] = {'Alterra': 'CHOP-Valve4D-Alterra.zip', 'CT': 'CHOP-Valve4D-CT.zip', 'TPV25': 'CHOP-Valve4D-TPV25.zip'}
static download_chop_valve_4d_data(dirname)[source]

Download the CHOP-Valve4D convenience release into dirname.

Downloads the three zip archives attached to the MONAI Physio 2026.07.1 GitHub release (https://github.com/Project-MONAI/monai-physio/releases/tag/2026.07.1) and extracts each into its matching subdirectory: Alterra/ and TPV25/ (valve mesh time series, >1 GB each) and CT/ (source CT volume and Simpleware segmentation). A subdirectory that already has its expected files (see _chop_valve_4d_subdir_is_populated) is left alone, so re-running resumes an interrupted download without re-fetching a subdirectory a partial extraction left behind. See data/CHOP-Valve4D/README.md for what this converted data contains and how it relates to the original FEBio source model.

Parameters:

dirname (Union[str, Path]) – Directory where the CHOP-Valve4D dataset should live.

Return type:

Path

Returns:

Path to dirname.

static verify_chop_valve_4d_data(dirname)[source]

Return True when CHOP-Valve4D files referenced by the repo exist.

Accepted layouts are the CT volume used by Simpleware/model-to-patient experiments and the valve time-series folders used by VTK-to-USD experiments.

Return type:

bool

CHEST_CT_URL = 'https://github.com/Project-MONAI/monai-physio/releases/download/2026.07.1/Chest-CT.mha'
CHEST_CT_FILENAME = 'Chest-CT.mha'
static download_chest_ct_data(dirname)[source]

Download the Chest-CT sample volume into dirname.

Fetches Chest-CT.mha - an ungated 3-D chest CT - from the MONAI Physio 2026.07.1 GitHub release. An existing non-empty file is reused, so re-running resumes an interrupted download. See data/Chest-CT/README.md for the data source and required citation.

Parameters:

dirname (Union[str, Path]) – Directory where Chest-CT.mha should live.

Return type:

Path

Returns:

Path to the downloaded or already-cached Chest-CT.mha file.

static verify_chest_ct_data(dirname)[source]

Return True when Chest-CT has its expected CT volume.

Return type:

bool

TCIA_4D_LUNG_RELEASE_URL = 'https://github.com/Project-MONAI/monai-physio/releases/download/2026.07.1/'
TCIA_4D_LUNG_ASSETS: ClassVar[list[str]] = ['TCIA-4DLung-Part1.zip', 'TCIA-4DLung-Part2.zip']
static download_tcia_4d_lung_data(dirname)[source]

Download the TCIA-4DLung converted-subset release into dirname.

Fetches the two zip archives attached to the MONAI Physio 2026.07.1 GitHub release and extracts them directly into dirname, giving the per-case <case>/<case>_g0??.nii.gz phase volumes the lung tutorials read. This is a tutorial subset of the full TCIA 4D-Lung collection; see data/TCIA-4DLung/README.md for how to obtain the full collection manually. Already-populated data is left alone, so re-running is a no-op once the subset is present.

Parameters:

dirname (Union[str, Path]) – Directory where the TCIA-4DLung dataset should live.

Return type:

Path

Returns:

Path to dirname.

static verify_tcia_4d_lung_data(dirname)[source]

Return True when TCIA-4DLung has at least one case’s phase volumes.

Return type:

bool

DUKE_HEART_4D_LABELMAPS_URL = 'https://github.com/Project-MONAI/monai-physio/releases/download/2026.07.1/Duke-Heart-4DLabelmaps.zip'
static download_duke_heart_4d_labelmaps_data(dirname)[source]

Download the Duke-Heart-4DLabelmaps release into dirname.

Fetches Duke-Heart-4DLabelmaps.zip from the MONAI Physio 2026.07.1 GitHub release and extracts it directly into dirname, giving the per-case pm00*/ directories of *_labelmap.nii.gz and *_landmark.mrk.json files. The labelmaps were generated with the ASCardio module of Simpleware (SegmentHeartSimplewareTrimmedBranches); models trained on them should only be applied to labelmaps generated the same way. See data/Duke-Heart-4DLabelmaps/README.md. Already-populated data is left alone, so re-running is a no-op once the data is present.

Parameters:

dirname (Union[str, Path]) – Directory where the Duke-Heart-4DLabelmaps dataset should live.

Return type:

Path

Returns:

Path to dirname.

static verify_duke_heart_4d_labelmaps_data(dirname)[source]

Return True when Duke-Heart-4DLabelmaps has at least one labelmap.

Return type:

bool

static verify_dirlab_4dct_data(dirname)[source]

Return True when a supported DirLab-4DCT case layout exists.

Return type:

bool

DIRLAB_4DCT_HU_OFFSET = 1024
DIRLAB_4DCT_HU_CLIP_RANGE = (-1024, 1024)
static fix_dirlab_4dct_data(dirname, output_directory=None)[source]

Convert DirLab-4DCT raw intensities to clipped Hounsfield units.

DirLab-4DCT’s raw .img/.mhd volumes store intensities offset by +1024 from Hounsfield units. This finds every .mhd header under dirname (recursively) whose raw data has been downloaded, subtracts 1024, clips the result to DIRLAB_4DCT_HU_CLIP_RANGE, and writes the corrected volume with the same base filename but a .mha extension, compressed.

Parameters:
  • dirname (Union[str, Path]) – Directory to search recursively for .mhd headers.

  • output_directory (Union[str, Path, None]) – Directory to write the .mha files into. Defaults to writing each result next to its source .mhd header.

Return type:

list[Path]

Returns:

Paths to the written .mha files.

PHYSICSNEMO_MGN_LUNG_MOTION_URL = 'https://github.com/Project-MONAI/monai-physio/releases/download/2026.07.1/physicsnemo_mgn_lung_motion.zip'
PHYSICSNEMO_MGN_LUNG_MOTION_DIRNAME = 'physicsnemo_mgn_lung_motion'
static download_physicsnemo_mgn_lung_motion_data(dirname)[source]

Download the pretrained lung-motion PhysicsNeMo MGN checkpoint.

Fetches physicsnemo_mgn_lung_motion.zip from the MONAI Physio 2026.07.1 GitHub release and extracts it into dirname, giving the physicsnemo_mgn_lung_motion/mgn_stage_model.pt checkpoint Tutorial 10 and later lung tutorials read. Already-extracted data is left alone, so re-running is a no-op once it is present.

Parameters:

dirname (Union[str, Path]) – Directory where physicsnemo_mgn_lung_motion/ should live, typically tutorials/network_weights.

Return type:

Path

Returns:

Path to dirname/physicsnemo_mgn_lung_motion.

static verify_physicsnemo_mgn_lung_motion_data(dirname)[source]

Return True when the lung-motion PhysicsNeMo MGN checkpoint exists.

Return type:

bool

PHYSICSNEMO_MGN_DUKE_HEART_MOTION_URL = 'https://github.com/Project-MONAI/monai-physio/releases/download/2026.07.1/physicsnemo_mgn_duke_heart_motion.zip'
PHYSICSNEMO_MGN_DUKE_HEART_MOTION_DIRNAME = 'physicsnemo_mgn_duke_heart_motion'
static download_physicsnemo_mgn_duke_heart_motion_data(dirname)[source]

Download the pretrained Duke heart-motion PhysicsNeMo MGN checkpoint.

Fetches physicsnemo_mgn_duke_heart_motion.zip from the MONAI Physio 2026.07.1 GitHub release and extracts it into dirname, giving the physicsnemo_mgn_duke_heart_motion/ directory Tutorial 9 would otherwise train: the mgn_stage_model.pt checkpoint plus the heart PCA model (pca_model.json, pca_mean_surface.vtp) it was trained against. Already-extracted data is left alone, so re-running is a no-op once it is present.

Parameters:

dirname (Union[str, Path]) – Directory where physicsnemo_mgn_duke_heart_motion/ should live, typically tutorials/network_weights.

Return type:

Path

Returns:

Path to dirname/physicsnemo_mgn_duke_heart_motion.

static verify_physicsnemo_mgn_duke_heart_motion_data(dirname)[source]

Return True when the Duke heart-motion PhysicsNeMo MGN checkpoint exists.

Return type:

bool

PHYSICSNEMO_PHYSICS_INFORMED_MOTION_DUKE_HEART_URL = 'https://github.com/Project-MONAI/monai-physio/releases/download/2026.07.1/physicsnemo_physics_informed_motion_duke_heart.zip'
PHYSICSNEMO_PHYSICS_INFORMED_MOTION_DUKE_HEART_DIRNAME = 'physicsnemo_physics_informed_motion_duke_heart'
static download_physicsnemo_physics_informed_motion_duke_heart_data(dirname)[source]

Download the pretrained physics-informed Duke heart-motion checkpoint.

Fetches physicsnemo_physics_informed_motion_duke_heart.zip from the MONAI Physio 2026.07.1 GitHub release and extracts it into dirname, giving the directory Tutorial 17 would otherwise train: the physics_informed_motion_stage_model.pt checkpoint plus the volumetric PCA model (pca_model.json, pca_mean.vtu) it was trained against. Already-extracted data is left alone, so re-running is a no-op once it is present.

Parameters:

dirname (Union[str, Path]) – Directory where physicsnemo_physics_informed_motion_duke_heart/ should live, typically tutorials/network_weights.

Return type:

Path

Returns:

Path to dirname/physicsnemo_physics_informed_motion_duke_heart.

static verify_physicsnemo_physics_informed_motion_duke_heart_data(dirname)[source]

Return True when the physics-informed Duke heart checkpoint exists.

Return type:

bool

PHYSICSNEMO_PHYSICS_INFORMED_MOTION_DUKE_HEART_ABLATION_URL = 'https://github.com/Project-MONAI/monai-physio/releases/download/2026.07.1/physicsnemo_physics_informed_motion_duke_heart_ablation.zip'
PHYSICSNEMO_PHYSICS_INFORMED_MOTION_DUKE_HEART_ABLATION_DIRNAME = 'physicsnemo_physics_informed_motion_duke_heart_ablation'
static download_physicsnemo_physics_informed_motion_duke_heart_ablation_data(dirname)[source]

Download the lambda_physics = 0 ablation of that checkpoint.

Fetches physicsnemo_physics_informed_motion_duke_heart_ablation.zip from the MONAI Physio 2026.07.1 GitHub release and extracts it into dirname. It is the same network trained on the same volumetric data with the physics term switched off, the baseline Tutorial 17 trains so the physics term can be judged in isolation. Already-extracted data is left alone, so re-running is a no-op once it is present.

Parameters:

dirname (Union[str, Path]) – Directory where physicsnemo_physics_informed_motion_duke_heart_ablation/ should live, typically tutorials/network_weights.

Return type:

Path

Returns:

Path to dirname/physicsnemo_physics_informed_motion_duke_heart_ablation.

static verify_physicsnemo_physics_informed_motion_duke_heart_ablation_data(dirname)[source]

Return True when the physics-informed ablation checkpoint exists.

Return type:

bool

static verify_kcl_heart_model_data(dirname)[source]

Return True when KCL-Heart-Model has its expected mesh inputs.

Return type:

bool

Navigation

Test Tools | Utility Modules