Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control menu help #321

Merged
merged 6 commits into from
Mar 15, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 14 additions & 5 deletions cortex/webgl/resources/js/mriview.js
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,13 @@ var mriview = (function(module) {
list = [this.ui._desc,
this.ui._desc.camera._desc,
this.ui._desc.sliceplanes._desc,
this.ui._desc.sliceplanes._desc.move._desc,
this.ui._desc.surface.S1._desc]
this.ui._desc.sliceplanes._desc.move._desc]

// add surface items to list
surface_names = Object.keys(this.ui._desc.surface)
.filter((key) => key[0] != '_')
.forEach((key) => list.push(this.ui._desc.surface[key]._desc))

for (var i = 0; i < list.length; i++){
for (var name in list[i]){
if ('help' in list[i][name]){
Expand All @@ -994,7 +999,9 @@ var mriview = (function(module) {
}
if ('wheel' in list[i][name]){
new_html += '<tr><td style="text-align: center;">'
var modKeys = list[i][name]['modKeys'].substring(list[i][name]['modKeys'].length - 3)
var modKeys = list[i][name]['modKeys']
modKeys = modKeys.map((modKey) => modKey.substring(0, modKey.length - 3))
modKyes = modKeys.join(' + ')
new_html += modKeys + ' + wheel </td><td>' + diplay_name + '</td></tr>'
}
}
Expand All @@ -1008,8 +1015,10 @@ var mriview = (function(module) {
}
_show_help = !_show_help;
}.bind(this);
cam_ui.add({
helpmenu: {action:helpmenu, key:'h', help:'Toggle this help'},

var help_ui = this.ui.addFolder("help", true)
help_ui.add({
shortcuts: {action:helpmenu, key:'h', help:'Toggle this help'},
});

var _hidelabels = false;
Expand Down
3 changes: 2 additions & 1 deletion cortex/webgl/resources/js/mriview_surface.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,8 @@ var mriview = (function(module) {
};
module.Surface.prototype.toggleOpacity = function() {
let newValue = 1 - Math.round(this.uniforms.dataAlpha.value)
viewer.ui.set('surface.S1.opacity', newValue)
surface = Object.keys(viewer.ui._desc.surface).filter((key) => key[0] != '_')[0]
viewer.ui.set('surface.' + surface + '.opacity', newValue)
viewer.schedule();
};
module.Surface.prototype.setLayers = function(val) {
Expand Down
30 changes: 20 additions & 10 deletions docs/userguide/webgl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,26 @@ Keyboard Shortcuts

There are many keyboard shortcuts that allow for more fluid interaction with the WebGL viewer. A complete list of keyboard shortcuts and also be displayed in the viewer by pressing the **h** key.

=== ====================================
Key Action
=== ====================================
f flatten brain
i inflate brain
r fold brain into original coordinates
l toggle labels
h toggle keyboard shortcut overview
+/- switch between datasets
=== ====================================
=========== ====================================
Key Action
=========== ====================================
f flatten brain
i inflate brain
r fold brain into original coordinates
l toggle labels
h toggle keyboard shortcut overview
+/- switch between datasets
e Toggle X slice
d Toggle Y slice
c Toggle Z slice
q/w Switch Between X slices
a/s Switch Between Y slices
z/x Switch Between Z slices
o Toggle Data Opacity
L Toggle Left Hemisphere
R Toggle Right Hemisphere
alt + wheel Change Cortical Depth
=========== ====================================


View Controls
Expand Down