Skip to main content

gRPC interface for interacting with OsiriX

Project description

OsiriXgrpc

Welcome to OsiriXgrpc!

Powered By gRPC GitHub License PyPI - Downloads Static Badge Static Badge

Welcome to OsiriXgrpc, a research plugin for the popular OsiriX medical image viewing platform for macOS. It leverages the gRPC architecture to provide fast communication between OsiriX (the server) and custom-built software or scripts running on a different local process (the client). This enables fast development of additional OsiriX functionality, including the adoption of state-of-the-art libraries for image processing and artificial intelligence. Currently, Python is the only in-built supported language, though adoption of other languages can be easily achieved.

!!! note "Using osirixgrpc versus pyosirix" It can be much simpler to interact with OsiriXgrpc using the more pythonic pyOsiriX glue code. See the dedicated documentation for further information.

Installation

For instructions on how to install and set up the plugin, please see the getting started page.

Any suggestions?

We are always happy to receive suggestions for future versions of the plugin, or just to hear about what is or isn't working. We would appreciate if this is done by raising an issue. Please see more information in our contributing section.

Any questions?

We are happy to answer any questions on the use of osirixgrpc, but please do so by raising an issue so that others can benefit from the answer. Please ensure that you use the relevant issue template so that we get all the information we need!

Future Ambitions

We are always looking to improve things. We have a few suggestions in our roadmap, and would be happy to hear your thoughts - please let us know using a feature request issue template.

  • Support for other scripting languages including Java and Ruby.
  • Improve security through SSL/TCL encryption.

Examples

Establishing a connection with grpc

import grpc
import osirix_pb2_grpc

port = 12345  # Must match activated port in OsiriX plugin
server_url_localhost = 'localhost:' + str(port)
channel_opt = [('grpc.max_send_message_length', 512 * 1024 * 1024), ('grpc.max_receive_message_length', 512 * 1024 * 1024)]
channel = grpc.insecure_channel(server_url_localhost, options=channel_opt)
stub = osirix_pb2_grpc.OsiriXServiceStub(channel)

Obtain a copy of the current browser

import utilities_pb2

request = utilities_pb2.Empty()  # For functions with no input, use an empty request
response = stub.OsirixCurrentBrowser(request)
if response.status.status == 0:
    raise Exception("Could not get browser.  Reason: %s" % response.status.message)
browser_controller = response.browser_controller

Get the current database selection within the browser controller

import browsercontroller_pb2

response = stub.BrowserControllerDatabaseSelection(browser_controller)
series = response.series
studies = response.studies

Obtain the names of the selected studies

import dicomstudy_pb2

for dicom_study in studies:
    response = stub.DicomStudyName(dicom_study)
    print("Study name: ", response.name)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osirixgrpc-0.2.1b6.tar.gz (27.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

osirixgrpc-0.2.1b6-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file osirixgrpc-0.2.1b6.tar.gz.

File metadata

  • Download URL: osirixgrpc-0.2.1b6.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for osirixgrpc-0.2.1b6.tar.gz
Algorithm Hash digest
SHA256 d32adc0131c136560265484ca818289ff1dd2d415c369b061a990f87a29d2b79
MD5 b1c28104964e73cb75c37879d91b14a4
BLAKE2b-256 45c656b8f6726e6dafb9a37821ec5b648dd4626e405cef428f9427d4fcf325e3

See more details on using hashes here.

File details

Details for the file osirixgrpc-0.2.1b6-py3-none-any.whl.

File metadata

  • Download URL: osirixgrpc-0.2.1b6-py3-none-any.whl
  • Upload date:
  • Size: 36.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for osirixgrpc-0.2.1b6-py3-none-any.whl
Algorithm Hash digest
SHA256 57aba4c21831cd61ddc9fcc4c2ae50e5c32dc76cb3be7dbd272253fbe9a5bfe3
MD5 6f6af7dc527e53d3605074855db2944f
BLAKE2b-256 4f2abf8d76d1de07fd1f9c96b20732a4aaa4d15223f39d605b760b663b6b80e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page