Skip to main content

View volumetric images in Python 🧠

Project description

niftiview_logo_transparent_small

The easiest way to view volumetric images in Python 👩‍💻 Install it via pip install niftiview!

niftiview stands behind

  • NiftiView, the viewer app with the cutest desktop icon 🧠 Download it here!
  • NiftiWidget, a widget for interactive viewing in Jupyter 👩‍💻🧠 Install it via pip install niftiwidget!

Usage 💡

Single images can be shown via NiftiImage

from niftiview import TEMPLATES, NiftiImage

nii = NiftiImage(TEMPLATES['ch2'])
# nii = NiftiImage('/path/to/your/nifti.nii.gz')
im = nii.get_image()
im.show()

niftiimage

NiftiImageGrid can display multiple images in a nice grid layout

from niftiview import TEMPLATES, NiftiImageGrid

niigrid = NiftiImageGrid([TEMPLATES['ch2'], TEMPLATES['T1']])
# niigrid = NiftiImageGrid(['/path/to/your/nifti1.nii.gz', 
#                           '/path/to/your/nifti2.nii.gz'])
im = niigrid.get_image()
im.show()

niftigrid

Behind the scenes, niftiview uses three main classes that build on each other

  • NiftiCore: Puts image slices of the 3D image in a 2D numpy.ndarray...
  • NiftiImage: ...applies a colormap to the array, converts it to a PIL.Image and adds overlays...
  • NiftiImageGrid: ...puts the images in a grid

To fully understand how to use niftiview, study the example notebooks 🧑‍🏫

niftiview-cli 🖥️

pip install niftiview also installs the command line utility that given filepath(s) or a filepattern...

niftiview-cli -i /path/to/niftis/*.nii.gz -o /path/to/output/folder --gif

...saves PNGs or GIFs. Take a look at all its possible options via niftiview-cli --help!

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

niftiview-0.1.1.tar.gz (16.3 MB view details)

Uploaded Source

Built Distribution

niftiview-0.1.1-py3-none-any.whl (16.3 MB view details)

Uploaded Python 3

File details

Details for the file niftiview-0.1.1.tar.gz.

File metadata

  • Download URL: niftiview-0.1.1.tar.gz
  • Upload date:
  • Size: 16.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.11.9 Linux/5.15.0-56-generic

File hashes

Hashes for niftiview-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b2081d8dfc095e10813f15f67233ced86a94318cc93afa72f1f51e0383a4d8c2
MD5 36516bb8da03e96b3cc0466e5d62e9ac
BLAKE2b-256 43aab6ebc7bd53b119ca313c27f75709ba4537c409efc13ff2bb4d99756c760c

See more details on using hashes here.

File details

Details for the file niftiview-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: niftiview-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.11.9 Linux/5.15.0-56-generic

File hashes

Hashes for niftiview-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d589ddc6fbf7d9de95a67ffe40216823d69d85953999a20875e8cba86aa2dfb4
MD5 0368cc6d06809c6d6f3857c81687597a
BLAKE2b-256 c8df6a9fdc589a23904a641cc8bbbecbb5a4e20cb5ca66c093332327f8aff921

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page