Aortic diseases like aneuryms and aortic disections can both lead to the dilation of arterial vessels. These diseases increase the risk of developing cardiovascular complications such as hemmorage (internal bleeding), stroke, and heart attacks to populations like smokers and the elderly. Radiologists and surgeons need to survey the condition of organs such as the heart and its vessels to evaluate health risks and develop strategies for treating patients. Here we give a simple experimental procedure for segmenting the aorta on python for diameter measurements as well as a qualitative
This script is designed for automatically processing and segmenting chest computed tomography (CT) data from the MM-WHS-2017 (https://zmiclab.github.io/zxh/0/mmwhs/data.html) dataset, but we encourage trying other CT/CT-A datasets, specifically tailored for segmenting the ascending and descending aorta. We combine quantile histogram thresholding with a recursive nearest centroid neighbor search (RNCNS) approach to track and create 3D masks of the ascending and descending aortas.
Our functions, testing script, and data analysis script are provided as is. No additional time was allocated to making it particularly easier on the end-reader other than what was necessary for our own understandinf of our implementation. This was due to time-constraints.
(3D-mesh generation via ImageJ)nibabel
matplotlib
numpy
scikit-image
scipy
SimpleITK
pycad
pandas
fastASF
fast Aortic Segmentation Framework package (our custom functions available in the git)
The script also requires access to specific medical image files in NRRD (not currently supported) and NIfTI formats. Make sure these files are correctly placed in your project directory.
-
Modify File Paths: Replace the
input_path
andoutput_dir
variables with the correct path to your NIfTI files. The script currently uses the following placeholders:- NIfTI file:
"Project/Rider/R1 (AD)/R1.nii.gz"
- NIfTI file:
-
Ground Truths: Save and copy the path of the ground truth data. These are available for download in the git. These ground truths were generated by uploading the training data to TotalSegmentator online and using the "aorta" quick-segmentation option.
-
**The script utilizes several functions from the
fastASF
package for image processing:ImageProcessor
scoreDice
separate_anatomy
diameter_stack
remove_close_maxima
Make sure the
fastASF
package is correctly installed and imported. -
Running the Script:
- Processes images using
ImageProcessor
. - Calculates and compares Dice scores.
- Saves processed images and results in specified directories.
- Processes images using
-
Outputs:
- Processed images in NIfTI format.
- CSV file containing scores and diameters.
- Performance graphs as PNG files.
-
Customization: Feel free to adjust the thresholds, slice numbers, and other parameters as per your dataset requirements. We achieved much better results when overfitting our data according to individual quantile thresholding variances—which we now recognize could have been used as a feature to optimize using GridSearch CV.
The script’s performance and accuracy are dependent on the quality of the input images and the precision of the ground truths provided. Please ensure that the data is pre-processed as needed for optimal results.
This is an example of the performance output as a PNG for the first image in the dataset.
KAMOLE KHOMSI, Lloyd E. HERNANDEZ-FAJARDO, Christian A.