Code Monkey home page Code Monkey logo

musclekit's Introduction

muscleKit

A set of Python scripts to automate the analysis of immunofluorescent muscle cross-sections. Currently, the following tasks are supported:

  • Semi-automatic fiber segmentation and cross-sectional analysis
  • Fiber typing

These scripts integrate with the ImageJ image processing software for easy pre and post processing.

muscleKit

Installation

Requirements

  • Python 3.6
  • ImageJ (optional)

Setup

Clone the repository and install the required dependencies.

git clone https://github.com/probberechts/muscleKit.git
cd muscleKit
pip install -r requirements.txt

By default, the fiber segmentation script will use the Morphological Snakes implementation of scikit-image. However, a muck faster C++ based implementation is available in the development branch of the morphsnakes package. To use this implementation instead, you should run the commands below:

cd muscleKit
git clone -b develop https://github.com/pmneila/morphsnakes.git
cd morphsnakes
pip install Cython
pip install .

Usage

Fiber Segmentation

Screencast

  1. Open the image which you would like to analyze with ImageJ.

  2. Select the multi-point selection tool and click in the middle of each cell which you would like to segment.

  3. Use the export_multipoinset macro to export these points as a CSV file.

  4. Run the fiber_segmentation.py script to segment the fibers.

    python fiber_segmentation.py examples/test.tiff examples/test.tiff.csv --threshold 0.58

    Run python fiber_segmentation.py -h for an explanation with all parameters.

  5. Once the script finishes, a ZIP file test.zip is created. This archive contains all ROI's of the selected cells and can be opened in ImageJ.

Fiber Typing

Screencast

  1. Perform the fiber segmentation step and obtain all ROIs.

  2. Open the image which you would like to analyze with ImageJ.

  3. Use the ROI manager (Analyze > Tools > ROI Manager) to open the corresponding ROIs (ROI Manager> More > Open ...).

  4. Make sure ImageJ uses the file names as labels (ROI Manager > More > Labels).

  5. Use ImageJ's measure feature (ROI Manager > measure) to create a CSV file with the label of each ROI. Optionally, you can use this tool to measure other features as well, such as the cross-sectional area.

  6. Adjust the color balance of the image (Image > Adjust > Color Balance) until each fiber type has a maximally different color.

  7. Save the resulting image.

  8. Run the fiber typing script.

    python fiber_typing.py examples/test.colors.tiff examples/test examples/test.analysis.txt
  9. Adjust the sliders until you obtain a feasible configuration and click 'Done'.

  10. The script will create a new CSV file, containing all fields in test.analysis.txt with an additional column containing the color of each fiber.

Auhors

License

GNU GPL license

musclekit's People

Contributors

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