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

how to startup the project #2

Open
hexingyang opened this issue Jul 6, 2017 · 13 comments
Open

how to startup the project #2

hexingyang opened this issue Jul 6, 2017 · 13 comments

Comments

@hexingyang
Copy link

Hi, I feel your project is very good by viewing display on gif. I have download your code. However, I cannot startup it with some errors.

Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.6.2/$injector/modulerr?p0=WebGLVolumeRenderer…ume-Rendering-WebGL-master%2Fclient%2Fbuild%2Fexternals.min.js%3A3%3A30409)
at externals.min.js:3
at externals.min.js:4
at q (externals.min.js:3)
at g (externals.min.js:4)
at db (externals.min.js:4)
at c (externals.min.js:3)
at Mc (externals.min.js:3)
at qe (externals.min.js:3)

Please tell me how to start up it. Looking forward to your reply.

@yngve-sk
Copy link
Owner

yngve-sk commented Jul 6, 2017

Hey, thanks for your good faith haha

I pushed up some quickfixes and wrote some instructions on here:
https://github.com/yngve-sk/Volume-Rendering-WebGL/wiki/Running-a-demo

Following these exact steps works on my Macbook Air.
Let me know if it works for you.

@hexingyang
Copy link
Author

Thank you for your reply! When I did the step 3, the cmd occurred a error
#######
C:\workspace\Volume-Rendering-WebGL-master\server>node index.js
module.js:487
throw err;
^

Error: Cannot find module 'd3'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object. (C:\workspace\Volume-Rendering-WebGL-master\server\src\volume-dataset.js:2:10)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)

How can I reslove it?

@yngve-sk
Copy link
Owner

yngve-sk commented Jul 7, 2017

To me that just looks like you did not install the dependencies, i.e you skipped step 2.
Or you did not pull down the updated version of the repository, so you started on step 1 with the old version (likely because I forgot to include d3 in the package.json).

For clarity, I recoomend you to read up on npm for a minute, all you need is to run npm install in the same directory as package.json and it will install all these dependencies for you.

@hexingyang
Copy link
Author

yes, you are right. I installed it unsuccessfully by some reasons of network. Now I have run the program but the datasets only a hand. I want load my model(some files of dicom and nii).
How can transform my files to the available data(.dat file)? Which tools can I do it?
Looking forward to your reply.

@yngve-sk
Copy link
Owner

yngve-sk commented Jul 10, 2017

Sorry to say but that's an issue separate from my project, if I knew I would tell you though I can guarantee there is probably a not so hard way to convert it to .dat. Quick google search gives this:
https://www.npmjs.com/package/dicom-parser

I.e there are ways you can just read in the dicom file, though you would have to add the logic yourself. If you can make it so that dicom files are parsed with the dicom parser but the format after that.. Int16Array of [iso gmag, iso gmag, iso gmag, ... ,iso gmag] is the same as what's going to the server it should work.

So you can either write some code to load it into the same internal format - see the code to see how it is stored in the code. Or just convert it to a .dat and .ini file. Here is some info about the .dat / .ini formats.

fileformat.pdf

Though if you really just want to visualize your own dataset there are desktop apps that are far more developed than this project as far as volume rendering.

@hexingyang
Copy link
Author

hexingyang commented Jul 17, 2017

Thank s for your information. I have loaded my data in your project.
Now I want to open the project in the Chrome on anther computer. However, it cannot load the 3D image.
And the browser did not to throw any exception. Whether the other computer needs to install the node or npm environment? And then it can load the 3D image?
I failed run the demo on ipad. Is it suitable for ipad?
Looking forward to your reply.

@yngve-sk
Copy link
Owner

Tried it on an iPad that sure is optimistic hehehe.

If you loaded your own data, I take it you added it to the list of datasets, and added your files to the folder and all that. If it is the correct format, and the websocket connection between the client and the server is successful it should be (hopefully) be okay.

The client will fetch the list of available datasets from the server, so if you modify the index.js file to include your dataset. Like if your dataset name is "bighand" just add this line:
'YourDatasetName': new VolumeDataset('./datasets/path-to-file', 1),
, that dataset name should appear in your browser.

You only need node to have a server to serve the dataset, i.e you can serve the dataset from any computer as long as you have a URL to access it (you would need to change the server address and port in the source code for this to work, for example if your domain is www.example.org and you configured node to listen @ port 8001 then you connect to www.example.org:8001).

If you are to run it on an iPad you need enough GPU power on the iPad, I think GPU memory is shared with CPU memory on such devices and an iPad has a few GB of RAM... Maybe it would be more suitable after optimizing the performance some.

The demo that is uploaded here may or may not be working, it is now hardcoded to work at a specific port @ localhost, i.e you run your own server - but if you have a domain (can get one for less than 1$) you could serve the dataset @ the computer.

@hexingyang
Copy link
Author

The error occured on line 57454 in main-conpiled.js. masterContext is null. It looks like ipad cannot run webgl2.
I dont know why your ipad can load the data.

@yngve-sk
Copy link
Owner

Sorry for not being so clear but I didn't say my iPad could load the data. Forgot to mention the really obvious: The iPad may just not have WebGL2, you could try different browsers, chrome / firefox would be more likely to have it but I cannot help you on this.

@hexingyang
Copy link
Author

I have an issue. You use nodejs to calculate gradient and histogram from a dat file. And send the result data to the browser by a request. Why do not you store the result data to a file. When the browser requests a data, nodejs can read data from the file and send it directly. If it is like this, the result data need not occupy internal memory.

@yngve-sk
Copy link
Owner

yngve-sk commented Mar 4, 2018

Hi, yes you are right, you can do that. If it was a server serving the dataset to multiple clients, that kind of caching would probably be the best. However keep in mind this was a university project for just one subject and I have no time to add this atm, though feel free to add it as an option and do a PR.

@hexingyang
Copy link
Author

Thank you for your answer!
Why do you choose nodejs to calculate the data? Can we give the job to browser? All the jobs including reading dat file, calculating histogram and gradient, rendering are finished in browser.
Whether you think the pressure of browser will be improved, or do you have some another thought?

@yngve-sk
Copy link
Owner

yngve-sk commented Mar 5, 2018

Probably, but processing say, a 2GB dataset in the browser at this moment is not ideal! :D + it depends on what you want, then it really is more like a desktop app as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants