# Trouble storing empty room recording in subject's session directory

**URL:** <https://mne.discourse.group/t/trouble-storing-empty-room-recording-in-subjects-session-directory/8120>\
**Category:** Support & Discussions\
**Tags:** meg, mne-bids\
**Created:** [January 10, 2024, 3:58pm UTC](https://mne.discourse.group/t/trouble-storing-empty-room-recording-in-subjects-session-directory/8120 "2024-01-10T15:58:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlevitas](https://avatars.discourse-cdn.com/v4/letter/d/85e7bf/32.png) [@dlevitas](https://mne.discourse.group/u/dlevitas)\
**Post date:** [January 10, 2024, 3:58pm UTC](https://mne.discourse.group/t/trouble-storing-empty-room-recording-in-subjects-session-directory/8120/1 "2024-01-10T15:58:37Z")

</div>

- MNE version: e.g. 1.6.0
- operating system: Linux

The current BIDS specification (1.9.0) provides an [Example 1](https://bids-specification.readthedocs.io/en/stable/modality-specific-files/magnetoencephalography.html#example-1) and an [Example 2](https://bids-specification.readthedocs.io/en/stable/modality-specific-files/magnetoencephalography.html#example-2) for how empty room recordings can be described in an MEG BIDS structure. I’ve been able to replicate Example 1 using the following code:

```python
import mne
import mne_bids

# Load imaging and empty room data
raw_data = mne.io.read_raw_ctf("fname_data.ds")
raw_er = mne.io.read_raw_ctf("fname_er.ds")

# Specify the BIDS path
bids_path =mne_bids.BIDSPath(subject="01", task="bart", datatype="meg", root="bids_root_dir")

# Write data to BIDS structure
mne_bids.write_raw_bids(raw_data, bids_path=bids_path, empty_room=raw_er, overwrite=True)

```

Where I’m encountering trouble is when trying to replicate an Example 2 structure. I’ve tried:

```python
# Load imaging and empty room data
raw_data = mne.io.read_raw_ctf("fname_data.ds")
raw_er = mne.io.read_raw_ctf("fname_er.ds")

# Specify the BIDS path
bids_path_data =mne_bids.BIDSPath(subject="01", task="bart", datatype="meg", root="bids_root_dir")
bids_path_er =mne_bids.BIDSPath(subject="01", task="noise", datatype="meg", root="bids_root_dir")

# Write data to BIDS structure
mne_bids.write_raw_bids(raw_data, bids_path=bids_path_data, overwrite=True)
mne_bids.write_raw_bids(raw_er, bids_path=bids_path_er, overwrite=True)

```

which begins to run but appears to freeze at the line `Copying data files to sub-01_task-noise_meg.ds`

I was able to find this empty room [tutorial](https://mne.tools/mne-bids/stable/auto_examples/convert_empty_room.html), but it appears to align with the Example 1.

---

<div class="post-metadata">

**Author:** ![sappelhoff](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/sappelhoff/32/3276_2.png) [@sappelhoff](https://mne.discourse.group/u/sappelhoff)\
**Post date:** [January 11, 2024, 12:54pm UTC](https://mne.discourse.group/t/trouble-storing-empty-room-recording-in-subjects-session-directory/8120/2 "2024-01-11T12:54:32Z")

</div>

> [@dlevitas](#):
>
> which begins to run but appears to freeze at the line `Copying data files to sub-01_task-noise_meg.ds`

is there any log or error output?

I am a bit suspicious of why the freezing occurs. Have you tried running this on another machine, or with a new/fresh installation?

---

<div class="post-metadata">

**Author:** ![dlevitas](https://avatars.discourse-cdn.com/v4/letter/d/85e7bf/32.png) [@dlevitas](https://mne.discourse.group/u/dlevitas)\
**Post date:** [January 12, 2024, 2:50pm UTC](https://mne.discourse.group/t/trouble-storing-empty-room-recording-in-subjects-session-directory/8120/3 "2024-01-12T14:50:19Z")

</div>

Apparently my institution’s HPC was encountering some issues when I was last testing, causing the freezing issue. Everything now runs to completion. Using the second block of code in my original post, I’m now able to create the Example 2 BIDS structure.
