Skip to content

Latest commit

 

History

History
108 lines (74 loc) · 5.28 KB

README.md

File metadata and controls

108 lines (74 loc) · 5.28 KB

pet-ct-annotate

Set-up

Python environment

Create miniconda/Anaconda environment using the following command:

conda env create -f environment.yml

For venv the requirements.txt file can be used:

pip install -r requirements.txt

Note: The package GeodisTK requires Microsoft C++ Build Tools on Windows devices. It can be downloaded here. Note: Usage of Anaconda or Miniconda is recommended since the package cudatoolkit is necessary for GPU execution.

Git

This project uses a submodule. Either clone using

git clone --recursive <link>

or initialize the submodules after cloning:

git submodule update --init --recursive

On Windows machines, set git to automatically convert line endings:

git config --global core.autocrlf true

MONAILabel Server

Use the file start_server.sh:

conda activate petct
cd ./pet-ct-annotate/
pip install ./MONAILabelMultimodality/
start_server.sh <path/to/autopet> <path/to/label/folder>

The script supports the following command line arguments:

Shell script to start a multimodal MONAILabel server.
start_server.sh [-h] [-p PORT] [-d CUDA_DEVICE] [-m MONAI_PATH] [-l PROJECT_PATH] DATA_LOCATION LABEL_LOCATION


ARGUMENTS:

         DATA_LOCATION           Path to the autopet dataset.
         LABEL_LOCATION          Path to the location where the labels will be saved.

OPTIONS:

         -h                      Display this help menu.
         -p PORT                 Port on which the server starts, defaults to 8000.
         -d CUDA_DEVICE          CUDA device number on which the inference is performed, defaults to 5. The devices can be checked with the nvidia-smi command.
         -m MONAI_PATH           Path to the MONAILabel executable, defaults to "./MONAILabelMultimodality/monailabel/scripts/monailabel".
         -l PROJECT_PATH         Path to the pet-ct-annotate source folder, defaults to "./src".

Model

The model used in this project is a multimodal early fusion version of DeepIGeoS (see Resources). It consists of a proposal (P-Net) and a refinement network (R-Net). The model weights are located in src/models. The model was trained using the autopet dataset (see Resources) using only the samples labeled as non-small-cell lung carcinoma.

3DSlicer

The fork of MONAILabel, is based on commit ad2e081a and contains three different versions of the 3D Slicer plugin:

  • MONAILabel: The original plugin
  • MONAILabelMultimodality: A plugin that supports the MultimodalDatastore and is capable of showing both modalities at the same time
  • MONAILabelSingleView: A plugin that supports the MultimodalDatastore and is capable of showing one modality at a time. Modalities can be swapped by pressing the button in the UI.

Follow the instructions in MONAILabel Slicer Plugin to install the Slicer Plugin in Developer Mode.

Connect to the MONAILabel Server in the Slicer MONAILabel Module.

Linting

The code can be formatted using the following commands:

black src
black tests

Developers

Resources