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

Bugs when attempting webgl.show on a dataset with multiple Vertex2D objects #341

Open
marcoaqil opened this issue Sep 9, 2019 · 1 comment

Comments

@marcoaqil
Copy link

Hi,

I am attempting to visualize a Dataset containing multiple Vertex2D objects on a cortical surface. However, I have encountered some bugs when attempting to do this.

Behavior

First, if two or more Vertex2D objects have a dimension in common, webgl.show crashes (in my case, they have different first dimension, to be shown as color, and same second dimension, to be shown as alpha). This appears to be because in the case of identical dimensions, multiple BrainData objects are stored in Dataset.uniques under the same name, which crashes the loop on lines 71-79 of webgl/data.py when it attempts to iterate a second time over a name it already used, and that image has been substituted by a BytesIO().read() object (line 79).

Workaround and another bug

A simple workaround for this crash is introducing negligible differences in the second dimension of the Vertex2D objects, so that all BrainData objects are stored in dataset.uniques with different names, preventing the crash. However, when doing this, for some reason the first dimension is plotted identically for some or all objects, even if the underlying data is different (which i can see correctly if I plot the different Vertex2D objects in separate webgl.show windows/datasets).

Any support or workaround to correctly plot datasets with multiple Vertex2D objects would be much appreciated. Thank you very much.

Best,
Marco Aqil

@marcoaqil
Copy link
Author

A (hacky) solution to this issue is to create Vertex2D objects, and then create a dataset with their .raw attributes rather than the Vertex2D themselves. This prevents colormap/bar interactivity, but allows multiple 2D datasets to be plotted correctly in the same webgl window.

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

1 participant