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(layout='sagittal++', nrows=1)
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. To showcase its versatility, here is a compilation of created GIFs

niceviews

Explore all the available options by running niftiview-cli --help

P.S. If you're interested in creating 🧠 tissue maps like the ones shown at the end of the GIF, check out deepmriprep!

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.2.0.tar.gz (16.3 MB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: niftiview-0.2.0.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.2.0.tar.gz
Algorithm Hash digest
SHA256 298509b51c530039099b75d2d6ef42b86cdc7a04a8e37a4623546a83a3b66d50
MD5 0b4e2d4a361daa4ab98b131b777f976c
BLAKE2b-256 641ff0275f2a40a30c97b49fdfc741200de04946dbd2970ff65ac43ff6d16628

See more details on using hashes here.

File details

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

File metadata

  • Download URL: niftiview-0.2.0-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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c34240f2a2cbd87e02e1a2fde655e73fe7bc5d945223f9d88506665475f9d50
MD5 50e9af519111aae141bc8285d0099c6b
BLAKE2b-256 cdd5080872b44bd06a09b9b8b91a30f7083a06993edbaeeee73b288b0109ff2d

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