Simpleware Heart Segmenter
SegmentHeartSimpleware runs Synopsys Simpleware Medical’s ASCardio module
as an external process and returns the resulting heart and major-vessel masks
as ITK images.
Class Reference
- class physiomotion4d.SegmentHeartSimpleware(log_level=20)[source]
Bases:
SegmentAnatomyBaseHeart CT segmentation using Simpleware Medical’s ASCardio module.
This class implements heart segmentation using Synopsys Simpleware Medical, a commercial medical image processing platform. It specifically leverages the ASCardio module for automated cardiac segmentation. The class handles the external process communication with Simpleware Medical and converts between ITK and Simpleware image formats.
Simpleware Medical provides high-quality segmentation for cardiac structures including chambers, myocardium, and major vessels. The segmentation is performed by launching Simpleware Medical as an external process and running a Python script within the Simpleware environment.
The class maintains specific ID mappings for: - Heart structures (left/right atrium, left/right ventricle, myocardium) - Major vessels (aorta, pulmonary artery)
The heart and major-vessel labels populated by this class are accessed through the inherited
SegmentAnatomyBase.taxonomy(taxonomy.labels_in_group("heart")etc.).Example
>>> segmenter = SegmentHeartSimpleware() >>> result = segmenter.segment(ct_image, contrast_enhanced_study=True) >>> labelmap = result['labelmap'] >>> heart_mask = result['heart']
- __init__(log_level=20)[source]
Initialize the Simpleware Medical based heart segmentation.
Sets up the Simpleware-specific anatomical structure ID mappings and processing parameters. The target spacing is set to 1.0mm which is optimal for cardiac segmentation in Simpleware Medical.
- set_trim_branches(trim_branches)[source]
Enable trimming of pulmonary and great-vessel branches.
When enabled,
trim_branches()is applied to the labelmap after Simpleware segmentation, clipping the pulmonary veins and major great vessels back to the cardiac region. Trimming reduces inter-subject variability in vessel extent, which simplifies AI-Ready and Sim-Ready model fitting. It is consistent with how vessels were trimmed in the example KCL Heart dataset.
- set_simpleware_executable_path(path)[source]
Set the path to the Simpleware Medical console executable.
Example
>>> segmenter.set_simpleware_executable_path( ... "C:/Program Files/Synopsys/Simpleware Medical/X-2025.06/ConsoleSimplewareMedical.exe" ... )
- segmentation_method(preprocessed_image)[source]
Run Simpleware Medical ASCardio segmentation on the preprocessed image.
This implementation calls Simpleware Medical as an external process, passing the preprocessed image via a temporary file. The Simpleware Python script (SimplewareScript_heart_segmentation.py) runs within the Simpleware environment and uses the ASCardio module for heart segmentation. The results are written as per-structure MHD mask files and assembled into a labelmap, then read back as an ITK image.
- Parameters:
preprocessed_image (itk.image) – The preprocessed CT image with isotropic spacing and appropriate intensity scaling
- Returns:
- The segmentation labelmap with heart and vessel labels
from the ASCardio module
- Return type:
itk.image
- Raises:
FileNotFoundError – If Simpleware Medical executable is not found
RuntimeError – If Simpleware Medical process fails
ValueError – If output segmentation is not produced
Note
Requires a valid installation of Synopsys Simpleware Medical with the ASCardio module. The method creates temporary files for input/output communication with Simpleware.
Example
>>> labelmap = segmenter.segmentation_method(preprocessed_ct)
- trim_branches(labelmap_image)[source]
Trim pulmonary and great-vessel branches back to the cardiac region.
Clips pulmonary veins and the great vessels (aorta, pulmonary artery) to the portions adjacent to the heart and keeps only the largest connected component of the left and right atria. Reduces inter-subject variability in vessel extent, simplifying AI-Ready and Sim-Ready model fitting. Consistent with how vessels were trimmed in the example KCL Heart dataset.
- Return type:
image
Basic Usage
import itk
from physiomotion4d import SegmentHeartSimpleware
image = itk.imread("chest_ct.nrrd")
segmenter = SegmentHeartSimpleware()
masks = segmenter.segment(image, contrast_enhanced_study=True)
heart = masks["heart"]
vessels = masks["major_vessels"]
Returned Keys
The ASCardio module segments cardiac anatomy only, so this segmenter’s
taxonomy registers a subset of the groups produced by
SegmentChestTotalSegmentator. The returned dictionary contains:
labelmapheartmajor_vesselssoft_tissue(base-class placeholder for label id 133)contrast(base-class placeholder for label id 135)other(all unclaimed label ids in [1, 256))
Keys such as lung and bone are not present. Callers that need
those groups must either use a different segmenter or check membership
("lung" in masks) and handle the absence explicitly. See
Segmentation Base Class for the full taxonomy contract.
Installation Note
SegmentHeartSimpleware requires a licensed installation of Synopsys
Simpleware Medical and its ASCardio module. The class invokes the Simpleware
executable as a subprocess; the executable and helper script paths must be
configured on the host system.