Coder Social home page Coder Social logo

potatothanh / vindr-lab-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vinbigdata-medical/vindr-lab-api

0.0 0.0 0.0 13.18 MB

A part of the VinDr Lab project. Which performs as the middleware layer between user interface and backend systems.

License: MIT License

Shell 0.01% Go 99.61% Makefile 0.11% Dockerfile 0.27%

vindr-lab-api's Introduction

VinDr Lab / API

VinDr Lab API is a part of the VinLab project. Which performs as the middleware layer between user interface and backend systems.

What does this project do?

We guess some of you guys will ask why don’t we combine the upload part into this API. This is simple, Golang can not modify attributes in the DICOM file now, even though Python can do it easily.

Project tree

.
├── account/ // account management
├── annotation/ // including business process for annotations and labels
├── api-doc.yml
├── conf/ // configuration files and permission definitions
├── constants/ // some constants for project
├── Dockerfile
├── entities/ // entities definition
├── gen-api-doc.sh
├── helper/ // side-kick component, connect to other service
├── images/
├── keycloak/ // supported library for Keycloak
├── label_group/ // handle request for label_group
├── LICENSE.md
├── main.go // the leading actor
├── mappings/ // some maps for document's attributes
├── mw/ // mid-layer used for authorizing and validating coming requests
├── object/ //handle business for object
├── project/ // handler for project
├── README.md
├── redoc-static.html
├── session/ // session controller for dashboard - viewer
├── stats/ // provide stats and some high-computation-work-load result
├── study/ // process business for study and task objects
├── templates/ // some elasticsearch sepecified template for document
└── utils/ // utilities for project

API Document

We use Swagger 3 annotations for the document. You can check it out the api-doc.yml file, to open it, open the redoc-static.html file in your browser. We have a small bash file named gen-api-doc.sh, if you want to try to generate docs from the yaml. Have fun!

drawing

Installation

Option 1: Kubernetes

Go to deployment project and follow the instruction

Option 2: Docker

You can execute the docker-compose.yml file as follow:

$docker-compose pull
$docker-compose down
$docker-compose up -d --remove-orphans

Option 3: Bare handed

Just run the main.go file

$export GO111MODULE=on
$go mod tidy
$go run main.go

There is a little bit different when choose one of these options, in the option 3, the prefix for your request is just <your_address>/<path_to_resources> instead of <your_address>/api/<path_to_resources>

Configuration

Following the Installation, the application has two ways to absorb its configurations. Once is from the config.produciton.toml file that comes with the app. Or you can override it by passing through environment variables in Docker. As you can see, the configuration file has the following form:

[webserver]
port = 8088

[elasticsearch]
uris = ["YOUR_ES_URI"]
annotation_index_prefix = "YOUR_STUDIES_INDEX"
label_index_prefix = "YOUR_LABEL_INDEX"
study_index_prefix = "YOUR_STUDY_INDEX"
project_index_prefix = "YOUR_PROJECT_INDEX"
label_export_index_prefix = "YOUR_LABEL_EXPORT_INDEX"
object_index_prefix = "YOUR_OBJECT_INDEX"
session_index_alias = "YOUR_SESSION_INDEX"
label_group_index_prefix = "YOUR_LABEL_GROUP_INDEX"
task_index_prefix = "YOUR_TASK _INDEX"

[minio]
uri = "YOUR_MINIO_URI"
access_key_id="YOUR_MINIO_KEY_ID"
secret_access_key="YOUR_MINIO_ACCESS_KEY"
bucket_name="YOUR_MINIO_BUCKET"

[keycloak]
uri = "YOUR_KEYCLOAK_URI"
master_realm = "master"
app_realm = "YOUR_REALM"
admin_username = "YOUR_KEYCLOAK_USERNAME"
admin_password = "YOUR_KEYCLOAK_PASSWORD"

[orthanc]
uri = "YOUR_ORTHANC_URI"

[redis]
uri = "YOUR_REDIS_URI"

[id_generator]
uri = "YOUR_IDGEN_URI"

Please note that, the conversion from environmental variables to API configuration items itself like: KEYCLOAK__ADMIN_USERNAME equals to keycloak.admin_username

Others

More information

For a fully documented explanation, please visit the official document.

Roadmap

Medical image labeling is just our first step, hope you to come and join us for other entities like: image, text, sound...

vindr-lab-api's People

Contributors

iamatsundere 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.