Quickstart

Warning

This project is under development

Installation

Software installation

Download Medical Liver Segmentation ToolKit

(.venv) $ git clone https://github.com/Removirt/LiverSegmentation.git
(.venv) $ cd MedicalLiverSegmentationToolkit/
(.venv) $ pip install -r requirements.txt

Usage

Important

To introduce new network architectures, follow these steps:

  1. Enter the architecture in model/dim3/{your_architecture}.py.

  2. Add the network import in model/utils.py.

  3. Add the network training configuration in config/{database}/{your_architecture}_3d.yaml.

Training Network

(.venv) $ python3 train.py --model {network_name} --max_epochs {num_max_epochs}

Note

See the Train Module documentation for more info on parameters.

Tip

To train more than 1 network, use train_sequential.py, more info.

Test Network

(.venv) $ python3 train.py --model {network_name} --version {training_version}

Predict Network

(.venv) $ python3 train.py --model {network_name} --version {training_version}

Tip

To predict more than 1 network, use predict_sequential.py, more info.

Evaluation trained models

Performance measures

Note

The performance measures compute are:

  1. Dice Similarity Coefficient (DSC).

  2. Normalize Surface Distance (NSD).

  3. Mean Average Surface Distance (MASD).

  4. Hausdorff Distance (HD).

  5. Relative Volume Difference (RVD).

(.venv) $ python3 metrics_sequential.py 

Note

Generate a JSON file with networks put in (more info):

20models_3d = [
21        'attention_unet',
22        'medformer', 
23        'resunet', 
24        'swin_unetr', 
25        'unet++', 
26        'unetr', 
27        'vnet', 
28        'segformer',
29        '{name_architecture}',
30    ]

Complexity measures

(.venv) $ python3 calculate_features_networks.py 

Note

The profiler calculate:

  1. Number of params.

  2. Floating point operations per second (Flops).

  3. Memory usage in a inference.

  4. Layers size.

more info.