coganlab / IEEG_Pipelines

A repo of current preprocessing methods for the Cogan Lab
https://ieeg-pipelines.readthedocs.io/en/latest/
MIT License
4 stars 2 forks source link

ieeg viz mri plot_on_average error #106

Closed jimzhang629 closed 7 months ago

jimzhang629 commented 7 months ago

The tailarach.xfm file is broken somehow. OSerror says winError 1006, the volume for a file has been externally altered so that the opened file is no longer valid


OSError Traceback (most recent call last) Cell In[14], line 50 46 allSubjElectrodes = mne.pick_channels(info.ch_names, []) 47 allElectrodes[subj_without_zeroes] = allSubjElectrodes ---> 50 plot_on_average(allSigElectrodes, hemi='both', color=(1,1,0)) 51 # plot_on_average(allElectrodes, hemi='both', color=(1,1,0))

File ~\Desktop\GlobalLocal\IEEG_Pipelines\ieeg\viz\mri.py:350, in plot_on_average(sigs, subj_dir, rm_wm, picks, surface, hemi, color, size, fig, label_every, background, units, transparency, average, show) 347 else: 348 raise TypeError(type(inst)) --> 350 to_fsaverage = mne.read_talxfm(subj, subj_dir) 351 if average == 'fsaverage': 352 trans = mne.transforms.Transform(fro='head', to='mri', 353 trans=to_fsaverage['trans'])

File :12, in read_talxfm(subject, subjects_dir, verbose)

File c:\Users\jz421\AppData\Local\anaconda3\envs\ieeg\Lib\site-packages\mne_freesurfer.py:597, in read_talxfm(subject, subjects_dir, verbose) 595 subjects_dir = get_subjects_dir(subjects_dir) 596 # Setup the RAS to MNI transform --> 597 ras_mni_t = read_ras_mni_t(subject, subjects_dir) 598 ras_mni_t["trans"][:3, 3] /= 1000.0 # mm->m 600 # We want to get from Freesurfer surface RAS ('mri') to MNI ('mni_tal'). 601 # This file only gives us RAS (non-zero origin) ('ras') to MNI ('mni_tal'). ... 1011 os.stat() does. 1012 """ -> 1013 return os.stat(self, follow_symlinks=follow_symlinks)

OSError: [WinError 1006] The volume for a file has been externally altered so that the opened file is no longer valid: 'C:\Users\jz421\Box\ECoG_Recon\D59\mri\transforms\talairach.xfm'

jimzhang629 commented 7 months ago

uh it just works now for some reason