Traitsui + mayavi

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

Traitsui + mayavi

Jan Kurzawski
Hi all,

I am working with mlab and tratsui. Ive managed to display the scene and the sliders(range) in one window but I am wondering if  it is possible to put any parameters not on the bottom (under the scene) but on the left or right. So in example i will have all the booleans on the left, enums on right and slider on the bottom.

Thanks in advance,
John

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Traitsui + mayavi

Jaidev Deshpande



On Wed, Dec 5, 2012 at 2:01 AM, Jan Kurzawski <[hidden email]> wrote:
Hi all,

I am working with mlab and tratsui. Ive managed to display the scene and the sliders(range) in one window but I am wondering if  it is possible to put any parameters not on the bottom (under the scene) but on the left or right. So in example i will have all the booleans on the left, enums on right and slider on the bottom.

Hi,

You can 'Group' traits in the view of the UI.

For instance, when you specify the view of the UI, you can do something like this:

view = View(Group(
                  Group(Item('bool1'), Item('bool2')), # The bools are grouped together
                  Group(Item('scene'), Item('range1'), orientation='vertical',) # This ensures that the scene and the slider are vertically oriented
                  Item('enum'), orientation='horizontal')
                  # So from left to right, there are three children in your layout - the bools, the scene along with the range slider, and the enums.
                  )) 


Thanks in advance,
John

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


HTH
--
JD

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Traitsui + mayavi

Jan Kurzawski
Hi,

Thanks a lot that actually worked! I also used HSplit, VSplit and Hgroup.


Best,
Jan

Wiadomość napisana przez Jaidev Deshpande <[hidden email]> w dniu 4 gru 2012, o godz. 22:06:




On Wed, Dec 5, 2012 at 2:01 AM, Jan Kurzawski <[hidden email]> wrote:
Hi all,

I am working with mlab and tratsui. Ive managed to display the scene and the sliders(range) in one window but I am wondering if  it is possible to put any parameters not on the bottom (under the scene) but on the left or right. So in example i will have all the booleans on the left, enums on right and slider on the bottom.

Hi,

You can 'Group' traits in the view of the UI.

For instance, when you specify the view of the UI, you can do something like this:

view = View(Group(
                  Group(Item('bool1'), Item('bool2')), # The bools are grouped together
                  Group(Item('scene'), Item('range1'), orientation='vertical',) # This ensures that the scene and the slider are vertically oriented
                  Item('enum'), orientation='horizontal')
                  # So from left to right, there are three children in your layout - the bools, the scene along with the range slider, and the enums.
                  )) 


Thanks in advance,
John

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


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


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Traitsui + mayavi

Jaidev Deshpande



On Wed, Dec 5, 2012 at 3:45 AM, Jan Kurzawski <[hidden email]> wrote:
Hi,

Thanks a lot that actually worked!

 
I also used HSplit, VSplit and Hgroup.

Oh! I should have mentioned them before. Forgot about those ...! 


Best,
Jan

Wiadomość napisana przez Jaidev Deshpande <[hidden email]> w dniu 4 gru 2012, o godz. 22:06:




On Wed, Dec 5, 2012 at 2:01 AM, Jan Kurzawski <[hidden email]> wrote:
Hi all,

I am working with mlab and tratsui. Ive managed to display the scene and the sliders(range) in one window but I am wondering if  it is possible to put any parameters not on the bottom (under the scene) but on the left or right. So in example i will have all the booleans on the left, enums on right and slider on the bottom.

Hi,

You can 'Group' traits in the view of the UI.

For instance, when you specify the view of the UI, you can do something like this:

view = View(Group(
                  Group(Item('bool1'), Item('bool2')), # The bools are grouped together
                  Group(Item('scene'), Item('range1'), orientation='vertical',) # This ensures that the scene and the slider are vertically oriented
                  Item('enum'), orientation='horizontal')
                  # So from left to right, there are three children in your layout - the bools, the scene along with the range slider, and the enums.
                  )) 


Thanks in advance,
John

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


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


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




--
JD

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Traitsui + mayavi

Jan Kurzawski
Hi,

I have one last question about traitsui but i think that it is impossible to do. I have added two image_plane_widgets

image_plane_widget = self.scene.mlab.pipeline.image_plane_widget(iso_surface,
                            plane_orientation='x_axes',name='CutX',
                            slice_index=10,
                        )        
image_plane_widget1= self.scene.mlab.pipeline.image_plane_widget(iso_surface,
                            plane_orientation='y_axes',name='CutY',
                            slice_index=10,
                        )


and i want to do 2 sliders that will change their positions seperately. The only solution i came up is to change the value of slice_index and both of them are changing at the same time becouse in both the paremeter name is the same -> slice_index

self.sync_trait('slice_index',image_plane_widget.ipw)
self.sync_trait('slice_index',image_plane_widget1.ipw)

I cant change the name of the parameter given by mayavi.. so is it really impossible to do?


Thanks!

Wiadomość napisana przez Jaidev Deshpande <[hidden email]> w dniu 4 gru 2012, o godz. 23:20:




On Wed, Dec 5, 2012 at 3:45 AM, Jan Kurzawski <[hidden email]> wrote:
Hi,

Thanks a lot that actually worked!

 
I also used HSplit, VSplit and Hgroup.

Oh! I should have mentioned them before. Forgot about those ...! 


Best,
Jan

Wiadomość napisana przez Jaidev Deshpande <[hidden email]> w dniu 4 gru 2012, o godz. 22:06:




On Wed, Dec 5, 2012 at 2:01 AM, Jan Kurzawski <[hidden email]> wrote:
Hi all,

I am working with mlab and tratsui. Ive managed to display the scene and the sliders(range) in one window but I am wondering if  it is possible to put any parameters not on the bottom (under the scene) but on the left or right. So in example i will have all the booleans on the left, enums on right and slider on the bottom.

Hi,

You can 'Group' traits in the view of the UI.

For instance, when you specify the view of the UI, you can do something like this:

view = View(Group(
                  Group(Item('bool1'), Item('bool2')), # The bools are grouped together
                  Group(Item('scene'), Item('range1'), orientation='vertical',) # This ensures that the scene and the slider are vertically oriented
                  Item('enum'), orientation='horizontal')
                  # So from left to right, there are three children in your layout - the bools, the scene along with the range slider, and the enums.
                  )) 


Thanks in advance,
John

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


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


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




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


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Traitsui + mayavi

Gael Varoquaux
On Wed, Dec 05, 2012 at 02:11:07AM +0100, Jan Kurzawski wrote:
> and i want to do 2 sliders that will change their positions seperately. The
> only solution i came up is to change the value of slice_index and both of them
> are changing at the same time becouse in both the paremeter name is the same ->
> slice_index

> self.sync_trait('slice_index',image_plane_widget.ipw)
> self.sync_trait('slice_index',image_plane_widget1.ipw)

> I cant change the name of the parameter given by mayavi.. so is it really
> impossible to do?

Check out the docstring of sync_trait: you can specify an optional
'alias' string to have different names of the traits synchronized between
the source and the target objects.

HTH,

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Traitsui + mayavi

Jan Kurzawski
Thanks for help,

Could You give me any simple example? I am not sure if i understand it.

Best,
Jan
Wiadomość napisana przez Gael Varoquaux <[hidden email]> w dniu 5 gru 2012, o godz. 06:57:

> On Wed, Dec 05, 2012 at 02:11:07AM +0100, Jan Kurzawski wrote:
>> and i want to do 2 sliders that will change their positions seperately. The
>> only solution i came up is to change the value of slice_index and both of them
>> are changing at the same time becouse in both the paremeter name is the same ->
>> slice_index
>
>> self.sync_trait('slice_index',image_plane_widget.ipw)
>> self.sync_trait('slice_index',image_plane_widget1.ipw)
>
>> I cant change the name of the parameter given by mayavi.. so is it really
>> impossible to do?
>
> Check out the docstring of sync_trait: you can specify an optional
> 'alias' string to have different names of the traits synchronized between
> the source and the target objects.
>
> HTH,
>
> Gaël
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev

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