Skip to main content

3D slice visualization with VTK

Project description

Slice3d

3D slice visualization with VTK.

Installation

pip install vtk-slice3d

Example

import numpy as np
from slice3d import Slice3d

def make_demo_data(nx, ny, nz):
    x = np.linspace(-1, 1, nx)
    y = np.linspace(-1, 1, ny)
    z = np.linspace(-1, 1, nz)
    X, Y, Z = np.meshgrid(x, y, z, indexing='ij')
    data = (np.sin(3*np.pi*X) * np.cos(3*np.pi*Y) +
            np.sin(3*np.pi*Z) +
            np.exp(-(X**2 + Y**2 + Z**2)*4))
    return data.astype(np.float32)

nx, ny, nz = 30, 40, 50
data = make_demo_data(nx, ny, nz)

s = Slice3d(data,win_size=(300,300))
s.show(save_fn='demo.jpg')

Demo Result

demo.jpg

Supported Output Formats

  • 位图(PNG、JPG): 默认 DPI = 96,无法修改
  • 矢量图(PDF、SVG、EPS): 推荐使用 PDF 或 SVG 保存结果

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

vtk_slice3d-0.2.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

vtk_slice3d-0.2.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file vtk_slice3d-0.2.0.tar.gz.

File metadata

  • Download URL: vtk_slice3d-0.2.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for vtk_slice3d-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6c7e702c6d17806fc16bff63530c026b03c7da699c5d315b8b446c6ace1dd962
MD5 0b7e12ae9e47a7f9e41b0055b5c157e8
BLAKE2b-256 fd48dace0ea8539573f2f30467672ed5774ed275c7ab6c8ee104a49b5353be0a

See more details on using hashes here.

File details

Details for the file vtk_slice3d-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: vtk_slice3d-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for vtk_slice3d-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be839fdedf02abf5536afdfc01cfd4e0e43343c052499279bcab4a6b5b453834
MD5 bb791e1d8c1f1a4325538d5d2f2a11cb
BLAKE2b-256 0427441c32fd7da21b7b31ac5d23af006d843772e6b4193cb901500f42ee60f0

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