fieldtrip / website

This contains the content hosted on the FieldTrip website
http://www.fieldtriptoolbox.org
Other
39 stars 104 forks source link

WIP - started a page for opm coregistration #764

Closed schoffelen closed 8 months ago

robertoostenveld commented 8 months ago

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 commented 8 months ago

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

robertoostenveld commented 8 months ago

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 commented 8 months ago

fine with me. I updated the file + docs already

schoffelen commented 8 months ago

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

robertoostenveld commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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

robertoostenveld commented 8 months ago

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 commented 8 months ago

should we use

load fieldlinebeta2bz_helmet.mat

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

robertoostenveld commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

The "See also" section has no other links.

schoffelen commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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.