Experimental tensor viewer for IPython built on top of Voxel
Project description
Tunnelvision
Tunnelvision is an experimental tensor viewer for IPython environments based on Voxel.
Installation
Tunnelvision requires Python 3.7+. Wheels are only available for MacOS (x86_64) and Linux for now.
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()
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
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 Distributions
Built Distributions
File details
Details for the file tunnelvision-0.3.3-py3-none-manylinux1_x86_64.whl
.
File metadata
- Download URL: tunnelvision-0.3.3-py3-none-manylinux1_x86_64.whl
- Upload date:
- Size: 3.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 447847ef84765f81f3f44e1867c5fc59a22a78a0a95807df7a8041256c2f631b |
|
MD5 | 527f8415d6d7751be94f2286eed5bc18 |
|
BLAKE2b-256 | f243b93d51f4cb0e8216dfe22a2edc8f1b273b4a7b4505a03cc77f272d4144c2 |
File details
Details for the file tunnelvision-0.3.3-py3-none-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: tunnelvision-0.3.3-py3-none-macosx_10_14_x86_64.whl
- Upload date:
- Size: 2.3 MB
- Tags: Python 3, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c3474cd1215c627bcfbd6ff00091bf18990549ee40cae27e6b94e419006b0ac |
|
MD5 | e4385a8499a9c8bcc6ff5b2f649d864b |
|
BLAKE2b-256 | c80609c3f9a0bc169eb0d3f0284c401829e06741d9c331157e84de9958c2568c |