Skip to content

contrast.plot_topo() crashing #605

@Zanchi96

Description

@Zanchi96

Hi,
I'm trying to run the GLM analysis (measured) example in Visual Studio Code and Jupyter Notebook. I tried copying it and running with my own fNIRS data, and it was crashing after the creation of the contrast, using the plot_topo() method. I then tried using the default dataset, the one used in the original notebook, and still crashes in the same position.

The last part of the error is:

File c:\Users\User\Desktop\mne tutorials\mne_venv\Lib\site-packages\mne_nirs\visualisation_plot_GLM_topo.py:344, in _handle_overlaps(info, t, sphere, estimates)
334 info_subset = pick_info(info, picks)
335 (
336 _,
337 pos,
(...)
342 clip_origin,
343 ) = _prepare_topomap_plot(info_subset, t, sphere=sphere)
--> 344 estmrg, ch_names = _merge_ch_data(estimates.copy()[picks], t, ch_names)
345 return estmrg, pos, ch_names, sphere

IndexError: invalid index to scalar variable.

I do think that estimates is supposed to be a numpy array of dimensions [n x m], n and m > 1, since in _plot_glm_contrast_topo estimates are taken as estimates[0], but contrast.data.effect (as the one generated in the tutorial) is a monodimensional array, so estimates[0] just takes the first element (and not an array), resulting in the previous error. Is my interpretation true? How can I solve it?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions