Closed OlehKSS closed 6 years ago
I have started to work on API changes. I have noticed that in PySurfer there is a different dictionary that represents mesh orientation and for me it is not obvious how to go from that representation to MNE-like with azimuth and elevation dictionary. Which one should I stick with? How to go from PySurfer angles toward azimuth, elevation representation?
Another question is what should I do with MNE functions, e. g. _limits_to_control_points, that I used previously, should I create a copy of those in GSOC project?
Which one should I stick with? How to go from PySurfer angles toward azimuth, elevation representation?
The important thing is that each entry gives the same view of the brain in both places, so lat
should look from the side (from the left or right depending on hemi). To get what this angle dict (which is for Mayavi) means in IPyvolume I don't know, but you can figure it out using trial and error if you really need to (i.e., for each view, do it in PySurfer, then figure out what you need to do in IPyvolume to make the same view).
@OlehKSS let us know when you'd like some 👀 on this!
Thanks, I am going to publish version for the review soon
Hi, I have moved almost everything from the mne_g3d
to ipysurfer
. For creating a plot and adding activation data ones should use snippet:
brain_plot = Brain(subject, hemi, surface, size=size,
subjects_dir=subjects_dir, title=title,
foreground=foreground)
brain_plot.add_data(data, min=ctrl_pts[0], mid=ctrl_pts[1],
hemi=h, max=ctrl_pts[2], center=center,
colormap=lim_cmap, alpha=alpha)
brain_plot.show()
You can see it in stc.plot_source_estimates
sample function. How should time viewer should be added?
Should it be a part of Brain
class?
No it should be separate:
https://github.com/nipy/PySurfer/blob/master/surfer/viz.py#L3436
Sorry it's not in the API ref, I'm working on adding it but it's a pain.
Ok, thanks. What about color bar visualization, should that function be a part of Brain
class or should it go to the TimeViewer
as well?
colorbar control should be in Brain
Hello, I have finished major changes to the API, now it is ipysurfer
instead of mne_g3d
. The plotting capabilities are the same as they were. You can see usage sample in this file. Could take a look at the proposed changes?
@larsoner @choldgraf Regarding the fact that in a week and a half I will need to submit the final version of my work, what do you think are the most important things to do, besides this pull request and ipyvolume bug #156? As far as I understand, to meet GSOC requirements I should improve read.md
file, so it will contain project description, use examples, maybe some screenshots and share the link to the repository. What else should I do to prepare my project for the final evaluation/submission?
I am currently traveling, @choldgraf do you have time to look?
I'll take a look at it today!
Hi, has anyone manage to take a look at this pull request?
I'll look at it today - haven't had much time since I've been busy prepping for my wedding in 2 weeks :-O
Ah I just realized I was leaving all of those comments as "single comments" instead of as a review, so they've already showed up. In general the code looks good, though I'm not really able to debug guts of the STC stuff since I haven't done that work before.
I'm still trying to get the examples to run on my machine but it's taken a while to set this up. It sounds like this requires the "master" branch of ipyvolume, yeah? Once I get them running I can give some more comments on the examples themselves, and maybe the API in general.
finally got it working! the visualizations look really slick :-) nicely done!
a quick thought: the "time bar" works relatively well, but the 3D visualization seems to lag behind changes in time by a few seconds (e.g. if I hit a different point on the time bar, then the plot takes a few seconds to update). Is this just because I'm on a not-great computer?
Here's an example:
For me it was also lagging. I suppose it is because I do some calculations on the Python
side, not on JavaScript
and communication between the two happens through the server. As a result the frame rate is quite low.
I have updated the pull request according to the code review.
I do not have time to look closely right now so I trust @choldgraf's judgment :)
I do agree that it's better to avoid dependencies and have this be standalone for now. Longer term we might try to get PySurfer to have multiple backends, which this could be one of. However, right now PySurfer
requires Mayavi so it's worth copy-pasting code a bit to avoid needing to satisfy that dependency.
Nice! I just pulled changes and took another look. A few more points for you @OlehKSS :-)
slow animation updating
Colors
(I'd expect the fmin/fmax to be symmetric around zero, but it isn't here.
Views and updating
plot_source_estimates
function:It stays this way for maybe 5-6 seconds, and then all of the views switch to their proper "lateral / medial" view at once. Any idea why this would happen?
Documentation
ipysurfer.ipynb
demo a little bit more? I think this one will be useful for many people who don't directly use the plot_stc
functions of MNE. Think about each of the major features you like in ipysurfer, and show a step-by-step example to use and explain each one (AKA, don't just make a single plot with all of the features in it, show them off one by one). This example / demo can also be material for your blog post so we can kill 2 birds with one stone.plot_stc.ipynb
demo looks pretty good! The main thing I'd address is to give a bit of context for what exactly is happening so that users can understand.Let me know if you have any questions or thoughts - really nice job so far, now that most of the features are in place lets make sure they're polished and documented so people can appreciate them!
Hi, @choldgraf,
about animation, previously we had all data passed to the JavaScript, and the animation was quite quick, but according to @larsoner suggestions that up-sized stc data can occupy a lot of memory I have changed it to calculate required data upon request. I have added an issue on optimization, see #33.
the problem with fmin/fmid/fmax in divergent color map is due to the way I get 'mne' color map, I obtain it from mne._limits_to_control_points
function. After I change control points I can't change the color-map returned by the mne function, since by tweaking fmin/fmid/fmax values I change only alpha blending of the colors, not the colors itself. As a result, color map keeps gray area as it was defined by mne.
the problem with views is because of a bug in ipyvolume
, see. I have partly solved it, but the problem that you descibed about changing initial camera position is still present. I am not sure whether I will be able to solve it until the end of GSOC. I have added an issue for this, see #34.
do you have any suggestions on how to do my final evaluation report? There are several ways described in the provided recomendations. I thought to extend README.md
with project description. Do you think I should do a blog post also? E.g. I will update README.md
file with information that will be more useful for other people that would like to use this project and I will create a blog post where I will use information from README.md
and I will elaborate more on what I have done during GSOC.
I have updated documentation and usage samples according to the latest code review suggestions.
@OlehKSS regarding the final report, I'd recommend a blog post that covers the technical things that you had to do in order to make this happen. What were the core pieces of tech that made this package possible? What were some challenges that you had to overcome, and the technical decisions you made to overcome them? I think it'd be interesting and useful for you to tell a short narrative about your experience working on this problem! In addition we can link to interactive examples via Binder and make sure that the readme looks good and everything is documented.
@choldgraf I have changed binder link in README.MD
to lead to the ipyserfer.ipynb
file instead of brain-mesh.ipynb
, since the latter one is outdated and I have deleted it. Do I need to add the ipyserfer.ipynb
file to binder or it will figure out which file to show automatically?
API changes to be consistent with PySurfer.