Skip to content

A flask app rest interface for adding annotations to a cloud volume segmentation

License

Notifications You must be signed in to change notification settings

CAVEconnectome/AnnotationEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnnotationEngine

codecov GitHub Actions

Overview

AnnotationEngine is a Flask-based service for managing annotations in a PostgreSQL/PostGIS database using the DynamicAnnotationDB library. It provides a REST API and web interface for creating, managing, and querying annotation tables with support for spatial annotation data and user permissions on given tables.

Installation

Local Installation

git clone https://github.com/CAVEConnectome/AnnotationEngine.git
cd AnnotationEngine
pip install -r requirements.txt

Docker Setup

# start all the services
docker compose up

# Start the PostgreSQL database (for local db debugging)
docker compose up -d db

# Optional: Start adminer for database management
docker compose up -d adminer

Configuration

Environment Variables

Required environment variables (see .env.dev as an example):

FLASK_CONFIGURATION=development  # or production
POSTGRES_USER=postgres
POSTGRES_PASSWORD=yourpassword
POSTGRES_DB=annotation
AUTH_URI=your_auth_service

Database Configuration

The service requires PostgreSQL with PostGIS extension. Configure the database connection in your environment or config file:

SQLALCHEMY_DATABASE_URI = "postgresql://user:password@localhost:5432/annotation"

Development

Setup Development Environment

  1. Install development requirements:
pip install -r dev_requirements.txt
  1. Run tests:
# this will create a temporary postgis database for testing
pytest --docker=true

Running the Server

Development server:

python run.py

The server will start on port 4001.

API Usage

Full API documentation is available at /annotation/api/doc when the server is running.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A flask app rest interface for adding annotations to a cloud volume segmentation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages