Skip to content
This repository has been archived by the owner on Oct 24, 2019. It is now read-only.

hadim/maskflow-fiji

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

maskflow-fiji: Object Detection and Segmentation

A Fiji plugin for object detection and tracking based on Mask RCNN.

It allows object detection, segmentation and tracking using a pre-trained model with the associated maskflow Python package.

IMPORTANT: This plugin is a proof of concept and in a very early stage. At the moment only a simple model to detect microtubules is provided. I hope to be able to continue the development at some point.

Usage

  • Start Fiji.
  • Click on Help ▶ Update....
  • In the new window, click on Manage update sites.
  • Scroll to find Maskflow in the column Name. Click on it.
  • Click Close and then Apply changes.
  • Restart Fiji.
  • Open your image.
  • Run the commands at Plugins ► Maskflow.

Screenshots

Output of the microtubule model.

Scripting

Here is an example script:

# @Dataset data
# @CommandService cs
# @ModuleService ms

from sc.fiji.maskflow import ObjectDetector

inputs = {"model": None,
          "modelName": "Microtubule",
          "dataset": data,
          "fillROIManager": True}}
module = ms.waitFor(cs.run(ObjectDetector, True, inputs))

table = module.getOutput("table")
masks = module.getOutput("masks")

The plugin also comes with an object tracker based on the centroid of the detected masks:

# @Dataset data
# @CommandService cs
# @ModuleService ms

from sc.fiji.maskflow import ObjectDetector
from sc.fiji.maskflow import ObjectTracker

inputs = {"model": None,
          "modelName": "Microtubule",
          "dataset": data,
          "fillROIManager": True}
module = ms.waitFor(cs.run(ObjectDetector, True, inputs))

table = module.getOutput("table")
masks = module.getOutput("masks")

inputs = {"masks": masks,
          "table": table,
          "linkingMaxDistance": 10,
          "gapClosingMaxDistance": 10,
          "maxFrameGap": 5,
          "fillROIManager": True}
          
module = ms.waitFor(cs.run(ObjectTracker, True, inputs))
table = module.getOutput("resultTable")

There is also a command that combine both detection and tracking:

# @Dataset data
# @CommandService cs
# @ModuleService ms

from sc.fiji.maskflow import ObjectDetectAndTrack

inputs = {"model": None,
          "modelName": "Microtubule",
          "dataset": data,
          "linkingMaxDistance": 10,
          "gapClosingMaxDistance": 10,
          "maxFrameGap": 5,
          "fillROIManager": True}
module = ms.waitFor(cs.run(ObjectDetectAndTrack, True, inputs))

table = module.getOutput("resultsTable")
masks = module.getOutput("masks")

Available Models

Objects Version Description Image Size URL
Microtubule 0.1 WIP 1280x1280 https://storage.googleapis.com/nn-models/microtubule-v0.1.zip

GPU Support

This type of neural networks are much more faster on GPU than CPU. To enable GPU support you need to manually replace libtensorflow_jni.jar to libtensorflow_jni_gpu.jar in your Fiji jars/ folder.

Authors

maskflow-fiji has been created by Hadrien Mary.

License

MIT. See LICENSE.txt