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

Brain() function error #112

Open
Chen1997237 opened this issue Mar 12, 2023 · 0 comments
Open

Brain() function error #112

Chen1997237 opened this issue Mar 12, 2023 · 0 comments

Comments

@Chen1997237
Copy link

Chen1997237 commented Mar 12, 2023

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'

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