Skip to content

Commit

Permalink
ADD axisInfo field to the config file
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanlurie committed May 1, 2017
1 parent 0206173 commit 28bf1ef
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 19 deletions.
12 changes: 6 additions & 6 deletions build/shadernavigator/shadernavigator.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/shadernavigator/shadernavigator.js.map

Large diffs are not rendered by default.

39 changes: 37 additions & 2 deletions readme.md
Expand Up @@ -119,5 +119,40 @@ Setting URL arguments is not mandatory (and can actually be quite cumbersome), m
# Run
Run a web server in the root directory and open `ShaderNavigator/index.html`.

# TODO
...
# Config file
## axisInfo
This group is mandatory and give some important information about the three axis. By default, we consider the original dataset has been enlarged or padded to fit a power of 2 size (required for zooming). The information about the original size, the enlarged size and the offset are essential to build a bridge between multiple visualization platforms, for example from ShaderNavigator to Atelier3D (where data are not enlarged).
The three axis **x**, **y** and **z** from the internal 3D space do not necessary respect the **x**, **y** and **z** for the original data and they may even not be called so in the original dataset. Still, having named axes usually matters to the user.


```javascript
"axisInfo": {
"x": { // "x" from the webGL environment
"name": "sagittal", // name of this axis in the original dataset
"originalSize": 6572, // size of the original dataset along this axis, before being extended to a power of 2 size
"offset": 810, // offset applied at the beginning of the axis, if extended (can be 0)
"finalSize": 8192, // power of 2 size (can be the same as originalSize if already pow of 2)
"minName": "left", // name of the min bound of the axis
"maxName": "right", // name of the max bound of the axis
"reversed": true // should we count from 0->8191 (false) or from 8191->0 (true)
},
"y": {
"name": "coronal",
"originalSize": 7404,
"offset": 0,
"finalSize": 8192,
"minName": "posterior",
"maxName": "anterior",
"reversed": false
},
"z": {
"name": "axial",
"originalSize": 5711,
"offset": 1240,
"finalSize": 8192,
"minName": "inferior",
"maxName": "superior",
"reversed": true
}
},
```
14 changes: 9 additions & 5 deletions src/GuiController.js
Expand Up @@ -93,10 +93,14 @@ class GuiController{
document.getElementById('Resolution').readOnly = true;
document.getElementById("Resolution").parentElement.style["margin-top"] = "0px";

// multiplane position
// multiplane position (unit x, y, z)
this._mainPanel.addText("Position", "", function(){} );
this._mainPanel.overrideStyle("Position", "text-align", "center");

// mutiplane position voxel (to match A3D slices index)
this._mainPanel.addText("Position voxel", "", function(){} );
this._mainPanel.overrideStyle("Position voxel", "text-align", "center");

// multiplane rotation
this._mainPanel.addText("Rotation", "", function(){} );
this._mainPanel.overrideStyle("Rotation", "margin-top", "0px");
Expand Down Expand Up @@ -237,7 +241,7 @@ class GuiController{
this._annotationPanel.addDropDown("Annotations", [],
function( dropdownObj ){
var annotation = that._annotationCollection.getAnnotation( dropdownObj.value );

if(annotation){
that._displayAnnotInfo( annotation );
}
Expand All @@ -251,11 +255,11 @@ class GuiController{
var dropdownObj = that._annotationPanel.getControl("Annotations");
dropdownObj.addItem(name);
console.log( dropdownObj );

//dropdownObj.setValue(name);

var annotation = that._annotationCollection.getAnnotation( name );

if(annotation){
that._displayAnnotInfo( annotation );
}
Expand Down
10 changes: 5 additions & 5 deletions src/QuadScene.js
Expand Up @@ -643,7 +643,7 @@ class QuadScene{
}
that._planeManager.updateUniforms();
//that._render();

that._guiController.updateMultiplaneUI( that.getMultiplaneContainerInfo() );
});

// callback def: regular rotation (using R key)
Expand All @@ -663,7 +663,7 @@ class QuadScene{
}
//that._planeManager.updateUniforms();
that.refreshUniforms();

that._guiController.updateMultiplaneUI( that.getMultiplaneContainerInfo() );
});

// callback def: transverse rotation (using T key)
Expand All @@ -688,7 +688,7 @@ class QuadScene{
}
//that._planeManager.updateUniforms();
that.refreshUniforms();

that._guiController.updateMultiplaneUI( that.getMultiplaneContainerInfo() );
});

// callback def: arrow down
Expand All @@ -710,7 +710,7 @@ class QuadScene{
}
//that._planeManager.updateUniforms();
that.refreshUniforms();

that._guiController.updateMultiplaneUI( that.getMultiplaneContainerInfo() );
});

// callback def: arrow up
Expand All @@ -732,7 +732,7 @@ class QuadScene{
}
//that._planeManager.updateUniforms();
that.refreshUniforms();

that._guiController.updateMultiplaneUI( that.getMultiplaneContainerInfo() );
});

this._quadViewInteraction.onDonePlaying(function(){
Expand Down

0 comments on commit 28bf1ef

Please sign in to comment.