help scripting to export figures as jpg...

Questions about Anatomist manipulation

Moderators: denghien, riviere

User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: help scripting to export figures as jpg...

Post by riviere »

Hi Sylvain,
Negative color values are not valid, I'm not sure what it will do... For fusions the "neutral" color is normally white (100, 100, 100).
To have transparency, you can specify RGBA colors, with 4 values, the 4th being opacity, and use the option color_mode='RGBA' in setColors:

Code: Select all

p.setColors(colors=[100,0,0, 50]*20+[0,100,0, 80]*20+[0,0,100, 100]*20, color_mode='RGBA')
Denis
SylvainT
Posts: 73
Joined: Mon Feb 13, 2006 6:37 pm
Location: INT, Marseille, France

Re: help scripting to export figures as jpg...

Post by SylvainT »

riviere wrote:Hi Sylvain,
Negative color values are not valid, I'm not sure what it will do... For fusions the "neutral" color is normally white (100, 100, 100).
To have transparency, you can specify RGBA colors, with 4 values, the 4th being opacity, and use the option color_mode='RGBA' in setColors:

Code: Select all

p.setColors(colors=[100,0,0, 50]*20+[0,100,0, 80]*20+[0,0,100, 100]*20, color_mode='RGBA')
Denis
Thanks Denis!

But that does not seem to do what I'm looking for... I think it's because I'm working with a fusion object (a textured mesh)... What I'd like to have is this:
- for some value of the texture, the mesh is visible (and let's say, it's all red)
- for some other value of the texture, the mesh is invisible (transparant)

I've just played with the opacity of the mesh and the color palette of the texture (as you described), but I cannot find a combination that does what I want properly... Any idea?

Cheers,

Sylvain
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: help scripting to export figures as jpg...

Post by riviere »

Hi,
It's because the default texture mapping mode is modulating the mesh color with the texture color, not replacing it.
Try setting the fusion texturing mode to replace mode:

Code: Select all

a.execute('TexturingParams', objects=[fusion], mode='replace')
Denis
Post Reply