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.dev0.tar.gz
(44.4 kB
view details)
File details
Details for the file osirixgrpc-0.2.1.dev0.tar.gz
.
File metadata
- Download URL: osirixgrpc-0.2.1.dev0.tar.gz
- Upload date:
- Size: 44.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.7.1 requests/2.25.1 setuptools/62.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe1125cef4a50daabf54137b2a45a801e342a1b616dd7fa523b785b6a6df33e0 |
|
MD5 | 0261338d28cbf2c04cb9a82fec473771 |
|
BLAKE2b-256 | 898dffe8c718e6ba092b108fb3c9f168d0e2f7b55585f0ac265b8dd9bca17de2 |