This repository contains code to generate the data used to train the SimVascular Machine Learning 2D segmentation neural networks.
The code processes data from the Vascular Model Repository (VMR) into files that are easy to read using Python. In particular, for each case in the VMR, and for each vessel pathline for that case, the code loops over all path points where a user has segmented the vessel lumen and extracts a cross-sectional reslice image of the vessel at that location, along with the segmented lumen contour points. The code also extracts cross-sectional reslice images from the ground-truth cardiovascular model (represented as an image volume with binary pixel values).
This code relies on the VMR being stored in a particular folder structure.
The original data used can be found in /home/SHARED/vascular_data
on the Marsden Lab Skalak file server.
All cases should be stored in separate folders under one main folder.
The main folder should have the path indicated by CASES_PREFIX
in the config file /config/case.yaml
in this repository.
The locations of the image volume files, ground-truth binary image volume files, path files and group folders should then be indicated in .txt
files.
An example of this can be found in /cases
in this repository.
Once these files have been set up, the data can be generated by running
python generate_cases.py
python process_data.py
Finally note that a copy of the processed data is stored at /home/SHARED/ML
on the Marsden Lab Skalak filer server.