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
Hashes for tunnelvision-0.3.2-py3-none-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63c9482c712c2cea71e917272184dcf08c6bdb8d3a60d5d80f9fcf16a9da36a3 |
|
MD5 | ee3c9e08400928107e6c45f69f262d22 |
|
BLAKE2b-256 | dd82f59754f827de5cbdaabebd19aa8c655b3c04185370052c741f63c1ce74a6 |
Hashes for tunnelvision-0.3.2-py3-none-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1e38b22b8d93a00af56efcb712c85ac522e61e2857dfbb6f9d8ed36ca2aff05 |
|
MD5 | 2fdf6a7334f9bc5fdea8eaad45bfb9be |
|
BLAKE2b-256 | 487a6bb568ff5b3c9207daa55b9847d059e7ccbecca2ce29a39825ca54ec5055 |
Hashes for tunnelvision-0.3.2-py3-none-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e805f35a2b974e44a72208b97fb11e9529099e0f1eb4000fb500150bc2c56721 |
|
MD5 | d74bc51ebc6be4d313815d93744494aa |
|
BLAKE2b-256 | f35ee7c0f870f44cd2eb8f278c7186a37512312f3c6867ffe0486d6cb789d719 |