Skip to main content

A Label-Free and Data-Free Synthesis Engine and Training Framework for Vascular Segmentation of sOCT Data with PyTorch.

Project description

oct_vesselseg

Characterized by minimal priors and high variance sampling, this project builds on the emerging field of synthesis-based training by proposing an entirely data-free synthesis engine for training a Unet in the task of vascular labeling in sOCT data (mus modality). This project employs domain-randomized synthesis to create structured vessel and neural parenchyma labels, textures, and artifacts. It creates volumetric imaging data similar to, but not emulative of 3D sOCT data, with corresponding (perfect) ground truth labels for vasculature. The package contains a training module employing an on-the-fly image synthesis procedure to create a virtually infinite number of unique volumetric training data.

Table of Contents

Introduction

This project focuses on generating synthetic datasets for training a 3D U-Net for the task of vasculature segmentation in OCT data. Using a cubic spline synthesis pipeline first established in SynthSpline, and many data augmentation techniques from Cornucopia this project employs domain-randomized synthesis to create structured labels, textures, and artifacts, enhancing the training of neural networks for vascular segmentation.

Pipeline

Getting Started

Hard requirements include Cppyy~=2.3 and Python~=3.9

Installation

Create and activate a new mamba environment with python 3.9

mamba create -n oct_tissuemasking python=3.9
mamba activate oct_tissuemasking

Install synthspline for vasculature synthesis

pip install git+https://github.com/balbasty/synthspline.git#f78ba23

We need to identify and set our cuda version to make sure we install the right prebuilt wheel for cupy. You can find your cuda version by running the command nvcc --version.

export CUDA_VERSION=<cuda-version>

Finally, we can install oct_tissuemasking (this might take a while so let's set the default timeout to 20,000 seconds).

pip install oct_tissuemasking --default-timeout=20000

Configuration

Identify the directory you want all oct_vesselseg related files to go into (you might need to make a new directory), and run the following command. This will add a line to your ~/.bashrc file to set a global environment variable OCT_VESSELSEG_BASE_DIR. I recommend this to be an empty directory (or if you specify a non-existent directory, one will be made for you).

oct_vesselsynth configure

Usage

Vessel Synthesis

Synthesize the vascular labels for training. You can get help for this command with the --help flag. The labels will go into the OCT_VESSELSEG_BASE_DIR directory in the subdirectory called synthetic_data.

oct_vesselseg vesselsynth

OCT Image Synthesis

Synthesize some examples of synthetic OCT images.

oct_vesselseg imagesynth

Training

Train the model on the vessel labels and on-the-fly OCT image synthesis. The models will go into a subdirectory of OCT_VESSELSEG_BASE_DIR called models.

oct_vesselseg train

Inference

Run inference on a compatable NIfTI file. Th

oct_vesselseg test --in-path <path-to-NIfTI>

Results

Here we provide some examples of synthetic vasculature generated by this method:

Results

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oct_vesselseg-0.0.3.tar.gz (38.3 kB view hashes)

Uploaded Source

Built Distribution

oct_vesselseg-0.0.3-py3-none-any.whl (40.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page