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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file oct_vesselseg-0.0.3.tar.gz.

File metadata

  • Download URL: oct_vesselseg-0.0.3.tar.gz
  • Upload date:
  • Size: 38.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.19 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for oct_vesselseg-0.0.3.tar.gz
Algorithm Hash digest
SHA256 66d782d7c10349ef05e31972cd2ff0c614067dc3c1707e885578d1e17f9b8238
MD5 fffbdaf5dc5d3f7dcdd81219824e60c6
BLAKE2b-256 28bf4e128e5770a97250f1a318acae944551bc2a666ea4c6676794a83de941ae

See more details on using hashes here.

File details

Details for the file oct_vesselseg-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: oct_vesselseg-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 40.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.19 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for oct_vesselseg-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 aae4f643b1971e582a2a7d116d4a40ac0e16d2e5238eec1a5d28c55463c3fc44
MD5 87af7b085b309182814e073a4192374e
BLAKE2b-256 850f10e95c7230a435de287c876000333063578c738032ee0c9178b0a25cf022

See more details on using hashes here.

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