Skip to content

Development Overview v1

John Hoffer edited this page Mar 9, 2017 · 1 revision

Butterfly is meant to be flexible for many specific needs and should allow easy addition of new input and output formats. The following is an overview of the functions of each script:

Structure

b.py - The driver of the server, which takes one optional argument to specify the port.

In _butterfly:

  • core.py - The Core class which creates new data sources and contains the main get() method for grabbing volumes.
  • datasource.py - The DataSource superclass which handles loading from disk.
    • The load() method currently handles file input, resize, as well as caching (currently they should always happen together). These functions can be split into separated methods for code clarity if needed.
  • requestparser.py - The RequestParser class which parses all queries. Currently supports default and OCP formats.
    • The request sent to the RequestParser instance is a / forward-slash splitted list of the http request, not including the handle (e.g. /data/).
  • settings.py - The settings file.
  • webserver.py - The tornado web server script; currently listens for requests with /data/ handles.
    • Currently, all output encoding is handled in this script.

Subclasses of DataSource:

  • mojo.py - The Mojo data source type that is currently the best supported file structure, featuring complete automatic indexing of files, folders, segmentations, and color map.
  • regularimagestack.py- The RegularImageStack class is a flexible option for custom named folders and files, where manual input of these parameters are done by a short .args file in the folder of the DATAPATH.

Planned

Version 2

Version 1

Clone this wiki locally