-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from enthought/feature/misc-volren-ui-knobs
Misc volume viewer features
- Loading branch information
Showing
4 changed files
with
129 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,66 @@ | ||
from enaml.application import schedule | ||
from enaml.layout.api import vbox | ||
from enaml.widgets.api import Container, MainWindow | ||
from enaml.stdlib.slider_transform import FloatTransform | ||
from enaml.widgets.api import (ComboBox, Container, Form, Label, MainWindow, | ||
Notebook, Page, Slider) | ||
from traits_enaml.widgets.enable_canvas import EnableCanvas | ||
|
||
from ensemble.volren.volume_viewer_ui import ( | ||
VolumeViewerClip, VolumeViewerContainer | ||
VolumeViewerClip, VolumeViewerCanvas | ||
) | ||
|
||
|
||
enamldef VolumeViewerWindow(MainWindow): vr_win: | ||
attr viewer | ||
|
||
title = 'Volume Viewer' | ||
initial_size=(800, 900) | ||
initial_size=(800, 800) | ||
|
||
activated :: | ||
schedule(self.send_to_front) | ||
|
||
Container: | ||
constraints = [ | ||
vbox(vv_view, vv_clip), | ||
vbox(vv_view, config_ui), | ||
] | ||
|
||
VolumeViewerContainer: vv_view: | ||
VolumeViewerCanvas: vv_view: | ||
viewer << vr_win.viewer | ||
|
||
VolumeViewerClip: vv_clip: | ||
viewer << vr_win.viewer | ||
Notebook: config_ui: | ||
tab_style = 'preferences' | ||
|
||
Page: | ||
title = 'Transfer function' | ||
closable = False | ||
Container: | ||
EnableCanvas: | ||
component << viewer.ctf_editor | ||
|
||
Page: | ||
title = 'Clipping' | ||
closable = False | ||
VolumeViewerClip: | ||
viewer << vr_win.viewer | ||
|
||
Page: | ||
title = 'Misc' | ||
closable = False | ||
Form: | ||
Label: | ||
text = 'Render Quality:' | ||
ComboBox: | ||
items = ['Default', 'Best', 'Performance'] | ||
index = 0 | ||
selected_item :: | ||
renderer = vr_win.viewer.volume_renderer | ||
renderer.render_quality = self.selected_item.lower() | ||
|
||
Label: | ||
text = 'Volume Alpha:' | ||
Slider: | ||
FloatTransform: | ||
value := viewer.volume_renderer.global_alpha | ||
minimum = 0.0 | ||
maximum = 1.0 | ||
precision = 100 |