GSOC Blog: Weeks 2-3

In this post I would like to share with you an insight on what I was doing during the previous fortnight.

During these two weeks I was working on addition of alpha blending for meshes in Ipyvolume. This is a quite challenging task for several reasons. First of all, three.js library does not support colors with additional alpha channels, it simply ignores the 4th component of the color. In order to avoid this obstacle one should create custom  shaders using GLSL programming language, for more details see page. Hopefully, ipyvolume has own vertex and fragment shaders for meshes implemented. So, I had good starting point. Another challenge is the fact that ipyvolume is built using ipywidgets, and has JavaScript and Python subprojects. Most of the work for solving alpha blending problem was done on JavaScript side, since color manipulations mostly occur there.

I have opened a pull request to the ipyvolume repository. I have done several changes to the code, according to the first code review. I am waiting for my pull request to be merged soon. Nevertheless, I have been working on adding alpha blending to the GSOC project. In order to finish this work I will need to configure my color maps usage in the same way as it is done in MNE-Python.

I have also solved a problem with displaying inflated cortex meshes instead of pialed. The two meshes were overlapping. Additional shift for coordinates of vertices of each mesh was required to avoid it. I also have implemented a small change in the way my project code handles the intensity data. The color of a surface needed to be inverted, so the mesh created in my project will be similar to the mesh created via PySurfer.

Over the next two weeks I am going to go through my first evaluation phase. I hope that my changes to the ipyvolume project will be accepted on the next week. Concerning my project, I will need to add surface normals for the meshes, so the output mesh will look smoother. I am going to finish my addition of alpha blending to the project and close the corresponding task. I also plan to create a separate pull request to the ipyvolume project with code style changes that I have done during my work on alpha blending addition.

See you in two weeks,


Leave a Reply

Your email address will not be published. Required fields are marked *