EtienneCmb / visbrain

A multi-purpose GPU-accelerated open-source suite for brain data visualization
http://visbrain.org
Other
242 stars 65 forks source link

Brain GUI screenshot issue #56

Open miao-cao opened 4 years ago

miao-cao commented 4 years ago

Hi visbrain,

I'm preparing figures for publication by saving screenshots (tried both GUI and programming) from Brain GUI. However, I found some shadows on cortical surfaces from saved figures. To be noted, I used Freesurfer pial surface generated from individual's T1 MPRage MR scan. And the Visbrain version I'm using is 0.4.5

An example figure is attached below, test

Cheers, Miao

EtienneCmb commented 4 years ago

Hi @miao-cao ,

Yes, I've seen this issue before. From what I've read, it's seems that this is an OpenGL issue for meshes with vertices coordinates that are under 1. Can you try to multiply your vertices by 1000 for example and see if it fixes your issue?

GShimmering commented 4 years ago

Same problem encountered here but with the screenshot demo code: 1_proj_brain

Also, this code return an error with following traceback: Traceback (most recent call last): File "D:/brainvis_screenshot.py", line 52, in vb = Brain(brain_obj=b_obj, source_obj=s_obj, roi_obj=roi_obj) File "C:\ProgramData\Anaconda3\lib\site-packages\visbrain\gui\brain\brain.py", line 101, in init UiInit.init(self, bgcolor) # GUI creation + canvas File "C:\ProgramData\Anaconda3\lib\site-packages\visbrain\gui\brain\interface\ui_init.py", line 125, in init self.setupUi(self) File "C:\ProgramData\Anaconda3\lib\site-packages\visbrain\gui\brain\interface\gui\brain_gui.py", line 1881, in setupUi QtCore.QMetaObject.connectSlotsByName(MainWindow) SystemError: returned a result with an error set

So I comment out the signal-slot connection line, QtCore.QMetaObject.connectSlotsByName(MainWindow), line 1881 of brain_gui.py and get results of screenshots, but with holes, like the above attached image.

EtienneCmb commented 4 years ago

Hi @miao-cao ,

When visualizing the mesh inside the GUI, there's no black holes? This is only happening when exporting?

EtienneCmb commented 4 years ago

@GShimmering

can you give me the vispy version your on :

import vispy
print(vispy.__version__)
GShimmering commented 4 years ago

@EtienneCmb it's '0.6.4'.

GShimmering commented 4 years ago

@EtienneCmb

BTW, I tried visualizing my own ROI obj:

  1. holes are observed after exporting
  2. no holes in scene.preview()

My roi image is a classification result in MNI space. So a voxel value indicates a class label, i.e., integer 1~N. ROIs are selected via: _roi_custom.select_roi(list(range(1, N)), uniquecolor=True, smooth=3)

EtienneCmb commented 4 years ago

I remembered that I had to tweak vispy for exporting in higher resolutions. Probably they improved exporting the canvas since then. Can you please try to downgrade your vispy version. For example :

pip install -U vispy==0.6.0
GShimmering commented 4 years ago

@EtienneCmb Great, now the holes are gone from the exported images. 1_proj_brain

EtienneCmb commented 4 years ago

Ok, thanks, so they changed something in vispy and visbrain needs to be updated.

Can you please open an issue ? I'll try to fix it asap

GShimmering commented 4 years ago

@EtienneCmb

https://github.com/EtienneCmb/visbrain/issues/66

benelot commented 3 years ago
pip install -U vispy==0.6.0

Could we mention this somewhere or make a dependency of visbrain to that specific version? I just looked everywhere for this.

Vince-LD commented 2 years ago

Hello, I am having exactly the same issue as you @miao-cao and @GShimmering. However, downgrading vispy doesn't work (outputs an error). I have been working on this all day and even though it's an old topic, I was wondering if one of you had a working solution because right now I am completely stuck. I'm adding pictures of what screenshots look like. The only thing that improves the situation is lowering the _scale when creating the RoiObj. I have the same bug when I try to record an animation. Previews are completely fine though, even with the animation.

test_screenshot_bugged

test_screenshot