Skip to main content

No project description provided

Project description

Tunnelvision

Tunnelvision is an experimental tensor viewer for IPython environments based on Voxel.

Installation

Tunnelvision requires Python 3.7+. Binary wheels are available for MacOS (x86_64/arm64) and Linux.

To install Tunnelvision, run:

pip install tunnelvision

Quick Start

The API of tunnelvision is very similar to that of matplotlib. Tunnelvision is a 5D tensor viewer that requires tensors to have the following format: Batch x Depth x Height x Width x Channels, where channels can be 1 (grayscale/monochrome) or 3 (RGB). You can quickly plot (medical) images using:

import numpy as np
import tunnelvision as tv

arr = np.random.randint(0, 2048, (2, 3, 224, 224, 1), dtype=np.uint16)
tv.show(arr)

More advanced plots with segmentation overlays (or colormaps in general) can be created as follows:

ax = tv.Axes(figsize=(512, 512))
ax.imshow(arr1)
ax.imshow(arr2, cmap="seg")
ax.show()

Medical Imaging

Pyvoxel has support for tunnelvision as well, which allows you to plot images with their correct orientation and spacing, without having to manually set those in the configuration:

import voxel as vx

mv = vx.load("../data/ct/")
tv.show(mv)

VS Code Remote

To use tunnelvision through VS Code remote, we need forward an arbitrary available port to the tunnelvision-server. Once you have forwarded a port from the ports pane within VS Code, make sure to add it to your configuration file for tunnelvision:

# ~/.cache/tunnelvision/default_config.yaml
port: 1337

Debug

Typically, problems will revolve around the WebSockets connection. Make sure your port is forwarded when working remote. Make sure the handshake between the client and server was successful by inspecting the state.websocket object. One can use ps aux | grep tunnelvision to inspect whether the server is running. Logs for the server are stored in ~/.cache/tunnelvision.

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

tunnelvision-0.3.4.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

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

tunnelvision-0.3.4-py2.py3-none-any.whl (2.2 MB view details)

Uploaded Python 2Python 3

File details

Details for the file tunnelvision-0.3.4.tar.gz.

File metadata

  • Download URL: tunnelvision-0.3.4.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for tunnelvision-0.3.4.tar.gz
Algorithm Hash digest
SHA256 3c0eaee00dd96d168934e60b2f21ef2fa9a70327bafee05ea7a9eeb6ff24e31c
MD5 d729776e06cad8629390306d0e4c48b2
BLAKE2b-256 f1401a7dc6e2d0dcbb9525a5ddd5ea5cfb46002a870f3df29039053ab928f363

See more details on using hashes here.

File details

Details for the file tunnelvision-0.3.4-py2.py3-none-any.whl.

File metadata

  • Download URL: tunnelvision-0.3.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for tunnelvision-0.3.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 606bdea36b1bdaa2faaeef44ec89878ed4691e9536af7f1210eb0ff525deb4bf
MD5 ada88d49aa2fe85969e0b6d9b2e57c46
BLAKE2b-256 6ae077c2243421b6685986dd08378c88f9ad05be9094f4b72ab21253eef9e419

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