-
Notifications
You must be signed in to change notification settings - Fork 4
Mesh overlays #4
Comments
@choldgraf, @larsoner from the ipyvolume issue I see that there is no transparency settings available for the meshes in ipyvolume, so what would you suggest me to do? It seems like three.js has this feature, so should I try to make changes on the JavaScript side? After this I plan to display activity patterns as part of the transparent mesh. |
Can you read this comment about ShaderMaterial? In particular:
widgetti/ipyvolume#132 (comment) It sounds like it should be possible already. |
Ok, it should be possible according to the code, but for some reason I couldn't find |
In theory doing |
I think I have error with |
Ok, it works now and I have |
ShaderMaterial objects are exposed by ipyvolume, it is working. Concerning overlays, which shape should they be? Should it be another cortex, on top of the given one? I suppose that volume of a transparent cortex should be enlarged so it would fit a non-transparent one. |
This seems to be a common sentiment after fixing these
Yes, use the same
No it shouldn't need to be. There are other ways to solve the problem if we need to, but let's see if rendering order (creating the opaque underlying mesh before creating any translucent overlays) already takes care of it. |
From what I find on the internet, three.js renders objects based on their distance from the camera, so closer ones will be rendered first, I think I will need to change renderer properties, so it will render the object depending on the time when objects were added to the scene, e. g. first to add - first to render. |
Don't think too hard about what might be done, try things first. In other words, see if adding the underlying mesh first and overlay second works. Regardless of outcome, see if adding the overlay first then the underlying mesh second works. Hopefully one does. If it does not, we can think about a solution. But let's make sure there is a problem first. |
Yes, I have tried this scenario and it doesn't work. I have added one mesh, than another one transparent mesh (I changed material properties for this). As an outcome I obtained two brain meshes, one on top of another, but no transparency. I have tried to change material attribute |
See how we do it with maplotlib backend by fusing rgb colors.
|
@agramfort If it is possible, could you share a link? Because I am not sure where to look for it. |
This is possible (we don't even need a proof of concept to know) but I don't think it's worth pursuing unless "the right way" proves too difficult. It should really be doable in WebGL directly. As we want to add labels and so forth the do-color-mixing-ourselves approach will become untenable. |
I ran into some folks last week who were working on a threejs multi-band 3-D viewer...I wonder if that could inform some of the color blending work here: https://github.com/imaging-tools/ivvv |
@larsoner, @choldgraf I have created an example of 3d plot, where I have one simple brain mesh, and I have transparent overlay, where some vertices are red and blue. Is it what you expect to obtain by using mesh overlays? |
can you share screenshots?
|
That looks right! Next would be to show the activation map (with mne colormap) like in my gist |
looks beautiful @OlehKSS ! |
Add mesh overlays. For the implementation of overlays transparent mesh might be needed, it is possible that there is no such function in ipyvolume project, so we might need to make a pull request in it as well.
Example from GSOC wiki page.
Example with the data usage for showing activity as color-map.
Related ipyvolume issue
The text was updated successfully, but these errors were encountered: