Skip to content

Commit

Permalink
feat: starting to add callback code for volume click events
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Nov 24, 2023
1 parent 8448b2a commit a15e72f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions API/oursin/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import asyncio

from . import camera
from . import volumes

class bcolors:
WARNING = '\033[93m'
Expand Down Expand Up @@ -42,6 +43,10 @@ def receive_camera_img_meta(data):
@sio.on('CameraImg')
def receive_camera_img(data):
camera.on_camera_img(data)

@sio.on('VolumeClick')
def receive_volume_click(data):
volumes.volume_click(data)

# Helper functions
def connected():
Expand Down
14 changes: 14 additions & 0 deletions API/oursin/volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,25 @@

CHUNK_LIMIT = 1000000

def volume_click(data):
print(data)

class Volume:
"""Volumetric dataset represented in a compressed format by using a colormap to translate
uint8 x/y/z data into full RGB color.
Volumes should be created in (AP, ML, DV)
"""
def __init__(self, volume_data, colormap = None):
"""_summary_
Parameters
----------
volume_data : _type_
_description_
colormap : _type_, optional
_description_, by default None
"""
global counter
self.id = f'volume{counter}'
counter += 1
Expand Down
3 changes: 3 additions & 0 deletions Server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ io.on("connection", function (socket) {
socket.on('CameraImg', function(data) {
emitToSender(socket.id, 'CameraImg', data);
});
socket.on('VolumeClick', function(data) {
emitToSender(socket.id, 'VolumeClick', data);
});

// Receiver events
socket.on('log', function(data) {
Expand Down

0 comments on commit a15e72f

Please sign in to comment.