A GRPC interface to the OsiriX software
Project description
osirixgrpc
Welcome to the osirixgrpc library. This provides the protobuf definitions for interacting with the osirixgrpc plugin. This code is autogenerated by the grpc tools using the proto template files provided in the main osirixgrpc project.
For day-day usage we suggest using the dedicated pyosirix package instead.
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
Release history Release notifications | RSS feed
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.1.dev1.tar.gz
(28.5 kB
view details)
File details
Details for the file osirixgrpc-0.2.1.dev1.tar.gz
.
File metadata
- Download URL: osirixgrpc-0.2.1.dev1.tar.gz
- Upload date:
- Size: 28.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bacb46948f0dd40dc22415a646122f4f669b111bcf10476f79631f3f5d896e1 |
|
MD5 | 8bac638304745bc303791e8f55abc214 |
|
BLAKE2b-256 | ef2635cf347de0644f6a542d8f1bc7b21e09b65a73d9e46c58edef67e603c9ac |