# Synthetic volume sources

**URL:** <https://mne.discourse.group/t/synthetic-volume-sources/6412>\
**Category:** Support & Discussions\
**Tags:** ﻿source-localization\
**Created:** [February 23, 2023, 10:38pm UTC](https://mne.discourse.group/t/synthetic-volume-sources/6412 "2023-02-23T22:38:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![neural-decoder](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/neural-decoder/32/2148_2.png) [@neural-decoder](https://mne.discourse.group/u/neural-decoder)\
**Post date:** [February 23, 2023, 10:38pm UTC](https://mne.discourse.group/t/synthetic-volume-sources/6412/1 "2023-02-23T22:38:35Z")

</div>

I’m trying to simulate volume sources and obtain raw, sensor data.

```python

src = mne.setup_volume_source_space(subject=subject, subjects_dir=subjects_dir, pos=9.0,)

bem = mne.read_bem_solution(subjects_dir + subject + '/bem/model/bem_model.fif', verbose=None)

fwd = mne.make_forward_solution(rec.info, trans='fsaverage', src=src, bem=bem)

...

source_simulator = mne.simulation.SourceSimulator(src, tstep=tstep, duration=100)
source_simulator.add_data(label_ACC, source_ACC, events)
source_simulator.add_data(label_PCC, source_PCC, events)

raw = mne.simulation.simulate_raw(info, stc=source_simulator, forward=fwd)

```

However I’m getting an error in last line:

```python
  File "/anaconda3/envs/mne/lib/python3.10/site-packages/mne/simulation/source.py", line 259, in simulate_stc
    src_sel = np.intersect1d(src[hemi_ind]['vertno'],
  File "/anaconda3/envs/mne/lib/python3.10/site-packages/mne/source_space.py", line 326, in __getitem__
    out = super(). __getitem__ (*args, **kwargs)
IndexError: list index out of range

```

Is it possible to simulate volume sources? If yes, what is the right method?
