enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.3k stars 284 forks source link

Artifact, asymetric square in ImagePlaneWidget #1152

Open KestutisMa opened 2 years ago

KestutisMa commented 2 years ago

Hi, For data source I got scalar field (3d) and draw ImagePlaneWidget (for clarity I set texture_interplate = False, also reslice_interpolate = nearest_neighbor, also added GridPlane to view grid):

s = np.zeros((11,11,3), )
s[1,5,1] = .5
s[3,6,1] = .5
s[5,7,1] = .5

s[5, 1,1] = .5
s[6, 3,1] = .5
s[7, 5,1] = .5

src = self.scene.mlab.pipeline.scalar_field(s)
viz = self.scene.mlab.pipeline.image_plane_widget(src, plane_orientation='z_axes',  slice_index=1,  ) 

What I got: not all red squares are simmetric. image What I expect: all symmetric red squares.

I want ImagePlaneWidget element (voxel) be same dimensions as grid shape (symmetric square). But I got different shapes: square - if x or y coordinate is odd, and rectangle - if x or y is even. Where problem could be?

Many thanks!

KestutisMa commented 2 years ago

Plotting random data shows clear shape of pixels (or texels) of ImagePlaneWidget. It is obviously not uniform. Are there any reason for such behavior, performance? image Maybe there other ways to view volumetric data slice interactively?