A PyTorch based package for data synthesis and machine learning of vessel extraction in volumetric OCT images (mus).
Project description
oct_vesselseg
This repository contains an implementation of computational geometry and domain randomization for synthesizing vascular structures and Optical Coherence Tomography (OCT) data. The project is inspired by the concepts and methodologies described in the SynthSeg project, adapted to the domain of vascular imaging.
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.
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:
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
- SynthSeg, SynthSpline, and Cornucopia, for the inspiration and methodological foundation.
- Much of the computation resources required for this research was performed on computational hardware generously provided by the Massachusetts Life Sciences Center.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file oct_vesselseg-0.0.2.tar.gz
.
File metadata
- Download URL: oct_vesselseg-0.0.2.tar.gz
- Upload date:
- Size: 37.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db1f974a59789f287a37aca0b9cc2f30a8481205ce017eac0ad27ccca1e81128 |
|
MD5 | 404cf36c6b0c4ddd332e278ab0a4e6df |
|
BLAKE2b-256 | 857ed5f910ea1fbb3c967115a1e339f1381b6d98ac5248af5aa0b7ad0b446c75 |
File details
Details for the file oct_vesselseg-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: oct_vesselseg-0.0.2-py3-none-any.whl
- Upload date:
- Size: 40.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e337eb54df95dc7769c25ee734f52a0f72b10e9423c4b2e706fcf86d7414fe6 |
|
MD5 | db60aee9a1d3234c1eeabbf84078799c |
|
BLAKE2b-256 | 12f2a6301eb6203d40085becc4de07156ca0f663048008ca981a7833fe89889b |