<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Peter,</div><div>for a similar purpose (i.e. cleaning the trigger lines) I found very helpful copying from an example file:</div><div><br></div><div>mne_ex_read_write_raw.m</div><div><br></div><div>which is in the mne folder as well. This is a nice example script which instructs you on how to open, write and close properly a fiff file, with all the details and parameters explained.</div><div>Basically, I just copied and pasted the relevant lines,  and put some intelligence in the </div><div><br></div><div>%</div><div>%   You can add your own miracle here</div><div>% </div><div><br></div><div>part (namely, changing accordingly the data(channel, time) matrix).</div><div>It's straightforward, but just post back in case of need ...</div><div>Best luck,</div><div>GP</div><div><br></div><br><div><div>Il giorno 24/gen/2013, alle ore 10:11, Peter Goodin <<a href="mailto:pgoodin@swin.edu.au">pgoodin@swin.edu.au</a>> ha scritto:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Alex, <br><br>Sorry, that "add" in the first sentence is a little misleading. Please accept my apologies. <br><br>I'm trying to alter an existing channel with new values, not add a new channel. If the channel already exists but is having the data rewritten, do any changes need to be made to <a href="http://fh.info.ch">fh.info.ch</a> or any other aspect of fh?<br><br>Thanks and sorry for the confusion again. <br><br>Peter.<br>__________________________<br>Peter Goodin,<br>BSc (Hons), Ph.D Candidate.<br><br>Brain and Psychological Sciences Research Centre (BPsych)<br>Swinburne University,<br>Hawthorn, Vic, 3122<br><br>Monash Alfred Psychiatry Research Centre (MAPrc)<br>Level 1, Old Baker Building<br>Commercial Road<br>Melbourne, Vic, 3004<br><br><br><br>________________________________________<br>From: <a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a> [<a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a>] on behalf of Alexandre Gramfort [<a href="mailto:alexandre.gramfort@inria.fr">alexandre.gramfort@inria.fr</a>]<br>Sent: Thursday, 24 January 2013 5:38 PM<br>To: FieldTrip discussion list<br>Subject: Re: [FieldTrip] MNE fiff_read / write_raw_segment<br><br>hi Peter,<br><br>when you add channels to a fif structure you need to update the measurement<br>information (channels names, types etc.). With your notations you should update<br>fh.info.chs<br><br>hope this helps<br>Alex<br><br>On Thu, Jan 24, 2013 at 2:59 AM, Peter Goodin <<a href="mailto:pgoodin@swin.edu.au">pgoodin@swin.edu.au</a>> wrote:<br><blockquote type="cite">Hi Fieldtrip list,<br><br>I'm trying to add an altered channel and save it as a new fiff file using<br>the MNE commands from the external/MNE dir in Fieldtrip, but seem to just<br>keep getting the data from the old fiff file instead.<br><br>The code I'm currently using is:<br><br>To read:<br>fh = fiff_setup_read_raw('input.fif');<br>f = fiff_read_raw_segment(fh);<br><br>After adding in the altered channel data to f, I then use:<br><br>fiff_write_raw_segment(output.fif, fh);<br><br>What I thought would happen is output.fif would use the information in f and<br>fh to write output.fif, but what seems to be happening is the data in f is<br>being ignored.<br><br>Does anyone have any ideas on how to insert the altered channel data then<br>write it back out as a fiff file?<br><br>Thanks,<br><br>Peter.<br><br><br><br><br>__________________________<br>Peter Goodin,<br>BSc (Hons), Ph.D Candidate.<br><br>Brain and Psychological Sciences Research Centre (BPsych)<br>Swinburne University,<br>Hawthorn, Vic, 3122<br><br>Monash Alfred Psychiatry Research Centre (MAPrc)<br>Level 1, Old Baker Building<br>Commercial Road<br>Melbourne, Vic, 3004<br><br><br><br>_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<br><br><br>The information in this e-mail is intended only for the person to whom it is<br>addressed. If you believe this e-mail was sent to you in error and the<br>e-mail<br>contains patient information, please contact the Partners Compliance<br>HelpLine at<br>http://www.partners.org/complianceline . If the e-mail was sent to you in<br>error<br>but does not contain patient information, please contact the sender and<br>properly<br>dispose of the e-mail.<br><br></blockquote>_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<br><br>_______________________________________________<br>fieldtrip mailing list<br>fieldtrip@donders.ru.nl<br>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<br></blockquote></div><br><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><pre class="moz-signature" cols="72">-- 
------------------------------------------------------------------------
Gianpaolo Demarchi, PhD                      <a class="moz-txt-link-abbreviated" href="mailto:gianpaolo.demarchi@unitn.it">gianpaolo.demarchi@unitn.it</a>
MEG Lab                                       phone:  0039 0461 28 30 76
CIMeC  -  Mind/Brain Center                         University of Trento
Via delle Regole, 101           I-38100 Mattarello di Trento (TN), Italy
------------------------------------------------------------------------</pre><div><br></div></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br></body></html>