Skip to content

Brain() function error #112

Open
Open
@Chen1997237

Description

@Chen1997237

Hi, I'm using the example code to display fMRI activation, but it seen's that the function Brain() may have some problems

code that used:
from visbrain.gui import Brain
from visbrain.objects import BrainObj
from visbrain.io import download_file

file = download_file('lh.sig.nii.gz', astype='example_data')

b_obj = BrainObj('inflated', translucent=False, sulcus=True)
b_obj.add_activation(file=file, clim=(5., 20.), hide_under=5, cmap='viridis',
hemisphere='left')

vb = Brain(brain_obj=b_obj)
vb.rotate('left')
vb.show()

errors:
File already dowloaded (/Users/nuc/visbrain_data/example_data/lh.sig.nii.gz).
BrainObj(name='inflated') created
Add overlay from a NIFTI file
Data scaled between (-25.255, 25.245)
VolumeObj(name='brodmann') created
RoiObj(name='brodmann') created
brodmann ROI loaded.
CrossSecObj(name='brodmann') created
Output exceeds the size limit. Open the full output data in a text editor

TypeError Traceback (most recent call last)
Cell In[7], line 7
3 b_obj = BrainObj('inflated', translucent=False, sulcus=True)
4 b_obj.add_activation(file=file, clim=(5., 20.), hide_under=5, cmap='viridis',
5 hemisphere='left')
----> 7 vb = Brain(brain_obj=b_obj)
8 vb.rotate('left')
9 vb.show()

File ~/opt/miniconda3/envs/plot/lib/python3.10/site-packages/visbrain/gui/brain/brain.py:109, in Brain.init(self, bgcolor, verbose, **kwargs)
106 Visuals.init(self, self.view.wc, **kwargs)
108 # ====================== Ui interactions ======================
--> 109 UiElements.init(self) # GUI interactions
110 PROFILER("Ui interactions")
111 self._shpopup.set_shortcuts(self.sh) # shortcuts dict

File ~/opt/miniconda3/envs/plot/lib/python3.10/site-packages/visbrain/gui/brain/interface/ui_elements/ui_elements.py:23, in UiElements.init(self)
21 def init(self):
22 """Init."""
---> 23 UiAtlas.init(self)
24 UiSources.init(self)
25 UiConnectivity.init(self)

File ~/opt/miniconda3/envs/plot/lib/python3.10/site-packages/visbrain/gui/brain/interface/ui_elements/ui_atlas.py:52, in UiAtlas.init(self)
...
--> 195 self._brain_xmin.setMinimum(xmin)
196 self._brain_xmin.setMaximum(xmax)
197 self._brain_xmin.setSingleStep((xmin - xmax) / n_cut)

TypeError: setMinimum(self, a0: int): argument 1 has unexpected type 'numpy.float64'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions