[Mne_analysis] writting raw fif files with mne_ex_read_write_raw

Ghuman, Avniel (NIH/NIMH) [F] ghumana at mail.nih.gov
Thu Apr 21 12:35:05 EDT 2011
Search archives:

Dear Elisabeth,

Well, that is the method laid out in these two papers:

http://www.ncbi.nlm.nih.gov/pubmed/21256967
http://www.ncbi.nlm.nih.gov/pubmed/20123024

So, I would think it was appropriate, though there are certainly other approaches that may be preferred.

Best Wishes,
Avniel



On 4/21/11 12:29 PM, "Elisabeth Fonteneau" <Elisabeth.Fonteneau at mrc-cbu.cam.ac.uk> wrote:

Hi Alex, & Sheraz and the list

Thank you for your help
I managed to sort out my problem with working on the buffer size and everything looks ok.

Regarding the comments from Alex about ICA:
We used ICA separately for each sensors (Mag, Grad, and EEG) and remove the blink component separately.
Then we recombined all the sensors together..
Do you think it will be appropriate like that or will you recommend another way to do so?

Best wishes and happy bank holiday (in UK at least)

Elisabeth



**********************
NEW CONTACT DETAILS
**********************

Dr Elisabeth Fonteneau

Neurolex Group
Department of Experimental Psychology
University of Cambridge
Downing Street
Cambridge CB2 3EB
England
Phone: +44 1223 333 548
Email: ef309 at cam.ac.uk
Web: http://www.mrc-cbu.cam.ac.uk/people/elisabeth.fonteneau/
**********************


-----Original Message-----
From: Alexandre Gramfort [mailto:gramfort at nmr.mgh.harvard.edu]
Sent: 21 April 2011 00:33
To: Elisabeth Fonteneau
Cc: mne_analysis at nmr.mgh.harvard.edu
Subject: Re: [Mne_analysis] writting raw fif files with mne_ex_read_write_raw

Hi Elisabeth,

data are stored in buffers in fif files, so to do what you want to do
I would read
the entire raw data by chunks and store the chunks in one big matlab matrix.
Then apply your artifact rejection method before writing again the
data by chunks.
It requires a bit of coding though.

Regarding the ICA, beware that magnetometers and gradiometers have
different scales and if you don't pay attention your ICA will be dominated
by the signals with the highest variance ie. the magnetometers.

Alex

On Wed, Apr 20, 2011 at 3:22 PM, Elisabeth Fonteneau
<Elisabeth.Fonteneau at mrc-cbu.cam.ac.uk> wrote:
> Hello again
>
> The idea is to read first the raw original fif file with the structure
> Then change the data matrix (output of the reading) and replace it by raw data that have been ICA (removal of blink with SPM) and in the end write back the data. The ICA data are decomposed in 3 different sensors that we have to recombined into the appropriate matrix, this matrix should have the same size has the reading data..
> All that could be done smoothly if I can have all the data point (i.e use the option quantum = to - from +1) which seems not to work for the moment.
> Or may be am I using it incorrectly?
>
> Thanks for your answer
>
> Elisabeth
>
>
>
>
>
>
> -----Original Message-----
> From: Alexandre Gramfort [mailto:gramfort at nmr.mgh.harvard.edu]
> Sent: 20 April 2011 19:38
> To: Elisabeth Fonteneau
> Cc: mne_analysis at nmr.mgh.harvard.edu
> Subject: Re: [Mne_analysis] writting raw fif files with mne_ex_read_write_raw
>
> Hi Elisabeth,
>
> may I ask what you want to do at the end? crop your data?
>
> Alex
>
> On Wed, Apr 20, 2011 at 12:33 PM, Elisabeth Fonteneau
> <Elisabeth.Fonteneau at mrc-cbu.cam.ac.uk> wrote:
>> Hello MNE users,
>>
>>
>>
>> I am trying to use the function in the example mne_ex_read_write_raw.m
>>
>>
>>
>> It works, quite well if for infile and outfile I am using the same data
>>
>>
>>
>> My point is that with the option line 74/75
>>
>> quantum_sec=10
>>
>> quantum = ceil(quantum_sec*raw.info.sfreq)
>>
>>
>>
>> the data matrix does not have the same number of data point compared to the
>> original and I am struggling to understand  what the conversion is
>>
>>
>>
>>
>>
>> I would like to read the raw data in one set  and
>>
>> I tried to use the line 79 instead
>>
>> quantum = to - from +1
>>
>>
>>
>> And for this option the data is written but if I try to open the fif file
>> with mne_browse_raw
>>
>> it crashed with the following error message
>>
>>
>>
>> *** glibc detected *** free():invalid pointer: 0x006a4860***
>>
>> Abort
>>
>>
>>
>> I also try to change line 74/75 by
>>
>> quantum_sec=1000
>>
>> quantum = ceil(quantum_sec*raw.info.sfreq)
>>
>>
>>
>> and it crashed mne_browse_raw in the same way as previous
>>
>>
>>
>> Any suggestions are highly appreciated.
>>
>>
>>
>> Thanks and best wishes,
>>
>>
>>
>> Elisabeth
>>
>>
>>
>> **********************
>>
>> NEW CONTACT DETAILS
>>
>> **********************
>>
>>
>>
>> Dr Elisabeth Fonteneau
>>
>>
>>
>> Neurolex Group
>>
>> Department of Experimental Psychology
>>
>> University of Cambridge
>>
>> Downing Street
>>
>> Cambridge CB2 3EB
>>
>> England
>>
>> Phone: +44 1223 333 548
>>
>> Email: ef309 at cam.ac.uk
>>
>> Web: http://www.mrc-cbu.cam.ac.uk/people/elisabeth.fonteneau/
>>
>> **********************
>>
>>
>>
>>
>>
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>
>>
>> The information in this e-mail is intended only for the person to whom it is
>> addressed. If you believe this e-mail was sent to you in error and the
>> e-mail
>> contains patient information, please contact the Partners Compliance
>> HelpLine at
>> http://www.partners.org/complianceline . If the e-mail was sent to you in
>> error
>> but does not contain patient information, please contact the sender and
>> properly
>> dispose of the e-mail.
>>
>>
>

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis





More information about the Mne_analysis mailing list