Skip to content

A Python class for plotting many 3D numpy volumes at the same time using Mayavi

Notifications You must be signed in to change notification settings

potpov/3D-multiviewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Multiviewer for 3D volumes

This is a Python class for plotting one or more numpy volumes in multiple windows wrapped into a single view (based on mayavi).

Installation

Use the package manager pip to install mayavi and its dependencies, that's all we need.

pip install mayavi
pip install PyQt5

Usage

You can plot numpy volumes by passing several list of volumes to the class; each list corresponds to an independent subwindow in the view. The following example will plot volume_1 and volume_2 in two separate windows as shown below.

MultiView([volume_1], [volume_2]).show()

alt text

you can create as many windows as you want by adding more and more lists:

MultiView([volume_1], [volume_2], [volume_n]).show()

alt text

you can plot more volumes in a window by simply adding them to a list. The following example plots two volumes in the first windows but you could provide with how many you want, they'll just overlap each other.

MultiView([volume_1, sphere], [volume_2]).show()

alt text

dealing with opacity

when plotting more than one volume in a window the overlapped volumes can result in a fuzzy view. it is possible to specify the opacity of a volume by just passing a tuple (volume, opacity) instead of the volume directly as show below.

MultiView([(big_one, 0.4), sphere], [volume_2]]).show()

alt text

About

A Python class for plotting many 3D numpy volumes at the same time using Mayavi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages