brainvisa / anatomist-free

3D visualization of neuroimaging objects, C++ part
Other
2 stars 0 forks source link

A hung-up when we instantiate anatomist after using aims.read in python #42

Open JoelChavas opened 9 months ago

JoelChavas commented 9 months ago

Describe the bug In python, when we instantiate anatomist after an aims.read, anatomist windows hung up and are black. It doesn't happen if anatomist is instantiated before the aims.read.

To Reproduce

To reproduce the bug (the following code produces black windows and they hung):

import anatomist.direct.api as ana
from soma import aims
import numpy as np
from soma.qt_gui.qt_backend import Qt

if __name__ == '__main__':
    vol = aims.read(path/to/nifti/file)
    a = ana.Anatomist()
    win = a.createWindow('3D')
    qapp = Qt.QApplication.instance()
    qapp.exec()

The code that works as expected

The following code works:

import anatomist.direct.api as ana
from soma import aims
import numpy as np
from soma.qt_gui.qt_backend import Qt

if __name__ == '__main__':
    a = ana.Anatomist()
    vol = aims.read(path/to/nifti/file)
    win = a.createWindow('3D')
    qapp = Qt.QApplication.instance()
    qapp.exec()

Environment: