<s> """<STR_LIT>""" <EOL> from tvtk . api import tvtk <EOL> from tvtk . array_handler import get_vtk_array_type <EOL> from tvtk . common import is_old_pipeline <EOL> from numpy import array , ogrid , sin , ravel <EOL> from mayavi . scripts import mayavi2 <EOL> dims = array ( ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ) <EOL> vol = array ( ( - <NUM_LIT> , <NUM_LIT:5> , - <NUM_LIT:5> , <NUM_LIT:5> , - <NUM_LIT:5> , <NUM_LIT:5> ) ) <EOL> origin = vol [ : : <NUM_LIT:2> ] <EOL> spacing = ( vol [ <NUM_LIT:1> : : <NUM_LIT:2> ] - origin ) / ( dims - <NUM_LIT:1> ) <EOL> xmin , xmax , ymin , ymax , zmin , zmax = vol <EOL> x , y , z = ogrid [ xmin : xmax : dims [ <NUM_LIT:0> ] * <NUM_LIT> , <EOL> ymin : ymax : dims [ <NUM_LIT:1> ] * <NUM_LIT> , <EOL> zmin : zmax : dims [ <NUM_LIT:2> ] * <NUM_LIT> ] <EOL> x , y , z = [ t . astype ( '<STR_LIT:f>' ) for t in ( x , y , z ) ] <EOL> scalars = sin ( x * y * z ) / ( x * y * z ) <EOL> spoints = tvtk . StructuredPoints ( origin = origin , spacing = spacing , <EOL> dimensions = dims ) <EOL> s = scalars . transpose ( ) . copy ( ) <EOL> spoints . point_data . scalars = ravel ( s ) <EOL> spoints . point_data . scalars . name = '<STR_LIT>' <EOL> if is_old_pipeline ( ) : <EOL> spoints . scalar_type = get_vtk_array_type ( s . dtype ) <EOL> @ mayavi2 . standalone <EOL> def view ( ) : <EOL> from mayavi . sources . vtk_data_source import VTKDataSource <EOL> from mayavi . modules . outline import Outline <EOL> from mayavi . modules . image_plane_widget import ImagePlaneWidget <EOL> mayavi . new_scene ( ) <EOL> src = VTKDataSource ( data = spoints ) <EOL> mayavi . add_source ( src ) <EOL> mayavi . add_module ( Outline ( ) ) <EOL> mayavi . add_module ( ImagePlaneWidget ( ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> view ( ) </s>
