Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - started a page for opm coregistration #764

Merged
merged 8 commits into from
Feb 7, 2024

Conversation

schoffelen
Copy link
Contributor

No description provided.

@schoffelen schoffelen marked this pull request as draft February 5, 2024 14:35
@robertoostenveld
Copy link
Member

should we fix the polhemus file on disk (silently) so that the flip of the left and right fiducial does not have to be explained? I think it distracts

@schoffelen
Copy link
Contributor Author

Or perhaps make it an example script (and include there the strategy to fix by manipulating the pos file?)

@robertoostenveld
Copy link
Member

Left-right flips happen not too often, but can be everywhere in the acquisition and in the analysis. I would not spend time explaining one specific case. Most people are not going to notice anyway, or will say that the measurement is corrupt. Improving the explanation of the diagnostics that people should be doing in all existing tutorials would probably have more impact.

Repeating the measurement is often the easiest solution. That is also what I would have done here, had it not been for the OPM helm being stuck in the MSR.

@schoffelen
Copy link
Contributor Author

fine with me. I updated the file + docs already

@schoffelen schoffelen changed the title WIP - started a page (currently unlinked) for opm coregistration WIP - started a page for opm coregistration Feb 7, 2024
@schoffelen schoffelen marked this pull request as ready for review February 7, 2024 14:05
@schoffelen schoffelen merged commit a6b5836 into fieldtrip:master Feb 7, 2024
@schoffelen schoffelen deleted the coreg_opm branch February 7, 2024 14:06
@schoffelen
Copy link
Contributor Author

@tc-fieldline and @HXknappe this is a first version of the OPM coregistration tutorial, feel free to check it out

@robertoostenveld
Copy link
Member

Would it not fit better under the Source Reconstruction section in the ToC on https://www.fieldtriptoolbox.org/tutorial ? The electrode localization is also there.

@robertoostenveld
Copy link
Member

I suggest to add a section "Coregistration using a custom designed 3D helmet" and just a few sentences saying that that is possible, that such a design starts from a head surface scan and/or anatomical MRI, and that consequently the custom helmet and sensor positions are more or less automatically coregistered with tha head in the CAD design process.

@robertoostenveld
Copy link
Member

can we change cfg.interplimits = 'electrodes' in ft_topoplotIC (and others?) such that it would be 'sensors'?

@robertoostenveld
Copy link
Member

I did not know about this interplimits option . I think it should also be mentioned in https://www.fieldtriptoolbox.org/tutorial/preprocessing_opm. Is it always a rectangle?

I suggest to add it shortly after exercise 3 as there the plotting is done using the subset of channels that was measured and the full layout. A bit later the tutorial shifts to using nans to "pad" the data with channels that were not recorded.

@robertoostenveld
Copy link
Member

should we use

load fieldlinebeta2bz_helmet.mat

or a better controlled call to ft_prepare_layout (and ft_read_sens elsewhere)?

@robertoostenveld
Copy link
Member

in the following section I wonder whether the headshape is needed:

% this is a definition of the boundary points
hs      = [];
hs.pos  = fieldlinebeta2.coilpos;
hs.unit = 'm';

% this creates a mesh, with positions on the mesh, which is not what we need, 
% but which is a necessary step to create the boundary of the mesh
cfg           = [];
cfg.headshape = hs;
cfg.grad      = fieldlinebeta2;
hs            = ft_prepare_sourcemodel(cfg); 

note that this way of calling ft_prepare_sourcemodel makes an implicit selection of the method, I suggest to specify explicitly cfg.method = 'basedonxxx'. Actually, I think that would be good in all tutorials and examples.


% creates a boundary out of the points, that is to be interpreted 
% as the in/out boundary
hm = ft_headmodel_singleshell(hs); 

%% create the grid
cfg            = [];
cfg.headmodel  = hm;
cfg.resolution = 0.0075;
sourcemodel    = ft_prepare_sourcemodel(cfg);

does ft_prepare_sourcemodel not bound the regular grid by the box that spans the sensors?

@robertoostenveld
Copy link
Member

the tutorial could use a "The dataset used in this tutorial" section under "Background". That is something I have been adding to more tutorials recently, as sometimes it is quite hard to find out where to download data; and we DO want people to download the data and try it out themselves, not just read the website.

@robertoostenveld
Copy link
Member

The "See also" section has no other links.

@schoffelen
Copy link
Contributor Author

The "See also" section has no other links.

Hehe, indeed. I copied this over from the preprocessing_opm tutorial (which also doesn't have links). I'd be happy to remove it for now (and try to remember until there will be documentation that needs to be linked).

@schoffelen
Copy link
Contributor Author

the tutorial could use a "The dataset used in this tutorial" section under "Background". That is something I have been adding to more tutorials recently, as sometimes it is quite hard to find out where to download data; and we DO want people to download the data and try it out themselves, not just read the website.

I'd be happy to add a little blurb, but I got the impression from an earlier discussion with you that the exact data that will be hosted here is still a bit of a moving target. If it's not to be updated anytime soon, I can add a few words.

@schoffelen
Copy link
Contributor Author

in the following section I wonder whether the headshape is needed:

% this is a definition of the boundary points
hs      = [];
hs.pos  = fieldlinebeta2.coilpos;
hs.unit = 'm';

% this creates a mesh, with positions on the mesh, which is not what we need, 
% but which is a necessary step to create the boundary of the mesh
cfg           = [];
cfg.headshape = hs;
cfg.grad      = fieldlinebeta2;
hs            = ft_prepare_sourcemodel(cfg); 

note that this way of calling ft_prepare_sourcemodel makes an implicit selection of the method, I suggest to specify explicitly cfg.method = 'basedonxxx'. Actually, I think that would be good in all tutorials and examples.


% creates a boundary out of the points, that is to be interpreted 
% as the in/out boundary
hm = ft_headmodel_singleshell(hs); 

%% create the grid
cfg            = [];
cfg.headmodel  = hm;
cfg.resolution = 0.0075;
sourcemodel    = ft_prepare_sourcemodel(cfg);

does ft_prepare_sourcemodel not bound the regular grid by the box that spans the sensors?

I kind of expected the inside to be bounded in a single call to ft_prepare_sourcemodel, but the current version of the code did not produce the desired effect. I could fix it in the code, because I agree that this is a realistic expectation (and in my memory this used to work).

@robertoostenveld
Copy link
Member

Ah, there are no example or FAQ pages tagged with OPM, hence there is nothing listed. I suggest to make that (on both pages) a list of all pages tagged with OPM; that list is not too long.

@schoffelen
Copy link
Contributor Author

Ah, there are no example or FAQ pages tagged with OPM, hence there is nothing listed. I suggest to make that (on both pages) a list of all pages tagged with OPM; that list is not too long.

hehe, error here. Do you mean to add the links manually, because the parsing of the tag opm doesn't work well?

@schoffelen
Copy link
Contributor Author

can we change cfg.interplimits = 'electrodes' in ft_topoplotIC (and others?) such that it would be 'sensors'?

I just created a PR for this on the fieldtrip repo

@robertoostenveld
Copy link
Member

can you add the "see also" just with the single tag "opm" like explained here?

When using two tags, it will combine them as AND, so "opm" AND "example", which returns an empty list.

@schoffelen schoffelen linked an issue Feb 8, 2024 that may be closed by this pull request
schoffelen added a commit to schoffelen/website that referenced this pull request Nov 26, 2024
* WIP - started a page (currently unlinked) for opm coregistration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Write a coregistration tutorial for OPM data
2 participants