-
Notifications
You must be signed in to change notification settings - Fork 1
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
I want to know some functions of handling received data #3
Comments
Hi, I'm not sure what you mean by "the model", you mean the 3D rendering itself, or the underlying in-memory in-browser dataset used to render the 3D model? It's a while since I worked on this, but what happens in broad terms is this:
So there's mainly 3 layers:
Hope this helps |
Hi! thank you for your reply,I understand.but I want to know something else,when the client receives the isovalues.what is the next? which function perform next? I want to learn your project to build my demo which just shows 3D. I got to know that your server how to handle the datasets.but I do not know the client how to do this,I need't to know the basic principle of the rendering. I just hope you could tell me something about your project,for example some functions code or articles. thank you very much! haha |
Aha, check out the angular view controller: The logic for loading a list of datasets, + what is done when the dataset is received is there. Check the For the GLSL code, if you search the repo for .glsl you'll get the results. Here's what is done Real Time Volume Graphics is a good resource on this, but you could also just search up some blog posts on ray casting and basic 3D stuff like lighting, shadows etc. If you're at a university you can look up papers on it and implement those. You do need some existing knowledge to understand this. Like, how to get the data to the shaders, what will be in your vertex shaders, fragment shaders, lighting, some simple 3D vector math, looking up values from 2D / 3D arrays as textures in shaders, light / shadow compositing and so on. If none of this makes sense to you right now you'll probably need to read up quite a bit. As for finding out what happens with code, it'll probably be more helpful for you to simply download and run my code, and use the chrome debugger and step through to the code, then you can see exactly what happens. |
I will read your reply carefully,thank you for your help indeed; |
Hi! thank you very much. your advice give me a lot of help. recently I have read your code,I'd like to ask you a few questions, if you don't mind.
Could you tell me the reason ? thank you |
Hi, sure
There probably is better ways but this was my first go with websockets. Originally the plan was to run heavier computations on the server and serve the results to the browser so a websocket connection made sense. |
Haha, Your reply is very fast! I am trying to build the 3D model that only depends on JS, not NodeJs. I read the 'volume-dataset.js' file, how to turn the '.dat' file into the theDatasets object. I read the algorithm codedull and dry.Could you recommend some articles or blogs? thank you |
Hi, can't say I know of it other than what you can look up on google. You can try load the .dat file into the browser and run the same routines as is run on the nodejs server. Though you need to read the .ini file because it has the header information with sampling size etc, or you need to specify that manually. The .ini file contains
And this information varies per dataset, if you are to build something you should consider the dataset type etc, and format. That's about all I can say without going into excruciating detail on stuff you'll find just from googling around (which I sadly have no time for :D). What you're trying to do is absolutely possible though good luck! |
Hi, now I have already put the volume-dataset.js on the chrome. haha! when the chrome runs this file, it parses and handles the .dat files those are above 200M, the chrome runs very slowly, that's the reason why you use the Nodejs ? so help me to solve some problems:
thank you very much |
Hi, yes that is why!
1+3)There's only so much you can do as far as creating the isovalues, gradient etc since it is a traversal of a typed 3D array represented as a 1D array. Though, after you have done the traversal, your best bet would be to load it into GPU memory and delete it from regular memory, if you can somehow store all the info in the GPU, as well as query your GPU for information you'd be good to go performance wise. This is why ideally, that kind of processing is written in C/C++ or some other highly performant language, you can achieve similar speed with JS using the typed arrays, but if you're gonna run it in the browser you are going to have worse performance so that is a challenge. TL:DR Do as much as you can on the GPU, it may be tricky and may not be possible, I don't know, but that's probably your best bet. There are in-GPU databases and whatnot existing. If you do manage to find a way I'd be very interested in seeing how you did it! :D |
haha, thank you, You are so friendly, now I am excited to share some results with you:
I am from china, Nice to make friend with you, haha ! |
Hello. It is fun when I see the ones asking for help is putting in effort. Yeah you will run into trouble with the browser regardless... To edit color scheme, look at the transfer function. The transfer function maps isovalues, or permutations of isovalues+gradient magnitude + curvature, or only iso + gmag to color and opacity values. This mapping can be done in many ways, look up academic articles / blog posts for how to do it, there are many ways. If I recall correctly, the premade color schemes are simply saved states of transfer function output from interaction. Good luck! |
Hello! Thank for your reply, I consider using three.js. In your code, What gets the data to the shaders and renders module is some tools, for example, 'glslify', 'twgl.js' and so on. I don't know how much the risk which uses three.js, I think you thought about it when you studied this project. Could you give me some advice? thank you |
Sure, threeJS will enable you to things faster but you'll also lose some low level access, and possibly take a performance hit. glslify basically just allows you to do some importing with glsl, purely a convenience thing. |
Oh, what's the mean of the low level access? ThreeJs takes a performance hit? why? I don't understand this |
Hello, Yeah, I get threeJS in order to make it easily indeed, I read your code. There is a lot of theoretical knowledge, I am a Web developer, It's beyond my ability though I study these carefully, But I really want to make it better, At the same time, I find few persons to do this in the brower, I think it's the future of showing medical image, So I hope we can work together to make it fun, haha ,By the way, Do you know how to import the isovalues in three? or threeJs can't do it? Good luck! |
recently I study the medical 3D brower,I'm excited to find out your project,when the client receive the message,after reading the bufferData,I want to know what are some simply funcitons to construct the model,looking forward to your replay,thank you
The text was updated successfully, but these errors were encountered: