Reconstructed the app to make things more reusable:
boxplot.js - Box plot code from bunny.js
brain.js - A reusable class for plotting brain surfaces, that attaches to a given div tag.
The structure of the app is:
brain.js takes an element ID and a callback function.
It draws itself within the given element.
When clicked, it calls back to the given function with the mesh that was clicked.
boxplot.js is a callback function that receives a mesh (and an element ID where it should draw itself).
index.html uses angular.js to auto-update the title of the mesh clicked, instantiates the "navigator" brain, and attaches it to the boxplot.js callback function.
Now, to change the plot that's displayed on click, all one has to do is:
Create a new callback function.
Tweak the index.html code to point to that callback.
I have verified that clicking on the "navigation" brain can allow one to display a second brain that shows, for example, resting state correlations. I say: VERY COOL :+1:
Reconstructed the app to make things more reusable:
boxplot.js
- Box plot code frombunny.js
brain.js
- A reusable class for plotting brain surfaces, that attaches to a givendiv
tag.The structure of the app is:
brain.js
takes an element ID and a callback function.boxplot.js
is a callback function that receives a mesh (and an element ID where it should draw itself).index.html
usesangular.js
to auto-update the title of the mesh clicked, instantiates the "navigator" brain, and attaches it to theboxplot.js
callback function.Now, to change the plot that's displayed on click, all one has to do is:
index.html
code to point to that callback.I have verified that clicking on the "navigation" brain can allow one to display a second brain that shows, for example, resting state correlations. I say: VERY COOL :+1:
I have a working demo here, and have attached screen shots below. http://cseweb.ucsd.edu/~bcipolli/roygbiv/