Code Monkey home page Code Monkey logo

scikit-surgerybk's Introduction

scikit-surgerybk

Logo

GitHub Actions CI statuss Test coverage Documentation Status Follow scikit_surgery on twitter

Author: Thomas Dowrick

scikit-surgerybk is a Python library for interfacing with BK ultrasound machines, and is part of the SciKit-Surgery software project, developed at the Wellcome EPSRC Centre for Interventional and Surgical Sciences, part of University College London (UCL).

scikit-surgerybk supports Python 2.7 and Python 3.6/3.7/3.8.

Developing

Cloning

You can clone the repository using the following command:

git clone https://github.com/SciKit-Surgery/scikit-surgerybk

Running tests

Pytest is used for running unit tests:

pip install pytest
python -m pytest

Linting

This code conforms to the PEP8 standard. Pylint can be used to analyse the code:

pip install pylint
pylint --rcfile=tests/pylintrc sksurgerybk

Installing

You can pip install directly from the repository as follows:

pip install git+https://github.com/SciKit-Surgery/scikit-surgerybk

Contributing

Please see the contributing guidelines.

Useful links

Licensing and copyright

Copyright 2019 University College London. scikit-surgerybk is released under the BSD-3 license. Please see the license file for details.

Acknowledgements

Supported by Wellcome and EPSRC.

scikit-surgerybk's People

Contributors

tdowrick avatar thompson318 avatar

Watchers

 avatar  avatar  avatar

scikit-surgerybk's Issues

Do something sensible if incoming data feed is interrupted

In GitLab by @ThomasDowrick on Mar 7, 2019, 12:06

Currently there is no notification if the incoming data stream is interrupted e.g. if the feed is frozen, or the BK machine turned off.

A suitable warning/error should be generated.

Decoding received message from capture_image command

Hi,

I found your bk5000.py setup and it works very well in collecting a real-time stream from the BK5000.
However, I am new to bytes and TCP links and I try to figure out how to decode the received message after the command CAPTURE_IMAGE.
I figured out that the response message is much shorter than the bytearray length, assuming that the single image is sent in multiple parts through the buffer. The get_frame and decode_image functions from the bk5000.py do not solve the problem.

I expected an array of win_size[0]*win_size[1] which is around 360.000 bytes. However, in the bytearray I receive around 132.000 bytes.
When sending the command through the BK OEM test tool I received a 132kb .bin file which is the entire image when opened with ImageJ. This means that the bytearray containing the 132.000 bytes should be the entire image. But I cannot decode the bytes and reshape them into the win_sizes.

Could you please help me?

Nicolaas

Include timestamp in image messages

In GitLab by @AnastasisGeorgoulas on Mar 14, 2019, 12:39

When sending a message over OpenIGTLink, it would be useful to include a timestampt (e.g. the time that the corresponding image was completely read from the US, or the time that the message is about to be sent). This would help synchronisation when mixing with other streams, such as tracking data, and the ImageMessage class already has an attribute for that.

Scitkit-Surgerybk not working after update BK5000

Hi,

Recently the BK5000 in our hospital has been updated, and now the communication is broken.
I tried the OpenCV connection from sksurgerybk/interface/bk5000.py.
Do you have any idea what the problem could be?
It seems like messages are not correctly coded and decoded from bytes anymore.

Traceback (most recent call last):
File "", line 1, in
File "", line 802, in start
File "", line 682, in get_frame
File "", line 602, in receive_image
File "", line 349, in find_first_a_not_preceded_by_b
IndexError: index 0 is out of bounds for axis 0 with size 0

the software version is 5.16.2
distribution build: 6.7.20836.6
HW type: 2304
image update 6.7.20836.6

We would really appreciate your help!

Implement image decoding as in Niftk

In GitLab by @ThomasDowrick on Feb 21, 2019, 11:15

The actual image decoding step in Niftk is done in the ReceiveImage function and FindFirstANotPreceededByB.
As this involves a lot of array/byte manipulation I have a suspicion that it might be preferable to implement this part of the code as wrapped C/C++ for performance reasons.

Optimise image decode step

In GitLab by @ThomasDowrick on Mar 7, 2019, 12:06

I'm reasonably happy with the performance of the image acqusition step decode_image(), but it could probably be made a bit more 'pythonic' and be tidied up.

Function to create bk_pyigtlink server

In GitLab by @ThomasDowrick on Mar 26, 2019, 10:12

Rather than running the script manually, have a function that creates the server, that can be called from other libraries.

tests using mocked TCP data

In GitLab by @ThomasDowrick on Feb 21, 2019, 11:17

While we will test using the actual BK machine, for the purposes of development we should be able to mock some TCP messages/data.

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.