OHBA-analysis / osl-core

Matlab tools for running M/EEG analyses - NO LONGER SUPPORTED - Please use Python Version Instead: https://github.com/OHBA-analysis/osl
http://ohba-analysis.github.io/osl-docs/
29 stars 14 forks source link

OSL headmodel crash when montage has already been applied to D object #66

Open RCTimms opened 3 years ago

RCTimms commented 3 years ago

Is it imperative to do a Rhino co-reg before doing an AFRICA based ICA? I ask because I notice that in opt the coreg is called before AFRICA and I think it fails to deal with any online montage way down on line 595 of rhino when it calls

D.inv{1}.datareg(end).sensors = D.sensors(char(modality));

I see the same behaviour when using the SPM option when called through osl_headmodel. If however I call the SPM coreg option directly through

clear matlabbatch matlabbatch{1}.spm.meeg.source.headmodel.D = {'/Volumes/TASER/Notts_RS/processed_data/copy_dfp3004.mat'}; matlabbatch{1}.spm.meeg.source.headmodel.val = 1; matlabbatch{1}.spm.meeg.source.headmodel.comment = ''; matlabbatch{1}.spm.meeg.source.headmodel.meshing.meshes.template = 1; matlabbatch{1}.spm.meeg.source.headmodel.meshing.meshres = 2; matlabbatch{1}.spm.meeg.source.headmodel.coregistration.coregspecify.fiducial(1).fidname = 'nas'; matlabbatch{1}.spm.meeg.source.headmodel.coregistration.coregspecify.fiducial(1).specification.select = 'nas'; matlabbatch{1}.spm.meeg.source.headmodel.coregistration.coregspecify.fiducial(2).fidname = 'lpa'; matlabbatch{1}.spm.meeg.source.headmodel.coregistration.coregspecify.fiducial(2).specification.select = 'lpa'; matlabbatch{1}.spm.meeg.source.headmodel.coregistration.coregspecify.fiducial(3).fidname = 'rpa'; matlabbatch{1}.spm.meeg.source.headmodel.coregistration.coregspecify.fiducial(3).specification.select = 'rpa'; matlabbatch{1}.spm.meeg.source.headmodel.coregistration.coregspecify.useheadshape = 1; matlabbatch{1}.spm.meeg.source.headmodel.forward.eeg = 'EEG BEM'; matlabbatch{1}.spm.meeg.source.headmodel.forward.meg = 'Single Shell'; spm_jobman('run',matlabbatch)

Then the coreg runs successfully.

For completeness, I thought that this might not be a montage issue, but instead could be down to the fact that I have some EOG/ECG/EMG channels in my D object. I tested this by running RHINO on the D object before ICA had been applied, and it worked.