Code Monkey home page Code Monkey logo

salmon---3d-medical-images-segmentation's Introduction

Salmon-logo-1

SALMON: Segmentation deep learning ALgorithm based on MONai toolbox

SALMON is a computational toolbox for segmentation using neural networks (3D patches-based segmentation) SALMON is based on MONAI: a PyTorch-based, open-source framework for deep learning in healthcare imaging. (https://github.com/Project-MONAI/MONAI)


Requirements

See requirements.txt list. We use "nvcr.io/nvidia/pytorch:19.03-py3" docker and we install all the requirements with: "pip install -r requirements.txt"


Python scripts and their function

  • organize_folder_structure.py: Organize the data in the folder structure for the network

  • init.py: List of options used to train the network.

  • check_loader_patches: Shows example of patches fed to the network during the training

  • networks.py: The architectures available for segmentation.

  • train.py: Runs the training

  • predict_single_image.py: It launches the inference on a single input image chosen by the user.


Usage

Folders structure:

Use first "organize_folder_structure.py" to create organize the data in the following folder structure:

.
├── Data_folder                   
|   ├── images              
|   |   ├── train             
|   |   |   ├── image1.nii              
|   |   |   └── image2.nii                     
|   |   └── val             
|   |   |   ├── image3.nii             
|   |   |   └── image4.nii
|   |   └── test             
|   |   |   ├── image5.nii              
|   |   |   └── image6.nii
|   ├── labels              
|   |   ├── train             
|   |   |   ├── label1.nii              
|   |   |   └── label2.nii                     
|   |   └── val             
|   |   |   ├── label3.nii             
|   |   |   └── label4.nii
|   |   └── test             
|   |   |   ├── label5.nii              
|   |   |   └── label6.nii

Training:

Modify the "init.py" to set the parameters and start the training/testing on the data. Afterwards launch the train.py for training. Tensorboard is available to monitor the training:

trainingtraining2training3training2´4

Sample images: on the left side the image, in the middle the result of the segmentation and on the right side the true label The following images show the segmentation of carotid artery from MR sequence

Imageresultlabel


Inference:

Launch "predict_single_image.py" to test the network. Modify the parameters in the parse section to select the path of the weights, images to infer and result.


Tips:

Use and modify "check_loader_patches.py" to check the patches fed during training. Use and modify "networks.py" to modify the network and check the number of parameters.

Sample script inference

python predict_single_image.py --image './Data_folder/images/train/image13.nii' --label './Data_folder/labels/train/label13.nii' --result './Data_folder/results/train/prova.nii' --weights './best_metric_model.pth'

Future Development: TO DO list

  • Add more networks structures in networks.py
  • Implement it for multilabel segmentation in the same script. (call multilabel losses)

salmon---3d-medical-images-segmentation's People

Contributors

davidiommi avatar

Watchers

 avatar

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.