GithubHelp home page GithubHelp logo

opm's Introduction

OPM processing Guide for SPM

The code in this toolbox is now intended for personal use only. All code previously available in this toolbox is now available within SPM. please raise any issues or pull requests there. Documentation is now available in the tutorials section of the SPM documentation website

opm's People

Contributors

georgeoneill avatar neurofractal avatar rctimms avatar stephaniemellor avatar tierneytim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

opm's Issues

Fiducial/headmodel handling.

I've been looking at the portions of the code which handle using fiducials and I've realised its become quite a mess in some respects. I think this needs a bit of a tidyup.

I think a part of it is how spm_opm_create is tying to be both the convert and headmodel specfication elements of SPM, which I think is a noble effort but just needs some finessing (which I am happy to do). I'm wondering if we need to separate out the importing of data and the headmodel specification into seperate routines (like what happened to spm_opm_sim). But have the option to call the headmodel specification from spm_opm_create if required. This can be done in a fashion which means the end user doesn't notice the difference, but tidies up the code a bit.

Some proposed behaviours.

  • If S.coordsystem provided, but not S.sMRI. Read in fiducials and export them to dataset. Dont bother trying to register, but keep fiducials. This would be the closes to an spm_eeg_convert behaviour where all the neccesary files are imported to at least play with the source reconstuction in the GUI or live in the batch universe after that,
  • If S.coordsystem not provided but S.sMRI is, assume the sensors and anatomical are in the same space. Export fiducials derived from SPM to the dataset. Initiate the coreg.
  • If S.coordsystem provided, and S.sMRI=1 (for template). Read in fiducials and export them to dataset. Possibly handle some headpoints from, say, a polhemus or iPad. Initate the coregistration.
  • If S.coordsystem provided, and S.sMRI is an actual anatomical, do the registration between the provided coil and anatomical landmarks (if found) in coordsys.json. Initate coreg.
  • If S.coordsystem provided, and S.sMRI is an actual anatomical, do the registration between the provided coil locations in S.coordsystem and the derived fiducials from SPM preprocessing. Initiate coreg.

Most of these behaviours are already available in the code with have (with some tidying up, having everthing being called coil1, coil2 etc. might be too reestrictive a behaviour) or we can hand everything over to the headmodel specification matlabbatch on behalf of the user.

Thoughts?

OPM array simulation and source reconstruction

hello, I find the OPM sensor number is different from yours in your paper titled Pragmatic spatial sampling for wearable MEG arrays, such as 940 for 10mm space vs 784 in your paper. The codes I use are as follows. In addition, I got a problem when I try to use the sensor number as the spatial number in the module of source inversion iterative with the error information of not many this lead field.

for i = 1:Narray
S =[];
S.space = space(i);
S.meshres = 3;
S.offset = 6.5;
S.wholehead = 0;
S.fname = sprintf('sim_opm_%dmm',S.space);
D = spm_opm_sim(S);
newfile=fullfile(out_path, sprintf('sim_opm_%dmm.mat',S.space));
save(newfile,'D');
end

ICA for SPM

Let's get some ICA working for SPM:

Example Fieldtrip Code for OPMs

https://gist.github.com/neurofractal/146823ec8c9105a7287ad3bb8b5babc1

Currently finding it best to provide a TAN-only layout for easier interpretation of components

fastica

runica

Plotting

For simple plotting of independent components:

cfg.viewmode = 'component';
ft_databrowser(cfg, comp)

For fancier plotting see: i) ft_icabrowser (though I found this buggy) ii) Rob's tutorial script 2 for custom code

use of the spm_opm_sim

hello, when I simulate magnetometer data with the function "spm_opm_sim", I can not use the MEG object generated as your tutorial to simulate the MEG source in the matlabbatch environment. The error is "no executable modules, but still unresolved dependencies or incomplete module inputs". I wonder if I miss any steps before the simulation of sources in the matlabbatch. Thanks for your help!

Cannot open NAcortex_8196.surf.gii

Hi, I got an error when I run [hfD, Yinds]=spm_opm_hfc(S);

警告: [GIFTI] Parsing of XML file NAcortex_8196.surf.gii failed. 
错误使用 xmltree (第 47 行)
错误使用 xmltree (第 47 行)
[XMLTree] Cannot open NAcortex_8196.surf.gii

出错 read_gifti_file (第 15 行)
    t = xmltree(filename);

出错 gifti (第 108 行)
                this = read_gifti_file(varargin{1},giftistruct);

出错 spm_eeg_inv_transform_mesh (第 18 行)
    cmesh = export(gifti(mesh.(fn{tess_ind(i)})),'spm');

出错 spm_eeg_inv_forward (第 42 行)
    mesh = spm_eeg_inv_transform_mesh(M, D.inv{val}.mesh);

出错 spm_opm_hfc (第 151 行)
            mfD = spm_eeg_inv_forward(mfD,1);

出错 tierneytimOPM (第 19 行)
[hfD, Yinds]=spm_opm_hfc(S);

Mark bad channals when channel names overlapped

Hi, I got a problem when I try to mark bad channals of my own data during use spm_opm_hfc.m,Because my channal names have some overlap,such as 'CH1' and 'CH12',so I try to use codes
[indsRem, ~] = match_str(s.label, badLabels);
to replace
indsRem = [];
for i =1:length(badLabels)
indsRem=[indsRem strmatch(badLabels{i},s.label)];
end
in spm_opm_hfc.m to solve this problem.
where the function match_str() is from \toolbox\spm12\external\fieldtrip\utilities\match_str.m .

By the way, when I applied HFC on my own opm data, I found the results are exactly the same when I change the order (S.L).
I wonder if it is because my data only have one axis?
And I set S.balance=0 since I don't have an MRI data, I don't know how much does that affect the outcome.

Headshape

spm_opm_create should have an S.headshape input, in which headshape can be associated with fiducial info for better coregistration

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.