xtk / x Goto Github PK
View Code? Open in Web Editor NEWThe X Toolkit
Home Page: http://www.goXTK.com
License: Other
The X Toolkit
Home Page: http://www.goXTK.com
License: Other
It's sometimes annoying when git status lists all the changed *doc and *-build..
Shall we add it to .gitignore?
Hey Haehn,
Now I'm facing an other issue with the 'new X[classname]' in object.js : at the compilation I've the warning "/home/fabien/X/utils/xtk.js" and after when I try an appli on it (in dev mode it seems to work, but not in compiled mode), it says that it is not a constructor.
the scan direction is not properly taken into account when creating the 3d image array.. this results in sometimes upside down display of volumes etc.
in addition to .FSM files, we should be able to detect freesurfer meshed with the default extensions like .smoothwm .pial etc.
To do so, just add the default extensions in X.loader at the bottom:
/**
* Supported data types by extension.
*
* @enum {Array}
*/
X.loader.extensions = {
// support for the following extensions and the mapping to X.parsers as well
// as some custom flags and the result type
'STL': [X.parserSTL, null, null],
'VTK': [X.parserVTK, null, null],
'TRK': [X.parserTRK, null, null],
'FSM': [X.parserFSM, null, null],
'NRRD': [X.parserNRRD, null, null],
'CRV': [X.parserCRV, null, null],
'MGH': [X.parserMGZ, false, null],
'MGZ': [X.parserMGZ, true, null],
'TXT': [X.parserLUT, null, null],
'LUT': [X.parserLUT, null, null],
'PNG': [X.parserIMAGE, 'png', 'arraybuffer'], // here we use the arraybuffer
// response type
'JPG': [X.parserIMAGE, 'jpeg', 'arraybuffer'],
'JPEG': [X.parserIMAGE, 'jpeg', 'arraybuffer'],
'GIF': [X.parserIMAGE, 'gif', 'arraybuffer']
};
create new baseline images if required
also, try to reduce code duplication (dev vs. build)
no tests yet
Somehow the slicing is not as fast as before. I guess it loops through all slices or something which is not needed.
ce/pretoria/2/chb/users/daniel.haehn/Projects/X/objects/cylinder.js --js /net/pretoria/local_mount/space/pretoria/2/chb/users/daniel.haehn/Projects/X/lib/csg/cube.js --js /net/pretoria/local_mount/space/pretoria/2/chb/users/daniel.haehn/Projects/X/objects/cube.js --warning_level=VERBOSE --compilation_level=ADVANCED_OPTIMIZATIONS
/net/pretoria/local_mount/space/pretoria/2/chb/users/daniel.haehn/Projects/X/visualization/renderer.js:1616: ERROR - variable distanceFromEyeX2 is undeclared
distanceFromEyeX2 = goog.math.Vec3.distance(this._camera.focus(),
^
/net/pretoria/local_mount/space/pretoria/2/chb/users/daniel.haehn/Projects/X/visualization/renderer.js:1621: ERROR - variable distanceFromEyeY is undeclared
distanceFromEyeY = goog.math.Vec3.distance(this._camera.focus(),
^
/net/pretoria/local_mount/space/pretoria/2/chb/users/daniel.haehn/Projects/X/visualization/renderer.js:1625: ERROR - variable distanceFromEyeY2 is undeclared
distanceFromEyeY2 = goog.math.Vec3.distance(this._camera.focus(),
^
/net/pretoria/local_mount/space/pretoria/2/chb/users/daniel.haehn/Projects/X/visualization/renderer.js:1630: ERROR - variable distanceFromEyeZ is undeclared
distanceFromEyeZ = goog.math.Vec3.distance(this._camera.focus(),
^
/net/pretoria/local_mount/space/pretoria/2/chb/users/daniel.haehn/Projects/X/visualization/renderer.js:1634: ERROR - variable distanceFromEyeZ2 is undeclared
distanceFromEyeZ2 = goog.math.Vec3.distance(this._camera.focus(),
^
/net/pretoria/local_mount/space/pretoria/2/chb/users/daniel.haehn/Projects/X/visualization/renderer.js:1637: ERROR - variable lnu is undeclared
lnu = Math.max(distanceFromEyeX, distanceFromEyeY, distanceFromEyeZ,
^
6 error(s), 0 warning(s)
/net/pretoria/local_mount/space/pretoria/2/chb/users/daniel.haehn/Projects/X/lib/closure-library/closure/bin/build/closurebuilder.py: JavaScript compilation failed.
OUTPUT: xtk.js
/net/pretoria/local_mount/space/pretoria/2/chb/users/daniel.haehn/Projects/X/visualization/renderer.js:1616: ERROR - variable distanceFromEyeX2 is undeclared
/net/pretoria/local_mount/space/pretoria/2/chb/users/daniel.haehn/Projects/X/visualization/renderer.js:1621: ERROR - variable distanceFromEyeY is undeclared
/net/pretoria/local_mount/space/pretoria/2/chb/users/daniel.haehn/Projects/X/visualization/renderer.js:1625: ERROR - variable distanceFromEyeY2 is undeclared
/net/pretoria/local_mount/space/pretoria/2/chb/users/daniel.haehn/Projects/X/visualization/renderer.js:1630: ERROR - variable distanceFromEyeZ is undeclared
/net/pretoria/local_mount/space/pretoria/2/chb/users/daniel.haehn/Projects/X/visualization/renderer.js:1634: ERROR - variable distanceFromEyeZ2 is undeclared
/net/pretoria/local_mount/space/pretoria/2/chb/users/daniel.haehn/Projects/X/visualization/renderer.js:1637: ERROR - variable lnu is undeclared
xcode-select: Error: No Xcode folder is set. Run xcode-select -switch <xcode_folder_path> to set the path to the Xcode folder.
Cannot create directory /Testing/Temporary
Cannot create log file: LastSubmit.log
Submit files (using http)
Using HTTP submit method
Drop site:http://cdash.goxtk.com/submit.php?project=xtk
Uploaded: XTKBuild.xml
Submission successful
Error in read script: /chb/users/daniel.haehn/Projects/X/utils/xtk.cmake
Code Compiled
.trk files should be converted to RAS by default
also freesurfer meshes are not in RAS afaik
also, is RAS the right one?
XTK is by default a left-handed coordinate space with the Z axis following the thumb and Y going up
The X.parser.reslice function loops three times right now for all slice directions but could be realized in one loop.
Hey,
I post here because I've no idea of what is to change, but in the 2 sub-renderers classes there is written (at the beginning of the 'render_' methods) :
"// call the update_ method of the superclass
goog.base(this, 'render_', picking, invoked);"
So it says it calls 'update_' but it calls 'render_'. And renderer::render_() method is empty no ?
++
Ricola3D
Hi guys!
First, congratulations for your great job!
I would like to request a specific feature for mobiles. It would be great if XTK would be able to handle the interactions of the finger in a mobile browser.
I have found x3Dom that does the job but I prefer XTK by far for the rendering. It may be reimplemented in a same fashion as x3Dom?
I perhaps can do that by myself by I'm lacking some time...
Thanks,
Laurent.
Hi,
I wonder something at reading the renderer.js file. I may have misunderstood something (particularly because I'm near a "beginner" in JS), so tell me if I'm wrong :
In renderer.js, when we call init() for a render instance, it creates a new camera and a new render, the renderer now listen their events and then it put references to them in the renderer's attributes.
So every init() call creates a new camera and a new interactor, and while the renderer exists it listen each old interactor (I didn't see any unlisten) created so those variables aren't automatically destroyed at the end of init() no ?
"
// .. listen to resetViewEvents
goog.events.listen(interactor, X.event.events.RESETVIEW,
this.resetViewAndRender.bind(this));
// .. listen to hoverEvents
goog.events.listen(interactor, X.event.events.HOVER, this.onHover.bind(this));
"
Doesn't it provoque a memory leak ? Am I right or totaly wrong ?
Cheers
xtk advanced compilation not working
Hey,
It's me again ! I've almost finished my UML (or pseudo UML as it's for javascript and it's not perfectly designed) and I've the feeling than X.indexer and X.parserHelper are unused, it that normal ? DId I miss something ? Indexer is required in object.js but never used.
Here also is a little list of things I found that didn't fit well with UML modeling that you probably done to shorten the code, but just to check if it's well the case :
And finaly a little question : in base.js I found "this._id = window["X.counter"].uniqueId();" but didn't figure out what it was, could you plz tell me where it is defined ?
Sankyu !
Ricola3D
Right now it is not possible to set the object type externally. This can be fixed by just creating a getter/setter for the X.displayable._type property in injects/displayable.js.
Hey Haehn !
Do you remember a few days ago we talked about the copy_ method of XTK's object classes, and more especificaly about the one of object.hs within you intented to copy hierarchy of objects of different types and that didn't work. I've done some researches about it, and like your injection seems to be pre-compilation and Google Closure doens't allow multiple inheritance, I don't see many solutions :
So you've no idea of what's the best.. but for the moment the copying of an X.object doesn't execute and I offered to help to solve that, so what to do ? Give up and only manage homogeneus hierarchies or something harder ?
Would be nice if the update field in cdash actually lists the files which were updated.
might improve the performance!
we need to resize the canvas properly
no global variables in closure.
we could create a counter/unique id as soon as we add object to renderer instead!
to print in the console all the private variables
Right now the X.loader only uses arraybuffers for the X.parserIMAGE and string parsing for all other parsers (even binary). It should be faster to switch everything to arraybuffers.
hello,
how can i disable the mouse events? i want to use very simple mouse events on meshes and slices of a volume and use some ajax-calls there so the integrated events are not needed.
another question: how can i disable the progress bar? i've read it somewhere...
is there any kind of reference where i can see what commands are available?
thanks in advance
must be some css setting which causes the progressbar to not be displayed or only underneath the canvas
This would enable to use a local HTMLFileReader with the same mechanism as loading from URLs.
Hi,
I just discovered your API and its features seem to fit my needs, but earlier in the day i tried to simply load and render an ASCII stl file and nothing appeared in the renderer. I tried many stl files of different size and complexity, and I tried to move my camera in case my object was out of view, but there was no change. I tried the same way/code with a trk file and it did well.
I was testing under Chrome 18.0.1025.162 m, without any server emuled (like Wamp or other) and with opening a local file place in a subfolder.
Here is one of my stl examples, i read it and saw no error for an stl format :
"
SOLID TRI
FACET NORMAL 0.0 0.0 -1.0
OUTER LOOP
VERTEX -1.5 -1.5 1.4
VERTEX 0.0 1.7 1.4
VERTEX 1.5 -1.5 1.4
ENDLOOP
ENDFACET
FACET NORMAL 0.0 0.88148 0.472221
OUTER LOOP
VERTEX -1.5 -1.5 1.4
VERTEX 1.5 -1.5 1.4
VERTEX 0.0 0.0 -1.4
ENDLOOP
ENDFACET
FACET NORMAL -0.876814 -0.411007 0.24954
OUTER LOOP
VERTEX 1.5 -1.5 1.4
VERTEX 0.0 1.7 1.4
VERTEX 0.0 0.0 -1.4
ENDLOOP
ENDFACET
FACET NORMAL 0.876814 -0.411007 0.24954
OUTER LOOP
VERTEX 0.0 1.7 1.4
VERTEX -1.5 -1.5 1.4
VERTEX 0.0 0.0 -1.4
ENDLOOP
ENDFACET
ENDSOLID TRI
"
Thanks to the ones who will look after that !
to print in the console all the private variables
move stuff to fix safari issue in a function "test?" in base.js constructor
unique id counter would be incremented only when object added to the scene/renderer?
Right now, the mouse move events get stopped as soon as the mouse travels outside the canvas/viewport. This is not convenient when zooming f.e. a small 2D renderer with the right mouse click and moving the mouse up.
If possible, mouse outside should not cancel the event. It still has to work properly with multiple renderers so.
The -deps files are not ignored when running
python build.py -so
for example:
...
----- FILE : /Users/d/Projects/projectX/sampleApp/sampleApp-deps.js -----
Line 1, E:0110: Line too long (111 characters).
Line 3, E:0110: Line too long (177 characters).
Found 86 errors, including 0 new errors, in 2 files (0 files OK).
Some of the errors reported by GJsLint may be auto-fixable using the script
fixjsstyle. Please double check any changes it makes and report any bugs. The
script can be run by executing:
fixjsstyle -r /Users/d/Projects/projectX/sampleApp -e /Users/d/Projects/projectX/sampleApp/lib -x /Users/d/Projects/projectX/sampleApp/sampleApp/sampleApp-deps.js --strict
Style checked
-----------------------
Enjoy XTK
Hello,
Everything is in the title, I know I saw you put a link to it somewhere but I'm unable to find it.
Cheers,
Ricola3D
Hey,
I'm back, I've figured my problem and it brought a new question. Just if it is of interest for someone : the setters and getters cannot be called in the source code and then compiled by google closure, it won't work. I think you (Haehn) have figured it out as in renderer3D.js the calls to camera's attributes are not done by the getters/setters but with directly accessing to the attributes "_attributename"
So my new question is : according to the doc, the 2 commands used to define getters and setters (see title) are deprecated and non-standard, so shouldn't we rewrite them with standard methods ?
all those warnings are not a problem and just there because of the lack of the compiler to support mixins
Image viewing tools such as MRICRON, allow you to overlay several images and set color to each image individually. The color schemes can be a simple color or a lookup table. It'd nice for XTK to have the same feature.
When we compile, errors should be in red, warning in orange, etc...
we would add all the object in the scene, count them there. Then we can add a scene to a 2D/3D renderer.
the benefit with this approach-> add n items to 1 scene then 1 scene to n renderers
instead of n objects to n renderers
to make it clear for developers, explain the X.renderer.update_ loading sequence with multiple entries
generate documentation of the displayable objects with injects on the wiki
it would be a great improvement if xtks keyboard events would be seperated in "keydown" "keypress" and "keyup".
a) if you want to do something while one key is pressed and held all the time, the onKey gets fired again and again and renders and renders. that's not a good way to do this regarding the performance, i guess.
b) you could bind another mousevent and unbind it by keyup. this gives it more flexibility
regards
Mhhh... I think everything is in the title !
I was trying to do an UML of XTK to show how it works to my colleagues and noticed there were no link in google closure between Camera and Interactor, while a Camera observes an Interactor. So is it normal that in "camera.js" there is not any require for "X.interactor" while in the "observe()" methode there is a test "instanceof X.interactor" ?
Best wishes,
Ricola3D
Hello Haehn !
I'm currently running the lessons on Firefox 11.0 under Ubuntu (a Wibu distribution installed from Windows), and they don't work. Firefox's console tells me :
Could not create shader program! Xtk.js:265
error uniform 'volumeScalarMax' declared as type 'float' and type 'vec3'
And with testing in local in development mode, it also shows this error & one more before :
goog.structs.Map is not a constructor tracer.js:53
Could not create shader program! renderer.js:868
error uniform 'volumeScalarMax' declared as type 'float' and type 'vec3'
In addition, webGL web examples works well here, so I don't understand why XTK doesn't ?!
Use different template, similar to google closure's documentation?
if a transform or points are not dirty and the objects didn't exist, the bounding box is not recalculated properly.
test
when moving the mouse to the control panel, the main figure becomes invisible.
chrome version 20.0.1096.1 dev
to print in the console all the private variables
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.