Skip to content

Commit

Permalink
Added unit test for volume_slice + generated image
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelle committed Sep 2, 2016
1 parent 3de6208 commit cb25a8e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions docs/source/mayavi/mlab_3d_plotting_functions.rst
Expand Up @@ -165,7 +165,7 @@ module.
described by three 3D arrays giving the ``u``,
``v``, ``w`` components on a grid.

|volume_slice| :func:`volume_slice`
|slice| :func:`volume_slice`
|hack|
Plots an interactive image plane sliced through
volumetric data.
Expand All @@ -188,10 +188,11 @@ module.
.. |flow| image:: generated_images/enthought_mayavi_mlab_flow.jpg
:scale: 50

.. |volume_slice| image:: generated_images/enthought_mayavi_mlab_volume_slice.jpg
.. |slice| image:: generated_images/enthought_mayavi_mlab_volume_slice.jpg
:scale: 50

.. note::

.. note::

Many richer visualizations can be created by assembling data sources
filters and modules. See the
Expand Down
7 changes: 7 additions & 0 deletions mayavi/tests/test_mlab_integration.py
Expand Up @@ -90,6 +90,7 @@ def test_mlab_source(self):
(mlab.pipeline.scalar_field, ),
(mlab.pipeline.scalar_field, mlab.pipeline.image_plane_widget),
(mlab.contour3d, ),
(mlab.volume_slice, ),
(mlab.points3d, ), )
data = np.random.random((3, 3, 3))
for pipeline in pipelines:
Expand Down Expand Up @@ -335,6 +336,12 @@ def test_imshow_colormap(self):
with self.assertTraitChanges(actor, 'pipeline_changed'):
actor.module_manager.scalar_lut_manager.lut_mode = 'jet'

def test_volume_slice(self):
x, y, z = np.ogrid[-5:5:20j, -5:5:20j, -5:5:20j]
scalars = x * x * 0.5 + y * y + z * z * 2.0
ipw = mlab.volume_slice(scalars, plane_orientation='y_axes')
self.assertEqual(ipw.ipw.plane_orientation, 'y_axes')


################################################################################
# class `TestMlabModules`
Expand Down

0 comments on commit cb25a8e

Please sign in to comment.