[FieldTrip] Orientation of headmodel with respect to sensors poisition (Susmita Sen)

Paul Sowman paul.sowman at mq.edu.au
Wed Oct 19 12:31:56 CEST 2016


Dear Susmita, you may check that your sensor positions extracted from the .con file are in the same co-ordinate frame as the MRI. Using the KIT/Yokogawa system software to co-register the sensor locations and the headshape/mri might be a necessary first step as "Unlike other systems, the Yokogawa system software does not automatically analyze its sensorlocations relative to fiducial coils":- http://www.fieldtriptoolbox.org/getting_started/yokogawa

The way we deal with it is to first do coregistration in MEG160 - the KIT/Yokogawa software, and then export the sensor locations which are then in headspace. Then coregistration with the MRI brings sensors and MRI into alignment.

This may or may not be your problem. Good luck.


Paul


Paul F Sowman

ARC DECRA Fellow

Department of Cognitive Science

Level 3,  Room 3.824

Australian Hearing Hub
16 University Drive
Macquarie University, NSW 2109, Australia

T: +61 2 9850 6732  |  F: +61 2 9850 6059
W: Profile Page<https://www.cogsci.mq.edu.au/members/profile.php?memberID=291>
<https://www.cogsci.mq.edu.au/members/profile.php?memberID=291>W: MQU Stuttering Research Facebook Page<https://www.facebook.com/pages/Macquarie-University-Stuttering-Research/228858173906140>


<http://mq.edu.au>

[Macquarie University]<http://mq.edu.au/>

CRICOS Provider Number 00002J. Think before you print.
Please consider the environment before printing this email.

This message is intended for the addressee named and may
contain confidential information. If you are not the intended
recipient, please delete it and notify the sender. Views expressed
in this message are those of the individual sender, and are not
necessarily the views of Macquarie University.



________________________________
From: fieldtrip-bounces at science.ru.nl <fieldtrip-bounces at science.ru.nl> on behalf of fieldtrip-request at science.ru.nl <fieldtrip-request at science.ru.nl>
Sent: Wednesday, 19 October 2016 6:15 PM
To: fieldtrip at science.ru.nl
Subject: fieldtrip Digest, Vol 71, Issue 24

Send fieldtrip mailing list submissions to
        fieldtrip at science.ru.nl

To subscribe or unsubscribe via the World Wide Web, visit
        https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
or, via email, send a message with subject or body 'help' to
        fieldtrip-request at science.ru.nl

You can reach the person managing the list at
        fieldtrip-owner at science.ru.nl

When replying, please edit your Subject line so it is more specific
than "Re: Contents of fieldtrip digest..."


Today's Topics:

   1. Re: error with ft_appenddata (Wong-Barnum, Mona)
   2. Separating MEG/EEG data (Wong-Barnum, Mona)
   3. Re: Separating MEG/EEG data (Tzvetan Popov)
   4. Re: Separating MEG/EEG data (Stephen Whitmarsh)
   5. Orientation of headmodel with respect to sensors  poisition
      (Susmita Sen)
   6. Re: Orientation of headmodel with respect to      sensors
      poisition (Schoffelen, J.M. (Jan Mathijs))


----------------------------------------------------------------------

Message: 1
Date: Tue, 18 Oct 2016 22:45:15 +0000
From: "Wong-Barnum, Mona" <mona at sdsc.edu>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] error with ft_appenddata
Message-ID: <DFD88583-7786-4F22-81C5-E6C8ACADF966 at mail.ucsd.edu>
Content-Type: text/plain; charset="utf-8"


Thanks Jan for your help!

I ended up doing the following steps:

addpath /path/to/fieldtrip
ft_defaults

cfg1 = [];
cfg1.dataset = '1.fif';
data1 = ft_preprocessing ( cfg1 );

cfg2 = [];
cfg2.dataset = '2.fif';
data2 = ft_preprocessing ( cfg2 );

cfg3 = [];
cfg3.dataset = '3.fif';
data3 = ft_preprocessing ( cfg3 );

cfg=[];
data = ft_appenddata ( cfg, data1, data2, data3 )

save stitched.mat data -v7.3


Which worked.

If you see any other problem that I may have missed, please feel free to educate me.

Thanks!

Mona


On Oct 5, 2016, at 5:21 PM, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:

Hi Mona,

If you directly use the output of ft_read_data as input into ft_appenddata, it won?t work. The reason is that ft_appenddata expects in the input (data#) matlab structures that are generated by ft_preprocessing. Ft_read_data outputs a numeric data matrix, which is only part of the ft_preprocessing generated output. Have you something like this yet?:

cfg = [];
cfg.dataset = ;somefiffile.fif?;
data = ft_preprocessing(cfg);

Best

Jan-Mathijs

On 05 Oct 2016, at 23:06, Wong-Barnum, Mona <mona at sdsc.edu<mailto:mona at sdsc.edu>> wrote:


I?m getting a runtime error with ft_appenddata:

data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14 )


Error using ft_checkdata (line 468) This function requires raw+comp or raw data as input.

Error in ft_appenddata (line 80) varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'no');

Error in stitch (line 45) data = ft_appenddata ( cfg, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20 )

Error in run (line 96) evalin('caller', [script ';']);

I have Neuromag data and was able to read the files into data# using ft_read_data.

In the documentation, it says cfg can be empty so I declared it by "cfg = ??;? before the ft_appenddata call; is that ok?

Any help/suggstions/tips regarding the ft_appenddata error would be appreciated.  Thanks!

Mona


*********************************************
    Mona Wong
    Web & iPad Application Developer
    San Diego Supercomputer Center

    "To handle yourself, use your head;
    to handle others, use your heart."

-- Eleanor Roosevelt
*********************************************

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip

*********************************************
    Mona Wong
    Web & iPad Application Developer
    San Diego Supercomputer Center

    "Strive not to be a success, but
    rather to be of value."
                                --- Albert Einstein
*********************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20161018/df4b482a/attachment-0001.html>

------------------------------

Message: 2
Date: Tue, 18 Oct 2016 23:17:15 +0000
From: "Wong-Barnum, Mona" <mona at sdsc.edu>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: [FieldTrip] Separating MEG/EEG data
Message-ID: <5B37A434-D55B-4C44-A2F7-A1D0D0E8467A at mail.ucsd.edu>
Content-Type: text/plain; charset="utf-8"


        I have Elekta Neuromag .fif files which contains MEG and EEG data.  What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)?

        I have been looking through the FieldTrip documentation but haven?t found what I need.  All help is appreciated.

thanks,
Mona


*********************************************
    Mona Wong
    Web & iPad Application Developer
    San Diego Supercomputer Center

    "Strive not to be a success, but
    rather to be of value."
                                --- Albert Einstein
*********************************************




------------------------------

Message: 3
Date: Wed, 19 Oct 2016 07:14:27 +0200
From: Tzvetan Popov <tzvetan.popov at uni-konstanz.de>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Separating MEG/EEG data
Message-ID: <37D50E5D-6836-48B1-8DCC-6BFD903CF21D at uni-konstanz.de>
Content-Type: text/plain; charset=windows-1252

Dear Mona,

please have a look here: http://www.fieldtriptoolbox.org/tutorial/natmeg/dipolefitting

In the section ?segment and read MEG data? there is a call to ft_rejectvisual for example where the different MEG sensors are separated. Further down the tutorial deals also with the EEG part of the analysis.
Good luck
tzvetan


Am 19.10.2016 um 01:17 schrieb Wong-Barnum, Mona <mona at sdsc.edu>:

>
>        I have Elekta Neuromag .fif files which contains MEG and EEG data.  What steps do I need to do to separate the MEG from EEG and the 3 different MEG sensor data (magnetometer, 2 gradiometer)?
>
>        I have been looking through the FieldTrip documentation but haven?t found what I need.  All help is appreciated.
>
> thanks,
> Mona
>
>
> *********************************************
>    Mona Wong
>    Web & iPad Application Developer
>    San Diego Supercomputer Center
>
>    "Strive not to be a success, but
>    rather to be of value."
>                                --- Albert Einstein
> *********************************************
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip




------------------------------

Message: 4
Date: Wed, 19 Oct 2016 07:22:17 +0200
From: Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Separating MEG/EEG data
Message-ID:
        <CAFrxm=zrLtX32DEiGY0kpd8vsTMNwu5iUzqz78K1CxnaHqNOCw at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi Mona,

To add to Tzvetan:

- You can in many FieldTrip functions specify on which channels you want to
work (cfg.channel), e.g. in ft_preprocessing.
- You can also split the data later using ft_selectdata, e.g.:

cfg = []
cfg.channel = 'MEG';
data_MEG = ft_selectdata(cfg,data_combined);

cfg = []
cfg.channel = 'EEG';
data_EEG = ft_selectdata(cfg,data_combined);

- To selecting magnetometers or gradiometers you can use:
cfg.channel = 'MEG*1'
cfg.channel = {'MEG*2', 'MEG*3'}

Cheers,
Stephen


On 19 October 2016 at 01:17, Wong-Barnum, Mona <mona at sdsc.edu> wrote:

>
>         I have Elekta Neuromag .fif files which contains MEG and EEG
> data.  What steps do I need to do to separate the MEG from EEG and the 3
> different MEG sensor data (magnetometer, 2 gradiometer)?
>
>         I have been looking through the FieldTrip documentation but
> haven?t found what I need.  All help is appreciated.
>
> thanks,
> Mona
>
>
> *********************************************
>     Mona Wong
>     Web & iPad Application Developer
>     San Diego Supercomputer Center
>
>     "Strive not to be a success, but
>     rather to be of value."
>                                 --- Albert Einstein
> *********************************************
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20161019/aebcfda4/attachment-0001.html>

------------------------------

Message: 5
Date: Wed, 19 Oct 2016 11:32:25 +0530
From: Susmita Sen <susmitasen.ece at gmail.com>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: [FieldTrip] Orientation of headmodel with respect to sensors
        poisition
Message-ID:
        <CAOD6VW90TygYzKfWMKwns+mxRG=Z_FspP2J_HYV52Z2WU_Hn_g at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Dear FieldTrip community,

I am constructing headmodel using standard mri data. The meg data that I am
working with is recorded using yokogawa system. I have used the following
code.


load('standard_mri.mat')

cfg = [];
cfg.coordsys = 'yokogawa';
cfg.viewresult = 'yes';
cfg.snapshot     = 'yes';
cfg.fiducial.nas    = mri.hdr.fiducial.mri.nas; %position of nasion
cfg.fiducial.lpa    = mri.hdr.fiducial.mri.lpa; %position of LPA
cfg.fiducial.rpa    = mri.hdr.fiducial.mri.rpa; %position of RPA
cfg.fiducial.zpoint =  [ 91 109 107];
[mri_realigned] = ft_volumerealign(cfg,mri);

%% SEGMENTATION

cfg           = [];
cfg.output    = 'brain';
segmentedmri  = ft_volumesegment(cfg, mri_realigned);

%% create headmodel

cfg = [];
cfg.method='singleshell';
vol = ft_prepare_headmodel(cfg, segmentedmri);

%% visualize

vol = ft_convert_units(vol,'cm');
grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load grad

figure
ft_plot_sens(grad, 'style', '*b');

hold on
ft_plot_vol(vol);

However, I am facing a problem when I plotting headmodel with the sensors.
I noticed that the orienations of headmodel and sensors are not aligned. I
am attaching the figure with this mail. I would be very greatful if any
could kindly give me suggestions how to align these two.

[image: Inline image 1]

[image: Inline image 2]


Thanks and Regards,
Susmita Sen
Research Scholar
Audio and Bio Signal Processing Lab.
E & ECE Dept.
IIT Kharagpur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20161019/da553626/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Headmodel_sens1.jpg
Type: image/jpeg
Size: 51012 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20161019/da553626/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Headmodel_sens2.jpg
Type: image/jpeg
Size: 58687 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20161019/da553626/attachment-0003.jpg>

------------------------------

Message: 6
Date: Wed, 19 Oct 2016 07:15:34 +0000
From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Orientation of headmodel with respect to
        sensors poisition
Message-ID: <B8B40FFC-C8B6-47AA-B01F-B8A33CA31148 at donders.ru.nl>
Content-Type: text/plain; charset="utf-8"

Dear Susmita,

It looks as if there is a discrepancy between the definition of the coordinate system according to fieldtrip (see ft_headcoordinates in fieldtrip/utilities, where it seems that an ALS axis system is imposed), when specifying cfg.coordsys = ?yokogawa?, and the coordinate system of the sensors in your data file (which is probably RAS). I could not find any documentation about the ?yokogawa?-convention (which is probably the reason why the yokogawa-entry in the table on http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined is empty). Perhaps one of the Yokogawa-users on this list could chime in to enlighten you, or you could check the system?s documentation to find out what the expected.

The easy solution would be to register the mri to an RAS-based coordinate system (e.g. use cfg.coordsys = ?neuromag? for ft_volumerealign), but I would recommend to get to the bottom of this, and provide a principled solution. Once you have found out about the conventional coordinate system for yokogawa systems, it would be great if you could update the table on (http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined). Note, that if it turns out to be that there is no specific convention (e.g. site-specific ALS or RAS or so) it is worth documenting, too.

Good luck

Jan-Mathijs

J.M.Schoffelen
Senior Researcher
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands



On 19 Oct 2016, at 08:02, Susmita Sen <susmitasen.ece at gmail.com<mailto:susmitasen.ece at gmail.com>> wrote:

Dear FieldTrip community,

I am constructing headmodel using standard mri data. The meg data that I am working with is recorded using yokogawa system. I have used the following code.


load('standard_mri.mat')

cfg = [];
cfg.coordsys = 'yokogawa';
cfg.viewresult = 'yes';
cfg.snapshot     = 'yes';
cfg.fiducial.nas    = mri.hdr.fiducial.mri.nas; %position of nasion
cfg.fiducial.lpa    = mri.hdr.fiducial.mri.lpa; %position of LPA
cfg.fiducial.rpa    = mri.hdr.fiducial.mri.rpa; %position of RPA
cfg.fiducial.zpoint =  [ 91 109 107];
[mri_realigned] = ft_volumerealign(cfg,mri);

%% SEGMENTATION

cfg           = [];
cfg.output    = 'brain';
segmentedmri  = ft_volumesegment(cfg, mri_realigned);

%% create headmodel

cfg = [];
cfg.method='singleshell';
vol = ft_prepare_headmodel(cfg, segmentedmri);

%% visualize

vol = ft_convert_units(vol,'cm');
grad = ft_read_sens('D:\Data\all\raw_preproc_data\raw\ari.con'); % load grad

figure
ft_plot_sens(grad, 'style', '*b');

hold on
ft_plot_vol(vol);

However, I am facing a problem when I plotting headmodel with the sensors. I noticed that the orienations of headmodel and sensors are not aligned. I am attaching the figure with this mail. I would be very greatful if any could kindly give me suggestions how to align these two.

<Headmodel_sens1.jpg>

<Headmodel_sens2.jpg>


Thanks and Regards,
Susmita Sen
Research Scholar
Audio and Bio Signal Processing Lab.
E & ECE Dept.
IIT Kharagpur
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20161019/e84dd46a/attachment.html>

------------------------------

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip

End of fieldtrip Digest, Vol 71, Issue 24
*****************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20161019/df4f931e/attachment-0001.html>


More information about the fieldtrip mailing list