Code Monkey home page Code Monkey logo

mojo's Introduction

NOTE: The Rhoana pipeline is still under development, and should not be considered stable.

Rhoana - Dense Automated Neuron Annotation Pipeline

Prerequisites:
numpy          http://numpy.org
scipy          http://scipy.org
h5py           http://www.h5py.org/
mahotas        http://luispedro.org/software/mahotas
OpenCV         http://opencv.org/
pymaxflow      https://github.com/Rhoana/pymaxflow
fast64counter  https://github.com/Rhoana/fast64counter
CPLEX          http://www.ibm.com/software/integration/optimization/cplex-optimizer/


The Rhoana pipeline operates in the following stages:
Classify Membranes
Segmentation
Block dicing
Window Fusion
Pairwise Matching
Local and Global Remapping

A simple driver program is in Control/driver.py.  It takes as input a
file containing a list of images to process.  These should be aligned
EM sections.

ClassifyMembranes/classify_image takes three arguments:
  - image file
  - classifier file (an example is in ClassifyMembranes/GB_classifier.txt)
  - output HDF5
The HDF5 output will contain a single dataset, "probabilities", which
are the per-pixel membrane probabilities.

Segment/segment.py takes two arguments:
  - probabilities HDF5
  - output segmentations HDF5
Output will contain two datasets, "segmentations" and
"probabilities".  The first is of size IxJxN, with I,J the image
dimensions and N the number of generated segmentations (at various
scale and smoothness, N = 30 in the current implementation). The
"probabilities" dataset is just copied from the input.

Control/dice_block.py takes a number of arguments:
- imin, jmin, imax, jmax - the IJ coordinates of the block
- output.hdf5
- K segmentation HDF5 files
This will cut out a block as:
     np.concat([im[imin:imax, jmin:jmax, :] for im in segs[K]], 4)
(and a similar block for the per-pixel probabilities)
It will produce two datasets, "segmentations" and "probabilities".  Segmentation

WindowFusion/window_fusion_cpx.py takes two arguments:
- input block.hdf5
- output fusedblock.hdf5
This will run window fusion to reduce the IxJxNxK block to a labeled
IxJxK block.  Two datasets are produced, "labels" and "probabilities".

PairwiseMatching/pairwise_match.py takes 6 arguments
- two input fused blocks
- the direction they overlap (X = 1, Y = 2, Z = 3)  # this may be inaccurate, currently
- the number of pixels they overlap
- two output HDF5 fused blocks
Pairwise matching produces "labels", "probabilities", and "merges"
datasets.  The first block should always be closer to 0,0,0.  The
usual method is to run it first for all X-even blocks matching to
their X+1 neighbor, then all X-odd blocks matching to their X+1
neighbor, then do the same for Y, then Z.  After Pairwise Matching,
overlapping regions should be consistent.  "merges" is Lx2, with each
row indicating that two labels should be merged in the final result.

(There is a similar, program pairwise_match_region_growing.py, that
uses region growing in the probability maps for overlapping regions.)

Relabelabeling/concatenate_joins.py takes multiple matches blocks and
extracts their merges, and Relabelabeling/create_global_map.py
processes the full list of merges to create the final remap function.
Relabeling/remap_block.py takes this global remap and a single block,
and produces the remapped block.

Relabeling/extract_label_plane.py takes the following arguments:
- the output hdf5 path
- its IxJ size (same as the original image)
- a Z offset for the plane within the input blocks
- a set of (ibase, jbase, input block HDF5)
Extract Label Plane performs rougly the following action:
  for ibase, jbase, infile in args:
     input_data = infile['labels'][:, :, Z]
     output_labels[ibase:ibase+input_data.shape[0],
                   jbase:jbase+input_data.shape[1]] = intput_data

mojo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mojo's Issues

feature request: paint closed outline to merge

Feature request from our group of Summer 2013 interns: it would be helpful if, when merging, the user could paint a closed outline; all segments within that outline would be merged with the target label.

"global replace" merge mode considered harmful

Surprisingly, feedback received from our group of Summer 2013 interns suggests that the "global replace" merge mode is counter-productive. The interns simply did not find this merge mode useful. The interns went so far as to suggest that we should remove the "global replace" merge mode from Mojo to remove the possibility that an inexperienced user would make the mistake of using it.

Since "global replace" is the only merge mode that doesn't touch pixel data (i.e., both other merge modes touch pixel data), this is an issue that warrants rethinking the data structures used to manage merging.

To work around this issue, the interns encouraged each other to never use the merge tool, and instead use the merging functionality that exists in the split tool.

Read Me out of date

Your installation instructions are out of date. Specifically, the repo no longer has a MojoRelease64 folder, nor a copy of the redistributable vcredist_x64.exe. Can you provide this for ease of installation?

Thanks!

feature request: break-off tool

Feature request from our group of Summer 2013 interns: it would be helpful to have a break-off tool, where the user could click on a 2D segment, which would create a new label and assign that new label to the clicked-on segment.

"merge-by-painting" logic considered harmful

Surprisingly, feedback received from our group of Summer 2013 interns suggests that the "merge-by-painting" logic is counter-productive. The interns found this logic (i.e., the logic that selects the largest segment as the keep-this-label label, and applies that label to all the other segments) confusing.

The interns claimed they would prefer specifying the keep-this-label label more directly. The interns suggested the following method for directly specifying the keep-this-label label: the first label you click on when doing a merge-by-painting stroke would be the keep-this-label label; in other words, merge-by-painting strokes would always flow from the keep-this-label label to all other labels.

To work around this issue, the interns encouraged each other to never use the merge tool, and instead use the merging functionality that exists in the split tool.

"2D connected component" and "3D connected component" merge modes are buggy

Our group of Summer 2013 interns claimed that the "2D connected component" and "3D connected component" merge modes are buggy and sometimes do not work as advertised. In the case of the "2D connected component" merge mode, the interns claimed that merge operations are not always actually constrained to the current 2D slice. In the case of the "3D connected component" merge mode, the interns claimed that merge operations do always actually propagate in 3D, and sometimes propagate to not-connected-in-3D components.

To work around this issue, the interns encouraged each other to never use the merge tool, and instead use the merging functionality that exists in the split tool.

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.