Code Monkey home page Code Monkey logo

lowtis's Introduction

Lowtis: Low Latency Image Service Picture

##DVID-backed Iamge Service

Lowtis is a library to fetch 2D image data from 3D volumes. The primary data backend supported in DVID. Lowtis aims to optimize the latency of image access in DVID through efficient use of low-level API and by prefetching and caching data. It provides a layer of abstaction to make accessing DVID block and multi-scale data much easier.

Installation

The primary dependency is libdvid-cpp. To build an application that uses the library use a C++11 compatible compiler and add '-llowtis' to the compile line.

Standalone installation

To install lowtis:

% mkdir build; cd build;
% cmake -DLIBDVID_INCLUDE=path_to_libdvid_include ..
% make; make install

Make sure libdvidcpp include and library paths are visible to this build. These commands will install the library liblowtis. If you are building this against libdvid install with conda, add the flag -DCMAKE_PREFIX_PATH=path_to_conda_env.

Conda installation

The Miniconda tool first needs to installed:

# Install miniconda to the prefix of your choice, e.g. /my/miniconda

# LINUX:
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
bash Miniconda-latest-Linux-x86_64.sh

# MAC:
wget https://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh
bash Miniconda-latest-MacOSX-x86_64.sh

# Activate conda
CONDA_ROOT=`conda info --root`
source ${CONDA_ROOT}/bin/activate root

Once conda is in your system path, call the following to install neuroproof:

% conda create -n CHOOSE_ENV_NAME -c flyem-forge lowtis

Conda allows builder to create multiple environments. To use the library, set your library path to PREFIX/CHOOSE_ENV_NAME/lib.

Note: this should work on many distributions of linux and on Mac OSX 10.10+. For Mac, you will need to set DYLD_FALLBACK_LIBRARY_PATH to PREFIX/CHOOSE_ENV_NAME/lib.

Usage

The calling program must initialize configuration options in lowtis/LowtisConfig.h and interact with the functions in lowtis/lowtis.h. The simple example below highlights the main external functionality:

#include <lowtis/lowtis.h>

using namespace::lowtis;

int main()
{
    // create dvid config
    DVIDLabelblkConfig config;
    
    config.username = "[email protected]" 
    config.dvid_server = "127.0.0.1:8000";
    config.dvid_uuid = "abcd";
    config.datatypename = "segmentation";
    
    // create service for 2D image fetching
    ImageService service(config);

    // fetch image from 0,0,0 into buffer
    int width = 800; int height = 600;
    std::vector<int> offset(3,0);
    char* buffer = new char[width*height*8];
    service.retrieve_image(width, height, offset, buffer);
    
    // service.flush_cache(); // to reset cache

    return 0;
}

TODO

  • Support callback for asynchronously updating caller
  • Support non-isotropic block sizes
  • Add unit and integration tests
  • Implement prefetching

lowtis's People

Contributors

stuarteberg avatar stephenplaza avatar tingzhao avatar

Watchers

 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.