mayavi question

8 views
Skip to first unread message

Francois

unread,
Sep 17, 2009, 5:24:11 PM9/17/09
to APAM Python Users
Hi all,

in a 3d plot, I would like to include a square image with 'imshow'.
Does anybody know if I can decide its position and orientation in
space ?

thanks

Ethan Coon

unread,
Sep 17, 2009, 8:09:05 PM9/17/09
to apam-pyt...@googlegroups.com
I believe the mlab features in mayavi2 are designed to emulate the
matplotlib functions of the same name. So I suspect (but can't
guarantee) that your answer would be via the "extent" keyword...

mlab.imshow(imagearray, extent=[xmin, xmax, ymin, ymax])

Ethan

--
-------------------------------------------
Ethan Coon
DOE CSGF - Graduate Student
Dept. Applied Physics & Applied Mathematics
Columbia University
212-854-0415

http://www.ldeo.columbia.edu/~ecoon/
-------------------------------------------


francois monard

unread,
Sep 17, 2009, 8:20:33 PM9/17/09
to apam-pyt...@googlegroups.com
I found the right way to do it. 
You have to use the mlab.mesh function. Each point of the image is given by 3 coordinates and the image as a function on this set of coordinates...
--
------------------------------------------------------------
Francois Monard
------------------------------------------------------------

Ethan Coon

unread,
Sep 17, 2009, 8:23:00 PM9/17/09
to apam-pyt...@googlegroups.com
Cool, I'm curious to see your result if you don't mind sharing...

Ethan

francois monard

unread,
Sep 17, 2009, 11:40:40 PM9/17/09
to apam-pyt...@googlegroups.com
sure, I'll send a picture tomorrow

francois monard

unread,
Sep 18, 2009, 12:58:18 PM9/18/09
to apam-pyt...@googlegroups.com
as I said last night, heres a picture.
In the center, 3d mickey is an attenuation map for the transport equation, displayed with 'contour3d'. The images around it are X-ray CT images of this map ( ideally :) ) along directions corresponding to the orientation of these planes. I used 'mesh' in order to visualize these planes.
snapshot.png

Ethan Coon

unread,
Sep 18, 2009, 3:27:31 PM9/18/09
to apam-pyt...@googlegroups.com
Very cool. I'm always amazed at the power of mayavi/vtk :)

Ethan

Reply all
Reply to author
Forward
0 new messages