GithubHelp home page GithubHelp logo

aalecs / orthanc-rust-plugins Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andrewwebber/orthanc-rust-plugins

0.0 0.0 0.0 413 KB

rust orthanc plugin examples

License: GNU Affero General Public License v3.0

Shell 0.76% Rust 97.42% Makefile 1.32% Dockerfile 0.51%

orthanc-rust-plugins's Introduction

Orthanc Rust Samples

Orthanc plugin showcasing Rust integration with Orthanc.

  • S3 storage (CRUD)
  • Change notification

diagram

Concept

This repository showcases how you can use the Orthanc C/C++ SDK to build a safe plugin.

The sample makes use of

  • Tokio for the async runtime
  • Rusoto for the S3 integration
  • Bindgen for code generation from C/C++ headers

Getting started

Configuration

A local ".env" file is used to configure the plugin. In the absense of the configuration file, environment variables can be used to specify s3 parameters.

RUST_LOG="debug"
S3_ENDPOINT="http://localhost:9000"
S3_ACCESS_KEY="minio-root-user"
S3_SECRET_KEY="minio-root-password"
S3_BUCKET="orthanc"
S3_REGION="eu-central-1"

Building the plugin

Using the provided example Makefile you can download and compile orthanc in order to link the Rust plugin.

make orthanc release

Simulating S3 locally

You can use Docker compose to start a local minio to simulate an endpoint that implements the S3 protocol. Start the following command in a dedicated terminal session.

docker compose up

Run the plugin locally

make run-orthanc

http://localhost:8888

The plugin should load. Now simply upload some DICOMs and inspect the logs

You can inspect the S3 contents using the Minio dashboard

Run the plugin as a Docker container

A sample docker file includes how to run the plugin inside a matching version or Orthanc

make docker-image run-orthanc-docker

or

docker run --rm -it --net=host -v $PWD/.env:/.env:ro orthanc-rust-samples:<COMMIT-ID>

http://localhost:8888

Licensing

Created a license because AGPL scares me. ¯_(ツ)_/¯

These plugins for Orthanc are licensed under the AGPL license.

orthanc-rust-plugins's People

Contributors

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