Git Product home page Git Product logo

butterfly'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

butterfly's People

Contributors

eagonmeng avatar haehn avatar jtriley avatar leekamentsky avatar quantifiedcode-bot avatar thejohnhoffer avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

butterfly's Issues

Automatic URL shortening

Would be lovely (though not high priority) to have something a bit more compact for sharing purposes.

entity_feature

This API call should give certain features for a given segment ID.

  • identify which features we need and which ones need to be pre-calculated, calculated on the fly
  • distinguish from anatomical DB (some features will be in the database) / maybe all features will be in the DB
  • add API call

import computation stage

We need to compute some image features or characteristics during import of data and then store them in the DB or somewhere.

  1. add generalized (modular) framework to have certain actions run during import
  • bfly starts, detects new data, computes stuff if required
  • shall this be executed as a different thread? does nipype wheels help (https://github.com/FNNDSC/wheels) ? or is this all too complicated and we should wait until computation is done to start serving BFLY
  1. which actions do we need? (prolly later, framework first)

support json files for all tilesources

Currently, any channel can be specified by the path to the actual data, but the hdf5 tilesource also allows the channel to be specified with a path to a json file with the path to the actual data.

If we accept a json channel for any tilesource, then we will be able to store specific information about each channel in the json file. This would be one solution for specifying whether a particular channel is a mask.

Circle CI builds failing

This comes from the inability of requirements.txt to properly manage dependencies. We'll need to remove this file and have CircleCI manage dependencies with setup.py.

Right now the CircleCI builds are only happening against the thejohnhoffer fork since I can't add the integration to the main repository without admin access.

But I've added the badges to the readme files of the main repository regardless.

rc butterfly installation

  • fix it with existing data
  • symlink everything to one folder on coxfs
  • make sure if we have new data, we can re-trigger easily auto-detection (to test, maybe completely remove rc config)

No autoreload in production

We should add something to the rh-config to disable tornado autoreload of the server when source code changes.

api/mask query

currently we store masks as a channel, but the spec requests a direct api call (api/mask)

current way of requesting this:
bfly/api/data?experiment=X&dataset=Y&sample=Z&channel=MASKNAME

idea: keep current structure and just proxy through the new api/mask request (we need to identify what the MASKNAME is)

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.