JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for NEUROMEG Archives


NEUROMEG Archives

NEUROMEG Archives


NEUROMEG@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

NEUROMEG Home

NEUROMEG Home

NEUROMEG  August 2009

NEUROMEG August 2009

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Replacing a missing channel in a .fif file

From:

Marie Smith <[log in to unmask]>

Reply-To:

Marie Smith <[log in to unmask]>

Date:

Wed, 26 Aug 2009 10:13:51 +0100

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (85 lines)

Dear Neuromeg,

I  have a data set in which one meg channel is missing and I would like 
to find a way to enter this channel into the raw file and then have 
maxfilter interpolate it as if it was a bad channel.

A colleague of mine (Dan Wakeman) wrote some code to try and do just 
that. It seems to work when looking at the raw signal but when I try to 
use maxfilter on the file it fails.

I'm attaching the code to add the flat channel, along with the various 
maxfilter error messages and would appreciate any advice on where/how 
things could be going wrong.

Thanks,

Marie

*******************************************************************************

function replace_missing(file)

rawfileout=[file 'new'];
info2=fiff_setup_read_raw('goodfile.fif');

info1=fiff_setup_read_raw(file);
data1=fiff_read_raw_segment(info1);

info1=fiff_setup_read_raw(file)
info1.info.nchan=info2.info.nchan;
info1.info.chs=info2.info.chs
info1.info.ch_names=info2.info.ch_names;
info1.info.acq_pars=info2.info.acq_pars;
info1.cals=info2.cals;

data2=zeros(size(data1) + [1 0]);

data2(1:267,:)=data1(1:267,:);
data2(269:end,:)=data1(268:end,:);

FIFF=fiff_define_constants;

[fid,cals] = fiff_start_writing_raw(rawfileout,info1.info);

for i=info1.first_samp:ceil(11*info1.info.sfreq):info1.last_samp
    until=i+ceil(11*info1.info.sfreq)-1;
    if until>info1.last_samp
        until=info1.last_samp;
    end
   
    if i==info1.first_samp
        fiff_write_int(fid,FIFF.FIFF_FIRST_SAMPLE,i);
    end
   
    
fiff_write_raw_buffer(fid,data2(:,i-info1.first_samp+1:until-info1.first_samp),cals);
end

fiff_finish_writing_raw(fid)

*******************************************************************************

maxfilter -f fixedfile.fif -o outtest.fif -autobad off -bad 2343 -frame 
head -origin 0 0 40 -ds 4 -v
 
--- Processing raw tag #b = 123/123 (#t = 260.878) ---
Static bad channels (1): 2343
Using direct pseudo-inverse...
INTERNAL ERROR: illegal processing limits!
Output file outtest.fif was not written (exit value = 8)!

maxfilter -f fixedfile.fif -o outtest.fif -autobad off -bad 2343 -st 10 
-frame head -origin 0 0 40 -ds 4 -v

Scanning flat channels: #1/1232/1233/1234/1235/1236/1237/1238/1239/12310/12311/12312/12313/12314/12315/12316/12317/12318/12319/12320/12321/12322/12323/12324/12325/12326/12327/12328/12329/12330/12331/12332/12333/12334/12335/12336/12337/12338/12339/12340/12341/12342/12343/12344/12345/12346/12347/12348/12349/12350/12351/12352/12353/12354/12355/12356/12357/12358/12359/12360/12361/12362/12363/12364/12365/12366/12367/12368/12369/12370/12371/12372/12373/12374/12375/12376/12377/12378/12379/12380/12381/12382/12383/12384/12385/12386/12387/12388/12389/12390/12391/12392/12393/12394/12395/12396/12397/12398/12399/123100/123101/123102/123103/123104/123105/123106/123107/123108/123109/123110/123111/123112/123113/123114/123115/123116/123117/123118/123119/123120/123121/123122/123123/123Program 
died due to signal 11.
Core dump disabled.

maxfilter -f fixedfile.fif -o outtest.fif -autobad off -bad 2343 
-movecomp -frame head -origin 0 0 40 -ds 4 -v

--- Processing raw tag #b = 1/123 (#t = 17.000) ---
ERROR: illegal hpistep (200 samples)!
Output file outtest.fif was not written (exit value = 3)!

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

April 2024
May 2023
January 2023
March 2022
January 2022
December 2021
November 2021
May 2021
September 2020
August 2020
July 2020
May 2020
April 2020
January 2020
December 2019
June 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
May 2018
April 2018
March 2018
February 2018
January 2018
November 2017
October 2017
September 2017
August 2017
March 2017
December 2016
September 2016
July 2016
April 2016
January 2016
August 2015
July 2015
June 2015
March 2015
December 2014
August 2014
May 2014
April 2014
January 2014
December 2013
November 2013
October 2013
September 2013
June 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
July 2012
May 2012
March 2012
February 2012
September 2011
July 2011
June 2011
May 2011
April 2011
March 2011
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
February 2010
January 2010
December 2009
November 2009
October 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
March 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager