Giter Site home page Giter Site logo

peterzs / 3d-confocal-microscopy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gwinkelmaier/3d-confocal-microscopy

0.0 0.0 0.0 2.27 MB

Organization of organoid models imaged in 3D with confocal microscopy.

License: MIT License

Shell 0.74% Python 96.50% MATLAB 2.76%

3d-confocal-microscopy's Introduction

3D-confocal-microscopy

Organization of organoid models imaged in 3D with confocal microscopy.

Installation

Virtual Environment

  1. Clone this repository
  2. Install Anaconda https://docs.anaconda.com/anaconda/install/
  3. Clone the Tensorflow 2.0 GPU anaconda virtual environment with the following bash script
conda env create -f anaconda.yml
conda activate tf_gpu

File Structure

  • Project Folder
    • data
      • records -> TF Records of training data
    • src -> src folder for python and shell scripts
      • logs -> output folder to tensorboard logs
    • saved-models -> output folder for saved models
      • unet -> sub directory for models trained using unet weight map
      • pot -> sub directory for models trained using potential-field weight map

Data

Training data can be found at https://osf.io/g9xv8/ and contains:

  • 3D Training images (matlab file)
    • Imaged with confocal microscopy
    • Image scale of 1 cubic-micron per voxel
  • 3D Training masks (matlab file)
    • Binary Label Mask
    • Weight map used by loss function (unet definition)
    • Weight map used by loss function (potential-field definition)

Weight Map

The weight map is used as a channel input to the model and encodes the pixel-wise weights to be used by the loss function. This weight map is precomputed for two definition: (1) UNet; (2) Potential-field [1]

Train the model

First, download the data and place the tfrecords into the 'records' subfolder under the 'data' directory.

Then, use the python script 'main.py' to train the model from scratch.
Use of the script is demonstrated in 'train.sh' where hyperparameters are set to be: unet field loss function, batch=2, epochs=10, alpha=10. These are passed to the script via the command line. Hyperparameters and usage help can be found with:

python main.py -h

Pretrained models wegihts are also available at https://osf.io/g9xv8/.

Demo Inference

Download the model and sample image ('demo-sample.tif') from https://osf.io/g9xv8/ and place in the inference directory.

Running the following command will transform all tif images in the working directory to a TFRecord, make a prediction, and save the output as a .mat file.

python main.py $PWD

References

[1] Khoshdeli, M., Winkelmaier, G., & Parvin, B. (2019). Deep fusion of contextual and object-based representations for delineation of multiple nuclear phenotypes. Bioinformatics, 35(22), 4860-4861.

3d-confocal-microscopy's People

Contributors

gwinkelmaier 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.