Integrating Medical Imaging Into CFD Workflows

Computational fluid dynamics (CFD) has long been used for medical research, and with recent FDA standards and approvals it has moved to the forefront of medical applications for device design and patient treatment. Applications include surgical and treatment planning, medical device design, and drug delivery optimization. By using CFD to simulate hemodynamics, respiratory flow, or fluid-solid interactions in the body, researchers in academics and industry are building pipelines and products that turn medical imaging data into CFD-ready models to return clinically meaningful insights.

In many cases, the computational domain is derived from patient-specific anatomy. It starts with a medical image: MRI, CT, OCT, IVUS, etc. This provides a 3D volume from which a specific anatomy must be segmented. The segmentation, also known as a label map, is essentially a subset of voxels that are considered part of the anatomy. It is a volumetric mask that represents the object to be modeled (a heart, a vessel, an airway, etc.).

Chest CT with segmented airway
Surface representation of segmentation

Before generating a 3D volume mesh for CFD, the segmentation undergoes preprocessing for refinement including ensuring a watertight mesh can be generated for simulation and face/surface labeling. The algorithms for doing this are often anatomy dependent, and the identification of faces for boundary conditions often relies on custom scripts. When dealing with many medical images, both manual segmentation and custom scripting can quickly become expensive and time consuming.

Besides research and product development, streamlining the medical-image-to-CFD pipeline can also support the regulatory application process. In 2023, the FDA issued guidance for medical device submissions that have a computational modeling and simulation component, based on the American Society of Mechanical Engineers (ASME) V&V 40. This guidance applies to medical devices that use CFD, providing a risk-informed framework for defining and assessing model credibility through verification, validation, and uncertainty quantification (VVUQ). Uncertainty quantification (UQ) looks to define the uncertainties inherent to the computational model by varying input and solution parameters. To understand the latter, sensitivity analyses are needed from medical image acquisition and segmentation to meshing and boundary condition application to numerical solving and outcomes that can influence decisions related to the clinical question of interest. A streamlined pipeline enables these sensitivity analyses to be performed systematically and at scale.

Fortunately, there are open source tools and powerful machine learning techniques that can help accelerate this process. In this article, we will highlight some of these tools and methods – all resources that you can start using today. Additionally, by working with Kitware you can further leverage our expertise in putting together customized segmentation pipelines to reduce costs and accelerate your development.

Tools and automation

There are many open source tools for processing medical images for CFD input, but there are rarely clear all-in-one solutions. Instead, practitioners typically assemble a workflow by combining tools that each excel at different stages.

3D Slicer is an open-source platform for medical image analysis. It is powerful, flexible, and highly customizable. Slicer provides extensive tools for medical image segmentation as well as a rich ecosystem for processing and cleaning segmentations. A common workflow is to use Slicer for segmentation and surface mesh generation, and then move to other tools for volumetric mesh generation, boundary condition specification, assignment of fluid properties, and other simulation setup. There are also options to generate volumetric meshes within Slicer itself, such as using the SegmentMesher extension or the Vascular Modeling Toolkit (VMTK).

Segment Editor module in 3D Slicer

3D Slicer is built on ITK, an open source library for medical image analysis. ITK is a tried and true low level library that can be integrated into software to provide many of the classical algorithms for segmentation, registration, and filtering.

SimVascular is an open source software package that provides an end-to-end pipeline for cardiovascular CFD modeling. It is specialized for cardiovascular applications and less general-purpose than 3D Slicer, but it is an exception to the “no all-in-one solutions” comment above. SimVascular provides within a single environment tools for segmentation, model construction, and finite element solvers for cardiac modeling and vascular hemodynamics.

After isolating the anatomy of interest and processing it into a CFD-ready mesh, one needs to specify boundary and initial conditions. These typically come from a combination of measurements and assumptions about the behavior downstream of the region of interest. Pulse can be used to create a closed-loop system by using a multi-physics, multi-scale approach to modeling the human body. The Pulse Physiology Engine is a computational physiology simulation that is composed of numerical models representing the different body systems, feedback mechanisms and interactions between the systems, pharmacokinetics/pharmacodynamics, and medical equipment. Major systems are modeled as zero-dimensional lumped-parameter circuit analogs. This means that there is no spatial component; instead, systems are analogous to electrical circuits with resistors, capacitors, pressure sources, and valves, together giving rise to a system of differential equations. Using Pulse to provide outlet boundary conditions allows CFD models to include dynamic downstream impacts in the boundary conditions.

Pulse is a whole-body physiology simulation that can be used to inform boundary conditions and generate virtual populations.

With a CFD-ready mesh in hand and model parameters in mind, there is the problem of actually getting the simulation specification into a solver. The Simulation Modeling Tool Kit (SMTK) is a framework for doing exactly that: it provides a common simulation specification language from which it can create input files for various solvers. It is actually a more general simulation workflow tool and it can incorporate more of the earlier steps such as meshing. While SMTK is a low level library, Computational Model Builder (CMB) builds on ParaView and SMTK to form a simulation workflow management suite. With an extensible plugin system, CMB and SMTK can support a variety of workflow components whether they are libraries or command line tools, and whether they are open or closed source.

Deep learning

MONAI is a PyTorch-based AI framework with a rich ecosystem of medical-specific transforms and established architectures. We use and highly recommend MONAI for training medical image segmentation models.

Modern convolutional neural network and transformer-based segmenters with basic U-Net structures routinely outperform classical pipelines on the distributions they are trained for. It often seems that automatic medical image segmentation has been “solved” by machine learning, but the story is a bit more complicated. While state-of-the-art models perform well on curated datasets, challenges remain when translating these solutions into practice:

  • Metrics. The most clinically relevant signals can be small, and evaluation metrics are not always aligned with clinical needs or CFD accuracy. Networks trained to optimize Dice coefficients do not capture whether a segmentation preserves clinically relevant features, such as narrowings or bifurcations, that strongly affect CFD results.
  • Domain shift. Deep learning models perform well on the imaging protocol they were trained on, but performance can suddenly degrade once the scanner settings or acquisition parameters differ.
  • Interpretability. When classical methods fail, one can often explain why. There are ways to add interpretability to AI models, but it is not as transparent and it does not come for free.
  • Data requirements. Deep learning models require large volumes of annotated data, which can become prohibitively expensive when dealing with 3D images and clinician annotations.
  • Outlier handling. Medicine often centers on pathological cases, so failures of automation need to be handled regardless of whether the algorithm is hand-crafted or trained from datasets. CFD pipelines that use AI generally need to allow for human interaction to correct outliers.

All that being said, carefully designed and properly used AI can surpass classical methods and create robust solutions at lower cost. Metrics can be purpose-built, domain shift can be anticipated, and manual data annotation requirements can be reduced:

  • Segmentation training objectives can be designed to capture what matters for CFD, by using appropriate metrics (such as surface Dice or Hausdorff distance) or constructing new ones.
  • With smart data augmentation, domain shift can be anticipated and data needs can be reduced.
  • Starting with a foundation model and fine-tuning it to a specific problem domain can also reduce data needs. For many organs and anatomical structures, there are many off-the-shelf models that can do the initial bulk of the work of creating ground truth segmentations.
Total Segmentator applied to a chest CT in 3D Slicer

Kitware can help

Kitware can provide end-to-end support for CFD companies who are expanding into the medical domain. Our open source platforms (3D Slicer, ITK, Pulse, ParaView, CMB) are flexible and customizable for the pre-processing needs and workflow management of CFD problems. Our expertise includes integration of simulation models into software, custom AI models for automated segmentation, custom algorithm development for cleaning up segmentation topology and geometry, and visualizing CFD output.

Contact our team to explore how we can help you achieve your goals.

Leave a Reply