Code Monkey home page Code Monkey logo

medical-detection3d-toolkit's Introduction

Medical-Detection3d-Toolkit

PyTorch implementation of the volumetric landmark detection engine proposed in the paper SkullEngine: A Multi-stage CNN Framework for Collaborative CBCT Image Segmentation and Landmark Detection, MICCAI workshop 2021.

drawing

Installation

The code is tested with python=3.8.8, torch=2.0.0, and torchvision=0.15.0 on an A6000 GPU.

git clone https://github.com/qinliuliuqin/Medical-Detection3d-Toolkit
cd Medical-Detection3d-Toolkit

Create a new conda environment and install required packages accordingly.

conda create -n det3d python=3.8.8
conda activate det3d
pip3 install -r requirements.txt

Data

First, the users need to prepare medical images and their corresponding landmark annotations. The assets folder contains an example image (case_001.nii.gz) and landmark annotation file (case_001.csv). Note that this example data is not the private data we used in SkullEngine. Then, generate landmark masks (e.g, case_001_landmark_mask.nii.gz) given the pairs as demonstrated in this notebook. The meaning of labels in the landmark mask:

Label Meaning
positive integer these are positive samples of landmarks (e.g., voxels with value 1 represent the first landmark.)
0 these are negative samples (i.e, background voxels)
-1 these are boundary voxels (i.e., between the positive and negative ones) that are not involved in training.

Finally, prepare dataset splitting files for training (train.csv) and testing (test.csv).

Visualization

To check if the landmark masks are correctly generated, we recommend using ITK-SNAP to visualize image overlayed with the corresponding landmark mask, as shown below.

drawing

Training

Run the following code for training with a single GPU. The user may need to modify training settings in ./config/lmk_train_config.py. By default, the model will be saved in ./saves/weights.

cd detection3d
python lmk_det_train.py --input ./config/lmk_train_config.py --gpus 0

Evaluation

Run the following code to evaluate a trained model on a single GPU.

python lmk_det_infer.py -i ../assets/case_001.nii.gz -m ./saves/weights -o ./saves/results

Citation

@article{liu2021skullengine,
  title={SkullEngine: A Multi-stage CNN Framework for Collaborative CBCT Image Segmentation and Landmark Detection},
  author={Liu, Qin and Deng, Han and Lian, Chunfeng and Chen, Xiaoyang and Xiao, Deqiang and Ma, Lei and Chen, Xu and Kuang, Tianshu and Gateno, Jaime and Yap, Pew-Thian and others},
  journal={arXiv preprint arXiv:2110.03828},
  year={2021}
}

medical-detection3d-toolkit's People

Contributors

qinliuliuqin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

medical-detection3d-toolkit's Issues

Doubts in the training code

Hi Qin
Thanks for publishing your code. However there are few things I do not understand . Please reply back when you have time.

  1. I noticed that you only save the model for every 1000th epoch and also I noticed that you did not evaluate the model in validation set.
    is there any specific reason for that ?
  2. The Skull engine paper has no more landmarks, but you only provided like 8 landmarks in the data prep note book and the code is harcoded for 8 classes , is that right ?

Preprocessing

Hi, i was wondering if preprocessing of the data is included in this model or if you need to preprocess the ct data yourself?
Like resampling, reshape, alignment and normalization?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.