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

Help for SPM Archives


SPM Archives

SPM Archives


SPM@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

SPM Home

SPM Home

SPM  November 2011

SPM November 2011

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: MEEG: grand mean and crop

From:

Anette Giani <[log in to unmask]>

Reply-To:

Anette Giani <[log in to unmask]>

Date:

Mon, 14 Nov 2011 10:24:49 +0100

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (199 lines)

Dear Vladimir,

It seems to work now.

Thanks for your efforts,
Anette



-----Original Message-----
From: SPM (Statistical Parametric Mapping) [mailto:[log in to unmask]] On
Behalf Of Vladimir Litvak
Sent: Saturday, November 12, 2011 2:37 PM
To: [log in to unmask]
Subject: Re: [SPM] MEEG: grand mean and crop

Dear Panagiotis and Anette,

Thanks a lot for your input and for the testing script which was very
helpful. I think I fixed the bug some time ago but it was after the last
public update. Could you please put the attached file in your @meeg folder
and see if it fixes the problem?

Thanks,

Vladimir

On Fri, Nov 11, 2011 at 8:26 PM, Panagiotis Tsiatsis
<[log in to unmask]> wrote:
> Dear Vladimir and Anette,
>
> I think i ve found the problem, and also provided an ugly and possibly 
> over-complicated fix for Anette's problem.  i might be totally wrong 
> of course. But this issue relates to a similar problem that I had with 
> this function as well concerning the coor2d assignment.
>
> The problem seems to be the functionality of coo2d.  At that time I 
> had mentioned a similar problem which made me make the following
modification:
>
> %I commented this line
> % Dnew = coor2D(Dnew, [], coor2D(D, chanind));
>
> %And substituted it with these two
> MEG_Channels = (D.meegchannels('MEG')); Dnew = coor2D(Dnew, [], 
> coor2D(D, MEG_Channels));
>
> Now that Annete needs to remove channels (and possibly MEG channels) 
> the above modification is wrong.
>
> So this is where I think that maybe the problem lies: if you run the 
> following code (just load on variable 'A' an meg spm object), you 
> might be a bit surprised at the result. At least, I was.
>
> % 
> ======================================================================
> =
> % == CODE STARTS HERE
> % 
> ======================================================================
> =
> load an spm MEG object A
> A
> display('Total Number of Channels in A') A.nchannels
>
> display('Create a new object C as equal to A') C = A;
>
>
> display('Set Coord_A to be A.coor2D and Coord_C to be C.coor2D');
>
> Coord_A = A.coor2D;
> Coord_C = C.coor2D;
>
>
> display('Find where the matrices mismatch..')
>
> Total_Mismatches = sum(find(Coord_A(1,:) ~= Coord_C(1,:))) +
> sum(find(Coord_A(2,:) ~= Coord_C(2,:)))
>
> display('No Mismatches, as expected...')
>
> display('Now assign the coords of A to C via coor2d, exactly as
spm_eeg_crop
> does...')
> C = coor2d(C,[],coor2d(A,[1:A.nchannels]));
>
> display('Update Coord_A to be A.coor2D and Coord_C to be C.coor2D');
> Coord_A = A.coor2D;
> Coord_C = C.coor2D;
>
>
> display('Find where the matrices mismatch..')
> Total_Mismatches = sum(find(Coord_A(1,:) ~= Coord_C(1,:))) +
> sum(find(Coord_A(2,:) ~= Coord_C(2,:)))
>
> display('Surprise..')
>
> % =======================================================================
> % == CODE ENDS HERE
> % =======================================================================
>
> AS you will see, the result is fine as expected when the coordinates are
> copied via an assignment operation on the objects' level, but they are
> completely wrong in the case of an assignment via the coor2d function.
>
> I am attaching you a solution which might be wrong and overcomplicated but
> it seemed to work fine for me. I also tried to remove channels of
different
> kinds and also MEG channels from different positions to make sure that the
> solution is robust (ie. it could make a difference if the first MEG
channels
> in line are removed instead of channels that come later on). I ve put some
> comments but I am a bit tired at the moment so please doublecheck it.
>
> Also, keep in mind that this is only an MEG CTF specific solution. I would
> say more of a hint that a solution, I hope I don't end up misleading you.
>
>
> Best,
> Panagiotis
>
>
>
>
> On 11/11/2011 4:16 PM, Anette Giani wrote:
>>
>> Dear Vladimir,
>>
>> Thanks for your response. You are right, 2D locations are preserved. At
>> least if I type: coor2D(D), I get the same locations before and after
>> cropping. Interestingly, if I want to look at the topology using the GUI,
>> the message still appears. I tried to look in the code and I think it has
>> something to do with in spm_eeg_review_callbacks (line 209: pos(:,1) =
>> [D.channels(I).X_plot2D]';). Even though I do not really understand what
>> happens there, I think it is strange that in the uncropped case the
>> variable
>> pos is about the size of the number of channels, while in the cropped
case
>> it is 277 times as large.
>>
>> This happens for any dataset that I tried. If you still cannot replicate
>> the
>> error please let me know. In that case I will try to send you one example
>> dataset.
>>
>> Best,
>> Anette
>>
>>
>>
>> -----Original Message-----
>> From: SPM (Statistical Parametric Mapping) [mailto:[log in to unmask]] On
>> Behalf Of Vladimir Litvak
>> Sent: Friday, November 11, 2011 12:35 PM
>> To: [log in to unmask]
>> Subject: Re: [SPM] MEEG: grand mean and crop
>>
>> Dear Anette,
>>
>> The crop tool should preserve the 2D locations. It is in the code and
I've
>> just checked on my example and there was no problem. Perhaps send me your
>> dataset before cropping and which channel you removed and I'll look at
it.
>> You can also try to use 'Prepare' to re-create the 2D locations and see
if
>> it helps (don't forget 'apply' and 'save').
>>
>> Best,
>>
>> Vladimir
>>
>> On Fri, Nov 11, 2011 at 9:13 AM, Anette Giani
>> <[log in to unmask]>  wrote:
>>>
>>> Dear all,
>>>
>>> For the analysis of my MEG data, I would like to calculate the grand
>>> mean over all subjects. However, for technical reasons, data of one
>>> subject contains 1 channel less than the data of the others. Is there
>>> a way to choose the channels for which the grand mean should be
>>> calculated? I tried to crop the data of the remaining subjects.
>>> However, after cropping it seems like 2d channel positions are lost.
>>> Hence, if I want to look at the topology of the cropped data a message
>>> appears: "Get 2d positions for these channels!".
>>>
>>> Looking forward to your suggestions!
>>> Anette
>>>
>
>
> --
> Panagiotis S. Tsiatsis
> Max Planck Institute for Biogical Cybernetics
> Cognitive NeuroImaging Group
> Tuebingen, Germany
>
>

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
2006
2005
2004
2003
2002
2001
2000
1999
1998


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

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