Git Product home page Git Product logo

fly-by-cnn's Introduction

Fly by CNN

Contributors: Juan Prieto, Maxime Dumont, Louis Bumbolo, Mathieu Leclerq, Baptiste Baquero

What is it?

Fly by CNN is an approach to capture 2D views from 3D objects and use the generated images to train deep learning algorithms or make inference once you have a trained model.

How it works?

It scales the mesh to the unit sphere, then, depending on the type of sampling chosen, it captures views from these view points. There are currently 2 types of sampling, i.e., icosahedron subdivision or following the path of a spiral.

  • Icosahedron subdivision: regular subdivision of the sphere.
  • Spiral: Smooth path in the sphere that generates a sequence of images.

Icosahedron subidivision

Sphere_and_plane

Spherical spiral subivision

Spherical_spiral

Running the code

The easiest way is to use the docker container.

docker pull dcbia/fly-by-cnn:latest
docker run --gpus all -t -i -u $(id -u):$(id -g) --name fly_by_cnn dcbia/fly-by-cnn:latest /bin/bash

Once inside the container you can run to get all the available options.

python /app/fly-by-cnn/src/py/fly_by_features.py --help
  • Example: This example will extract the normals and the depth map as a separate component and generate a single 3D image with all the views.
python /app/fly-by-cnn/src/py/fly_by_features.py --surf my_surf.(vtk,.stl,.obj) --subdivision 2 --resolution 512 --out out.nrrd --radius 2 --use_z 1 --split_z 1"

Running Universal Labeling, Merging and Separating algorithm

The easiest way to use the docker container. Docker/README.md

Here are the command lines to run the scripts:

Universal Labeling:

Input:

  • Dental crown model that contains the teeth of a patient (vtk file)

Output:

  • Dental crown model with the universal labels on each tooth (vtk file)
python3 fly-by-cnn/src/py/universal_labeling.py --help
usage: universal_labeling.py [-h] --surf SURF --label_groundtruth
                             LABEL_GROUNDTRUTH --model_feature MODEL_FEATURE
                             --model_LU MODEL_LU --out_feature OUT_FEATURE
                             [--out OUT]

Label the teeth from 2 to 16 or with the universal IDs used by clinicians

optional arguments:
  -h, --help            show this help message and exit
  --surf SURF           Input surface mesh to label (default: None)
  --out OUT             Output model with labels (default: out.vtk)

Label parameters:
  --label_groundtruth LABEL_GROUNDTRUTH
                        directory of the template labels (default: None)

Prediction parameters:
  --model_feature MODEL_FEATURE
                        path of the VGG19 model (default: None)
  --model_LU MODEL_LU   path of the LowerUpper model (default: None)
  --out_feature OUT_FEATURE
                        out of the feature (default: None)

Merging and Separating:

Inputs:

  • Dental crown model that contains the teeth of a patient with the universal labels on each tooth (vtk file)
  • The root canal segmentation file (.nii)

Output:

  • A merged model with the teeth and roots labeled based on the universal labels and individual teeth and roots (vtk files)
bash fly-by-cnn/src/sh/compute_MergingSeparating.sh --help
Program to run the Merging and Separating algorithm

Syntax: compute_MergingSeparating.sh [--options]
options:
--src_code                    Path of the source code 
--input_file_uid              Output directory of the teeth with the universal labels.
--input_file_root             Input directory with the root canal segmentation files.
--out_tmp                     Temporary output folder.
--out_merge                   Output directory of the merged surfaces.
--out_separate                Output directory of the separated surfaces.

ULMS algortihm:

Inputs:

  • Dental crown model that contains the teeth of a patient (vtk file)
  • The root canal segmentation file (.nii)

Output:

  • A merged model with the teeth and roots labeled based on the universal labels and individual teeth and roots (vtk files)
bash fly-by-cnn/src/sh/compute_ULMS.sh --help
Program to run the Universal Labeling Merging and Separated algorithm

Syntax: compute_ULMS.sh [--options]
options:
--src_code                    Path of the source code 
--input_file_surf             Input file surface with only the teeth.
--label_GT_dir                Folder containing the template for the Upper/Lower classification.
--model_ft                    Path to the feature model .
--model_LU                    Path to the LowerUpper classification model.
--out_feature                 Output of the feature.
--output_dir_uid              Output directory of the teeth with the universal labels.
--input_file_root             Root canal segmentation file.
--out_tmp                     Temporary output folder.
--out_merge                   Output directory of the merged surfaces.
--out_separate                Output directory of the separated surfaces.

fly-by-cnn's People

Contributors

baptistebaquero avatar hina-shah avatar juanprietob avatar lbumbolo avatar luciedle avatar mathieuleclercq avatar maximedum avatar msakarvadia avatar romaindeleat-besson avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

fly-by-cnn's Issues

What is the function of 'app' folder?

Flyby CNN is a fantastic work on segmentation mesh surface. The source code composed of two parts: 'py' written in python and 'app' written in C++. I have read part of the source code. I found that the code written in python had implemented the algorithm introduced in the article entitled 'FlyBy CNN: A 3D surface segmentation framework'. But I cannot figure out the meaning of the code in 'app' folder. The README file of 'app' folder is titled 'Building VTK-9.0'. Does it mean the app folder is designed to build a new VTK package for this project? Is it necessary for this project or just another implementation method written in C++? Thanks.

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.