How to use brain templete without Freesurfer ?

  • MNE version: 1.1.1

  • operating system: Windows 10

  • I am using the fNIRS Hitachi data.

Hi, I would like to plot the sensors (montage) on a brain templete, as in the example below presented, but unfortunately I don’t have a Freesurfer subject, is there another way to visualize the sensors (montage) on a brain templete?

subjects_dir = op.join(mne.datasets.sample.data_path(), 'subjects')

brain = mne.viz.Brain(
    'fsaverage', subjects_dir=subjects_dir, background='w', cortex='0.5')
brain.add_sensors(
    raw_intensity.info, trans='fsaverage',
    fnirs=['channels', 'pairs', 'sources', 'detectors'])
brain.show_view(azimuth=20, elevation=60, distance=400)

You can get the freesurfer fsaverage files with this function: mne.datasets.fetch_fsaverage — MNE 1.1.1 documentation. You don’t need Freesurfer installed to use them.

If you have a different brain template you want to use, it ought to be possible to use a different subjects_dir and different subject name (and I guess a different value of trans) and have the rest of the commands work.

2 Likes

So I did the following now:

mne.datasets.fetch_fsaverage(subjects_dir=None, verbose=True)
brain = mne.viz.Brain(
    'fsaverage', subjects_dir=None, background='w', cortex='0.5')
brain.add_sensors(
    raw1.info, trans='fsaverage',
    fnirs=['channels', 'pairs', 'sources', 'detectors'])
brain.show_view(azimuth=20, elevation=60, distance=400)

But I got a Traceback with a ValueError saying Empty meshes cannot be plotted. Input mesh has zero points. What is the reason ?

When I do not use the method ‘add_sensors’ the brain templete works, but then the sensor do not get plotted. So, I tried to use:

brain.add_sensors(raw1.info, trans='fsaverage',fnirs=['channels', 'sources', 'detectors'])

But also that does not work, again only brain without the sensors gets plotted, it seems to need ‘pairs’ in the list.

I am using Hitachi-raw data and the raw1 is only from the left hemisphere, might this be the reason?

hmm. cc @rob-luke as I’m not so familiar with fnirs data.

that sounds possible; if so it seems like something we’d like to allow.

1 Like

Hi @rfahrn, thanks for taking the time to report this issue.
We should be able to plot the sensors, and having only one hemisphere should not be a problem. This sounds like a bug to me, so lets try and solve it. Can you provide some additional information to help us debug.

  • How did you read in the data? Can you provide the code you used?
  • Can you share an example file so we can check it (along with the code used to read it)?

Thanks,
Rob

2 Likes

Hi,
I read the data by using raw1.load_data(), I can provide you the code by sharing my github repository: [fNIRS-project/fNIRS preprocessing.py at main · rfahrn/fNIRS-project · GitHub ]

Best,
Rebecka