[mayavi] a few questions about ImagePlaneWidget and Volume modules...

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[mayavi] a few questions about ImagePlaneWidget and Volume modules...

fred-2
Hi all,

In the attached snapshot of my Traits app, I use CustomGridPlane module.

You can notice that Oz axis is scale (x4).

Is it possible to use ImagePlaneWidget module in this case?

My guess is that the answer is not.

For instance, others *Plane modules have an actor trait that I can
scale. But ImagePlaneWidget does not have an actor trait.


So... right?


Last question.

If I want to add the Volume module, I want its colormap equal to the
colormap used (as Volume module has its own colormap/CTF). In this case,
Set3.

Is it possible? Is there a hack somewhere that converts the colormap
used to the CTF used by Volume module?

Or it's... impossible?

I would like to handle Volume module as others modules (Glyph, Surface,
CustomGridPlane and so on which inherit the colormap from LUT manager)

BTW, can the Volume be "scaled" (same question as for the
ImagePlaneWidget)? I did not look at it yet.



TIA


Cheers,

--
Fred

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

a.png (216K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi] a few questions about ImagePlaneWidget and Volume modules...

Gael Varoquaux
On Fri, Apr 23, 2010 at 09:56:27PM +0200, Fred wrote:

> In the attached snapshot of my Traits app, I use CustomGridPlane module.
>
> You can notice that Oz axis is scale (x4).
>
> Is it possible to use ImagePlaneWidget module in this case?
>
> My guess is that the answer is not.
>
> For instance, others *Plane modules have an actor trait that I can  
> scale. But ImagePlaneWidget does not have an actor trait.


Scale your data: see
http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/example_mri.html,
in particular
src.spacing = [1, 1, 1.5]
src.update_image_data = True

> Is it possible? Is there a hack somewhere that converts the colormap  
> used to the CTF used by Volume module?

> Or it's... impossible?

Not impossible, but you will have to write the code yourself. A hint: the
CTF is piecewise-affine, and so is the matplotlib colormar that was
originaly used to define the Mayavi LUT: look at pl.cm.Set1._segmentdata
and at http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps to
understand this data.

HTH,

Gaƫl
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev