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, and Chest-CT 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 physiotwin4d.data_download_tools.DataDownloadTools[source]
Bases:
objectDownload and verify optional PhysioTwin4D example datasets.
- SLICER_HEART_CT_URL = 'https://github.com/Project-MONAI/physiotwin4d/releases/download/2026.07.1/TruncalValve_4DCT.seq.nrrd'
- SLICER_HEART_CT_FILENAME = 'TruncalValve_4DCT.seq.nrrd'
- SLICER_HEART_CT_SLICE_BASENAME = 'slice'
- static DownloadSlicerHeartCTData(dirname)[source]
Download the Slicer-Heart-CT 4-D CT sample into
dirname.Also splits the downloaded 4-D sequence into per-frame
slice_???.mhavolumes in the same directory (viaConvertImage4DTo3D), skipping the split if those files already exist.
- static VerifySlicerHeartCTData(dirname)[source]
Return True when Slicer-Heart-CT has the expected 4-D CT file.
- Return type:
- 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 DownloadKCLHeartModelData(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.vtkthrough20.vtk, and the average heart mesh from https://zenodo.org/records/4593739 intodirname/average_mesh.vtk. Already-extracted files are reused.
- CHOP_VALVE4D_RELEASE_URL = 'https://github.com/Project-MONAI/physiotwin4d/releases/download/2026.07.1/'
- CHOP_VALVE4D_ASSETS = {'Alterra': 'CHOP-Valve4D-Alterra.zip', 'CT': 'CHOP-Valve4D-CT.zip', 'TPV25': 'CHOP-Valve4D-TPV25.zip'}
- static DownloadCHOPValve4DData(dirname)[source]
Download the CHOP-Valve4D convenience release into
dirname.Downloads the three zip archives attached to the PhysioTwin4D 2026.07.1 GitHub release (https://github.com/Project-MONAI/physiotwin4d/releases/tag/2026.07.1) and extracts each into its matching subdirectory:
Alterra/andTPV25/(valve mesh time series, >1 GB each) andCT/(source CT volume and Simpleware segmentation). A subdirectory that already has its expected files (see_CHOPValve4DSubdirIsPopulated) is left alone, so re-running resumes an interrupted download without re-fetching a subdirectory a partial extraction left behind. Seedata/CHOP-Valve4D/README.mdfor what this converted data contains and how it relates to the original FEBio source model.
- static VerifyCHOPValve4DData(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:
- CHEST_CT_URL = 'https://github.com/Project-MONAI/physiotwin4d/releases/download/2026.07.1/Chest-CT.mha'
- CHEST_CT_FILENAME = 'Chest-CT.mha'
- static DownloadChestCTData(dirname)[source]
Download the Chest-CT sample volume into
dirname.Fetches
Chest-CT.mha— an ungated 3-D chest CT — from the PhysioTwin4D 2026.07.1 GitHub release. An existing non-empty file is reused, so re-running resumes an interrupted download. Seedata/Chest-CT/README.mdfor the data source and required citation.
- static VerifyChestCTData(dirname)[source]
Return True when Chest-CT has its expected CT volume.
- Return type:
- static VerifyDirLab4DCTData(dirname)[source]
Return True when a supported DirLab-4DCT case layout exists.
- Return type:
- DIRLAB_4DCT_HU_OFFSET = 1024
- DIRLAB_4DCT_HU_CLIP_RANGE = (-1024, 1024)
- static FixDirLab4DCTData(dirname, output_dirname=None)[source]
Convert DirLab-4DCT raw intensities to clipped Hounsfield units.
DirLab-4DCT’s raw
.img/.mhdvolumes store intensities offset by +1024 from Hounsfield units. This finds every.mhdheader underdirname(recursively) whose raw data has been downloaded, subtracts 1024, clips the result toDIRLAB_4DCT_HU_CLIP_RANGE, and writes the corrected volume with the same base filename but a.mhaextension, compressed.- Parameters:
- Return type:
- Returns:
Paths to the written
.mhafiles.
Navigation