Coder Social home page Coder Social logo

neurdicom's Introduction

Welcome to NeurDICOM documentation

Welcome to everyone

Hello, everyone! I'm very excited that Github's community is interested in my project. Unfortunatly, this project needs improvements in performance and stability. I plan to rewrite some code and replace technologies which I used in first version. It would be great if you bring new fresh ideas to enhance application.


NeurDICOM is portable and easy-to-deploy RESTful DICOM and PACS server that allows physicians to use state-of-the-art methods of machine learning and neural networks to make a diagnosis based on medical images processing and interpetating.

Content

1. API

1.1. Patients
1.2. Studies
1.3. Series
1.4. Instances
1.5. Plugins

2. Plugins

๐Ÿ”ด 1. API

๐Ÿ“— 1.1. Patients

Base URL: /api

Resource Description
GET /patients Find all patients
GET /patients/:id Find patient by id
GET /patients/:id/studies Find studies for patient
PUT /patients/:id Update patient
DELETE /patients/:id Delete patient

GET /patients

Description: Find all patients

GET /patients/:id

Description: Find patient by id

GET /patients/:id/studies

Description: Find patient's studies

PUT /patients/:id

Description: Update patient

DELETE /patients/:id

Description: Delete patient

๐Ÿ“— 1.3 Studies

Base URL: /api

Resource Description
GET /studies Find all patients
GET /studies/:id Find patient by id
GET /studies/:id/series Find studies for patient
PUT /studies/:id Update study
DELETE /studies/:id Delete study

GET /studies

Description: Find all studies

GET /studies/:id

Description: Find study by id

GET /studies/:id/series

Description: Find study's series

PUT /studies/:id

Description: Update study

DELETE /studies/:id

Description: Delete study

๐Ÿ“— 1.3 Series

Base URL: /api

Resource Description
GET /series Find all series
GET /series/:id Find series by id
GET /series/:id/instances Find series' instances
PUT /series/:id Update series
DELETE /series/:id Delete series

GET /series

Description: Find all series

GET /series/:id

Description: Find series by id

GET /series/:id/instances

Description: Find series' instances

PUT /series/:id

Description: Update series

DELETE /series/:id

Description: Delete series

๐Ÿ“— 1.4 Instances

Base URL: /api

Resource Description
GET /instances Find all instance
GET /instances/:id Find instance by id
GET /instances/:id/tags Get instance's tags
GET /instances/:id/image Get instance's image
GET /instances/:id/raw Get instance's raw pixel data in bytes
GET /instances/:instance_id/process/by_plugin/:plugin_id Process instance by plugin
PUT /instances/:id Update instance
DELETE /instances/:id Delete instance

GET /instances

Description: Find all instances

GET /instances/:id

Description: Find instances by id

GET /instances/:id/tags

Description: Get instance's tags

GET /instances/:id/image

Description: Get instance's image

GET /instances/:id/raw

Description: Get instance's raw pixel data in bytes

GET /instances/:instance_id/process/by_plugin/:plugin_id

Description: Process instance by plugin

POST /instances

Description: Save instance

PUT /instances/:id

Description: Update instance

DELETE /instances/:id

Description: Delete instance

๐Ÿ“— 1.5 Plugins

Base URL: /api

Resource Description
GET /plugins Find all plugins
GET /plugins/:id Find plugin by id
POST /plugins Upload plugin
DELETE /plugins/:id Delete plugin

GET /plugins

Description: Find all plugins

GET /plugins/:id

Description: Find plugin by id

POST /plugins

Description: Upload plugin

DELETE /plugins/:id

Description: Delete plugin

๐Ÿ”ด 2. Plugins

Neurdicom provides API for creating plugins to extend the functionality of DICOM files processing. Plugins should be written in Python and packed as ZIP archive. Plugin should have at least two files 'META.json' and 'plugin.py'. 'META.json' describes the plugin, author and main plugin information. Expected strusture of 'META.json' is shown below:

{
	"plugin_guid": "...",
	"author": "John Doe",
	"name": "hello",
	"info": "Print hello greeting",
	"help": "To greet say 'Hello'",
	"params": {
		"name": {
			"type": "text"
		}
	}
}

Field "params" list all parameters which plugin expects. Each "params" field has one of several options "type", "isarray", "values", "isnull". Field "type" is obligatory and takes one of the following values:

[
	"text",
	"int",
	"double"
]

Fields "isarray", "isnull" are boolearn or nullable. Nullable value are is considered as false.
Plugin should have a public "Plugin" class. "Plugin" class should have at least three of the following methods "init", "process" and "destory". Example of "Plugin" class is shown below:

class Plugin:
    def init(self):
        print('Init method called')

    def process(self, ds: Dataset = None, *args, **kwargs):
        print('Hello,', kwargs['name'], '!')
        return {
            'greeting': 'Hello, %s!' % kwargs['name']
        }

    def destroy(self):
        print('Destroy method called')

Also you can write plugins in C/C++. All C/C++ plugins should be createad as a shared library and compiled at the specific target. Library should contain exposed extern C-functions to provide an access to plugin class. For example:

Our library contains 4 files: library.h, library.cpp, plugin.h, plugin.cpp library.h and library.cpp contain defintions of C-functions which provide access to plugin initialization, processing and destruction:

library.h

#include "Plugin.h"

extern "C" Plugin* InitPlugin();
extern "C" double* Process(Plugin *plugin, double *img, int width, int height, const char* params);
extern "C" void DestroyPlugin(Plugin* plugin);

library.cpp

#include "library.h"
extern "C" {

    Plugin* InitPlugin(){
        return new Plugin;
    }

    double* Process(Plugin *plugin, double *img, int width, int height, const char* params) {
        return plugin->process(img, width, height, params);
    }

    void DestroyPlugin(Plugin *plugin){
        delete plugin;
    }
}

Plugin class should contain constructor, processing function and destructor. Processing function should accept at least 4 parameters: image as double array, width, height and additional parameters passed as json string.

plugin.h

class Plugin {
public:
    Plugin();
    double *process(double *, int, int, const char *params);
    ~Plugin();
};

plugin.cpp

#include "Plugin.h"
#include "json.hpp"
#include <iostream>

#include "json.hpp"

// for convenience
using json = nlohmann::json;

using namespace std;

double *Plugin::process(double *img, int w, int h, const char *params) {
    cout << "Processing image" << endl;
    cout << params << endl;
    auto j = json::parse(params);
    double factor = j["factor"].get<double>();
    for (int r = 0; r < w * h; r++) {
        img[r] = factor - img[r];
    }
    return img;
}

Plugin::Plugin() {
    cout << "Initializing plugin" << endl;
}

Plugin::~Plugin() {
    cout << "Destroying plugin" << endl;
}

References

  1. http://bikulov.org/blog/2013/10/01/using-cuda-c-plus-plus-functions-in-python-via-star-dot-so-and-ctypes/

neurdicom's People

Contributors

dependabot[bot] avatar rbaygildin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

neurdicom's Issues

Syntax error when I run install_and_run.sh

When I run install_and_run.sh, the error is :
2019-08-06 18:17:01 [INFO]: Running application
./install_and_run.sh: line 182: syntax error in conditional expression: unexpected token ;' ./install_and_run.sh: line 182: syntax error near ;'
./install_and_run.sh: line 182: ` if [[ $to_install -eq 1]]; then'

Where is documentation?

There is no documentation for this server. How install and work with it? There is no blob directory

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.