GithubHelp home page GithubHelp logo

shubhranshu2411 / myosothes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brunettsp/myosothes

0.0 0.0 0.0 25.2 MB

An automated Myofibers Segmentation wOrkflow Tuned for HE Staining

License: GNU General Public License v3.0

Shell 3.89% Python 11.43% Groovy 84.69%

myosothes's Introduction

Required tools and libraries installation

Two tools are required to run workflow and need to be installed:

  1. Install QuPath 0.3.1 using documentation available at: https://github.com/qupath/qupath
  2. Install Cellpose 2.0.4 using anaconda environment following user guide available at: https://github.com/MouseLand/cellpose
  3. Install Pillow python library in previously created anaconda environment: pip install pillow==8.0.1.

Preliminary setup

Add classifiers directory in your QuPath project directory and Cellpose_retrained_model/CP_20220420_140301 file in $HOME/.cellpose/models directory.

Add images to be analyzed to the QuPath project.

Perform analysis

Manual version

To execute entire workflow manually, available scripts must be executed in following order:

  1. In QuPath environment, tile opened image and export them in tif format with scripts/Perform_analysis/ManualVersion/export_tiles.groovy script. Tiles will be exported with specific naming style and stored in the project in tiles/imageNameWithoutExtension directory: imageNameWithoutExtension_[x=xValue,y=yValue,w=width,h=height].tif
  2. In previously created anaconda environment, execute scripts/Perform_analysis/ManualVersion/runCellpose_fragmented.py after setting up all variables at the script top.
  3. In same environment, run scripts/Perform_analysis/ManualVersion/remove_overlap.py script after setting up required parameters in main loop.
  4. In QuPath environment, execute groovy script scripts/Perform_analysis/ManualVersion/import_fragmented_masks.groovy after specify masks directory location at its beginning.
  5. In QuPath environment, run analysis using scripts/Perform_analysis/ManualVersion/filter_annotation_phenotype_measurement.groovy script.

Results are stored under InfDiam_Centro_results directory available in QuPath project directory.

Automated version

It is possible to execute the entire workflow with a single line of command in the terminal with the automated version.

  1. Go to directory scripts/Perform_analysis/AutomatedVersion
  2. In terminal, type the following command, replacing the arguments with their values : ./automate_analysis.sh path_to_qupath_bin path_to_conda_env_bin image_name path_to_project_dir path_to_scripts tile_size overlap_size path_to_mask_storage_directory use_gpu model_name_with_path segm_channel diameter

Results are stored under InfDiam_Centro_results directory available in QuPath project directory.

Segmentation error measurement

Manual version

The error measurement workflow used to tune our workflow can be executed in QuPath environment in following order:

  1. Run groovy script scripts/Measure_error/ManualVersion/import_fragmented_masks.groovy after specify masks directory location at its beginning
  2. Assign them a label by executing them the "Prediction" using set up scripts/Measure_error/ManualVersion/SetAnnotationClass.groovy script.
  3. Filter masks using scripts/Measure_error/ManualVersion/filter_annotations.groovy script.
  4. Import ground truth masks stored in GeoJSON format with scripts/Measure_error/ManualVersion/import_ground_truth.groovy script with indicated directory location.
  5. Assign them the "VeriteTerrain" class using scripts/Measure_error/ManualVersion/SetAnnotationClass.groovy again with updated class name.
  6. Run scripts/Measure_error/ManualVersion/measure_error.groovy script to get the F1-score indicator.

Automated version

It is possible to execute the entire error measurement workflow with a single line of command in the terminal with the automated version.

  1. Go to directory scripts/Measure_error/AutomatedVersion
  2. In terminal, type the following command, replacing the arguments with their values : ./automate_error_measurement.sh path_to_qupath_bin image_name path_to_project_dir path_to_scripts path_to_masks path_to_ground_truth

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.