Hi everyone!
I am working with fNIRS-data collected form NIRSport 2 device.
Python version: 3.9
mne version: 0.23
OS: macOS BigSur
Loading the snirf files and creating a custom montage works fine, as well as adding the montage into the raw mne object. Saving the raw object into fif format files afterwards runs without errors or warning.
The problem is, that the montage information, I added to the raw objects before, is missing when I load these. Is this normal behaviour or am I missing something?
Here’s a short code example:
sub_raw = mne.io.read_raw_snirf(filename).load_data()
montage_path = os.path.join(os.path.split(filename)[0], 'digpts.csv')
montage = mne.channels.read_custom_montage(montage_path,head_size=None)
sub_raw.set_montage(montage)
sub_raw.info.set_montage(montage)
# montage information is now added to raw object
sub_raw.get_montage() # is not empty
fif_path = os.path.join(outpath,fname.replace('.','-') + '_raw.fif'
sub_raw.save(fif_path),overwrite=True)
#loading of fif files
raw_fif = mne.io.read_raw_fif(fif_path,preload=True)
sub_raw.get_montage() # is empty list