SeqSeg, From New Dataset to Training to Inference

A tutorial on setting up SeqSeg for medical image segmentation

1. Data Preparation and Structure

The first step in using SeqSeg is to preprocess your data.

We require the following data:

A few things to note:

2. Data Preprocessing (for Training)

The next step is to preprocess the data for training. SeqSeg requires a model trained on local patches, so we need to extract patches from the images and masks based on centerlines.

The repository for this is BloodVesselML3D and the script is gather_sampling_data_parallel.py. This requires the following arguments:

Next, we must change the naming structure to match nnU-Net. This is done with the dataset_dirs/create_nnunet.py script. The new data can be output anywhere, but we recommend directly into the nnU-Net Raw directory.

3. Training

The next step is to train the model. This is done with the specific nnU-Net commands, which are detailed in the nnU-Net repository.

This requires two commands (see documentation for more details):

You can train:

4. Inference

The final step is to run SeqSeg inference on new data. This is done with the SeqSeg/seqseg.py script. You need direct access to the directory containing the images and seed points, and another containing the trained model weights.

Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Making a Vascular Model Repository — Design Decisions, Metadata, and Workflows
  • SeqSeg, Now a Pip Installable Package