Open niks2060 opened 5 years ago
Nice work! Looks like you're on the right track! The best way to fold this into the app is to add support for a new surface format, one that takes in regular volumetric data. Look at js/surface/surface.js. Near the top of the file, where it lists the supports surface formats (e.g., surface-gifti.js). Add a new one.
Add, for example, surface-generate.js. Look in the other surface formats (surface-gifti.js, surface-mango.js, etc) and add the same functions (e.g., readData(), getPointData(), etc) to your surface-generate.js. Also be sure to add isThisFormat() and include it in papaya.surface.Surface.findSurfaceType() so that it knows to call your surface generator.
So instead of surface-generate.js reading and parsing a surface data file, it would read a volumetric data file and convert it to surface data. But the output would be the same, surface points and triangles. papaya.surface.Surface.prototype.generateNormals() will take are of the normals.
Let me know if you hit any snags.
Thanks, Martinez,
I will do the same as you have suggested but what I am not sure of the volumetric data that is needed I am trying to work on the this.volume.imageData.data
as the input from volumetric data.
Hi Martin,
I am trying to implement marching cubes for generating volume but i am not sure how I can get it. I have tried following code in surface.js