Print

Print


Dear Rik,

I discussed your request with Jukka. We will produce means to get the 
matrix to be used for leadfield investigations but we still have to 
think about the implementation a little bit. The task is straightforward 
in principle, but it might be better to do it as a separate software 
module instead of implementing it into the official MaxFilter release. 
Another possibility is a Matlab program that reads the relevant 
information, such as the basis vector selection used by MaxFilter and 
the appropriate fine calibration, and computes the matrix based on that. 
We will get back to you about this as soon as possible but there may be 
a delay because the Finnish summer holiday season is just about to 
start. I am sorry about the inconvenience.

Regarding the SSS operation, the signal returned by MaxFilter is of the 
form B_in = S_in*P*pinv(S)*B, where S and S_in are the full (in+out) and 
internal SSS-bases, respectively, P is a matrix that only picks the 
multipole moments related to the internal basis, and B is the measured 
signal. In Olaf's idea, B is the identity matrix and in that case 
MaxFilter returns S_in*P*pinv(S), which is the matrix that you are 
looking for. If I understand correctly, your Matlab code repeatedly 
initializes B to the zero vector until n=306 leaving a vector with 
nonzero entry only for the last element. If this is the case, you will 
not get the correct matrix, unfortunately. It is a pity that it is not 
feasible to use the identity matrix as input for MaxFilter.

I will get back to you with help for calculating the projection matrix, 
which, by the way, is an oblique projection with built-in reconstruction 
for the effect of non-orthogonality between the neural leadfields and 
the external SSS basis. I would like to emphasize this because of your 
concern in the correspondence below: "I would also hope that the SSS 
components reflecting environmental noise sources in the outer sphere 
are only a small part of the sensor space spanned by the leadfield 
matrix, so their removal would have little affect on that matrix." This 
can be easily checked, e.g., by measuring signal from the deepest 
phantom dipole, which is spatially quite similar to homogeneous 
interference, and verifying that MaxFilter does not distort its signal.

Best regards,
Samu


Rik Henson wrote:
>
> Dear Neuromag (Jukka/Samu?)
>
> Following the previous discussion below, I was wondering if it would 
> be possible for the next release of MaxFilter to return (e.g, write to 
> a file) a matrix that is effectively the one used to project the 
> "noise" components (in outer sphere) out of the data. This would be 
> generally useful, e.g, to adjust our leadfields (even if the 
> adjustment should be negligible, given Samu's comments below about 
> noise levels).
>
> Rik
>
> PS I have tried Olaf's idea below of running MaxFilter on a dummy FIF 
> file containing just an identity matrix, using the FIFFACCESS 
> "writeraw" command. Firstly, if I just try to write a 306x306 identity 
> matrix, MaxFilter will not run because it thinks the channels have 
> saturated. However, if I write each column (sample) with a separate 
> call to "writeraw", MaxFilter does now work (for reasons that are 
> unclear; separate buffers?) - but the resulting output (projection 
> matrix?) looks suspicious - is it in fact correct? (Matlab code below; 
> am sure I have done something stupid!):
>
>    FIFfile = 'realdata_raw.fif';
>    megmodel('head',FIFfile);
>
>    [ChanName,ChanType,ChanNum,CoilType,T] = channames(FIFfile);
>    chs = ChanName(1:306,:);
>
>    Fout = 'iid.fif';
>    T0 = 1; SF = 1000;
>
>    writeraw(Fout,chs,SF,T0,'IID');
>
>    %B = eye(306)*1e-12;  % doesn't work because MaxFilter thinks
>    channels saturated
>    %writeraw(B);
>
>    Z = zeros(306,1);
>    for n=1:306
>     B = Z; B(n) = 1e-12;
>     writeraw(B);
>    end
>
>    writeraw('close')
>
>    Sout = 'iid-sss.fif';
>    logfile = 'iid-sss.log';
>    delete(Sout); delete(logfile)
>    eval(sprintf('!/neuro/bin/util/maxfilter -f %s -o %s -ctc
>    /neuro/databases/ctc/ct_sparse.fif -cal
>    /neuro/databases/sss/sss_cal.dat -autobad off -v | tee
>    %s',Fout,Sout,logfile))
>
>    [d, SF] = rawchannels(Sout,chs);
>    figure,imagesc(d),colormap('gray')
>
>
>
>
>
> Samu Taulu wrote:
>> Dear Colleagues,
>>
>> This is a very interesting discussion. I hope I can clarify some of 
>> the questions in the previous emails.
>>
>> First of all, I would like to briefly describe the way how SSS 
>> affects the data in general. Apparently, the number of degrees of 
>> freedom of an MEG signal is very high, in the case of Elekta Neuromag 
>> Oy the rank of the data is 306 to begin with. However, due to the 
>> sampling theory of neuromagnetic fields and the relatively low signal 
>> to noise ratio, most of the dimensions in the signal space belong to 
>> random sensor noise while the dimensionality of the brain and 
>> external interference signals is much smaller. This means that only 
>> around 100 field components are needed to practically represent the 
>> signals of interest and interference. The SSS method has been 
>> designed in such a way that it models those basic components with 
>> vector spherical harmonic expansions that are truncated at the limit 
>> above which the components fall under the sensor noise level. In 
>> accordance with the sampling theory, these components correspond to 
>> very high spatial frequencies of the magnetic field. The internal 
>> (brain) and external (interference) signals are both included in the 
>> SSS matrix, and generally the angle between an arbitrarily chosen 
>> pair of internal and external basis vectors is less than 90 degrees, 
>> i.e., there is overlapping between them. The SSS basis, however, is 
>> linearly independent and the decomposition into those basis 
>> components is unique. Assuming that the sampling theory and 
>> quasistatic Maxwell's equations hold, the brain signal estimate does 
>> not leak into the external part and thus the spatial overlapping of 
>> the internal and external signals does not cause a need for leadfield 
>> corrections, unlike in the case of SSP where the orthogonal spatial 
>> projection slightly modifies the brain signals. The effect of SSP is 
>> compensated for in the Xfit software, for example.
>>
>> The potential distortion to brain signals caused by SSS would happen 
>> due to the truncation of the vector spherical harmonic expansion. We 
>> have examined the effect of the truncation by simulations in Figs. 
>> 1-4 of our paper (Taulu S, Simola J, Kajola M, IEEE Trans. Sign. 
>> Proc., vol. 53, pp. 3359-3372 (2005)) and found out that the effect 
>> is practically insignificant. In other words, manipulation of the 
>> leadfields should not be necessary after SSS. If you like, you can 
>> create the transformation matrix like Olaf suggested - MaxFilter does 
>> not return such a transformation.
>>
>> If you would like to experiment the effect of SSS on the leadfields, 
>> you could try the following simple experiment:
>> 1. Simulate the signal of any reasonable current dipole in Xfit. This 
>> step utilizes full-rank leadfields with no linear transformation 
>> performed on the data.
>> 2. Run MaxFilter on the simulated file
>> 3. Load the output file of MaxFilter into Xfit and perform source 
>> analysis
>>
>> In step 3, Xfit assumes original leadfields without any matrix 
>> manipulation and therefore the possible discrepancy is directly 
>> assessed by comparing the results obtained with the original and 
>> SSS-processed data because Xfit treats both of them in the same way: 
>> Without leadfield correction. Based on our theory and experiments, 
>> there should be no significant distortion in the field pattern or 
>> source localization even without any leadfield manipulations.
>>
>> I hope this clarifies the issue, and sorry for the length of this email.
>>
>> Best regards,
>> Samu
>>
>>
>> Olaf Hauk wrote:
>>> If there is no "built in" way: One could create an artifical data 
>>> set that
>>> contains only the identity matrix (n*n, n: number of sensors), and 
>>> apply
>>> SSS to that in order to get the transformation matrix.
>>>
>>> Olaf
>>>
>>>
>>>
>>>  
>>>> I think this is the key, Olaf.
>>>>
>>>> I apologise that my original email caused some confusion, because I 
>>>> was
>>>> not asking specifically about the temporal extension of SSS, but 
>>>> rather
>>>> the use of SSS generally.
>>>>
>>>> I would also hope that the SSS components reflecting environmental 
>>>> noise
>>>> sources in the outer sphere are only a small part of the sensor space
>>>> spanned by the leadfield matrix, so their removal would have little
>>>> affect on that matrix.
>>>>
>>>> However, my question remains: in order to compare "with and without"
>>>> leadfield correction (as Olaf suggests), how do I extract the 
>>>> necessary
>>>> correction (projection) from MaxFilter?
>>>>
>>>> Advice from MaxFilter experts (ie Neuromag?) much appreciated....
>>>>
>>>> Rik
>>>>
>>>>
>>>>   
>>>>> Hi again, and sorry: I was a bit too quick, there is of course no 
>>>>> "null
>>>>> space" in sensor space of the leadfield. But the question how much 
>>>>> the
>>>>> SSS
>>>>> components have in common with the leadfield still remains, and if 
>>>>> the
>>>>> overlap is small, how big the effect of such a leadfield 
>>>>> correction on
>>>>> source estimates really is. Has anyone tried with and without?
>>>>>
>>>>> Olaf
>>>>>
>>>>>
>>>>>
>>>>>     
>>>>>> I would say one has to think about SSSt as a temporal filtering 
>>>>>> method
>>>>>> -
>>>>>> and you don't correct your leadfield after low-pass filtering 
>>>>>> either,
>>>>>> for
>>>>>> example. But this raises another interesting question: If SSS 
>>>>>> (with or
>>>>>> without ST) only removes activity from sources outside the sensor
>>>>>> array,
>>>>>> it should only remove patterns that are in the null space of the
>>>>>> leadfield
>>>>>> - i.e. no correction would be required. If it removes patterns 
>>>>>> that are
>>>>>> NOT in the null space of the leadfield, these sources could 
>>>>>> potentially
>>>>>> be
>>>>>> generated inside the head (where the brain is) - i.e. it might 
>>>>>> remove
>>>>>> signal! I would hope that it's the former.
>>>>>>
>>>>>> Olaf
>>>>>>
>>>>>>
>>>>>>
>>>>>>       
>>>>>>> Burkhard -
>>>>>>>
>>>>>>> I thought so too, but another colleague thought this was not the 
>>>>>>> case.
>>>>>>> So if the Neuromag experts don't give the definite answer, we could
>>>>>>> have
>>>>>>> a vote?
>>>>>>>
>>>>>>> ;-)
>>>>>>> Rik
>>>>>>>
>>>>>>> Burkhard Maess wrote:
>>>>>>>
>>>>>>>         
>>>>>>>> Hi Rik,
>>>>>>>>
>>>>>>>> this is an interesting question - but I think the temporal 
>>>>>>>> projection
>>>>>>>> does not modify the spatially organized leadfield. SSSt takes 
>>>>>>>> out the
>>>>>>>> part of the data which correllates highly between both expansions,
>>>>>>>> but
>>>>>>>> you can not describe it by a certain spatial pattern as in the 
>>>>>>>> case
>>>>>>>> of
>>>>>>>> the SSP.
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Burkhard
>>>>>>>>
>>>>>>>>
>>>>>>>> Rik Henson wrote:
>>>>>>>>
>>>>>>>>           
>>>>>>>>> Dear Neuromeg -
>>>>>>>>>
>>>>>>>>> Could you let me know how I can correct my leadfields for prior
>>>>>>>>> SSSt?
>>>>>>>>> In other words, I have a leadfield matrix, L, of n sensors x p
>>>>>>>>> sources, and would like to extract some form of projection matrix
>>>>>>>>> from Maxfilter that I can apply to L in order to remove those
>>>>>>>>> components of the sensor data that have been removed by SSSt.
>>>>>>>>>
>>>>>>>>> Many thanks
>>>>>>>>> Rik
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>               
>>>>>>> -- 
>>>>>>>
>>>>>>> -------------------------------------------------------
>>>>>>>                  Dr Richard Henson
>>>>>>>          MRC Cognition & Brain Sciences Unit
>>>>>>>                  15 Chaucer Road
>>>>>>>                    Cambridge
>>>>>>>                   CB2 7EF, UK
>>>>>>>
>>>>>>>            Office: +44 (0)1223 355 294 x522
>>>>>>>               Mob: +44 (0)794 1377 345
>>>>>>>               Fax: +44 (0)1223 359 062
>>>>>>>
>>>>>>> http://www.mrc-cbu.cam.ac.uk/people/rik.henson/personal
>>>>>>> -------------------------------------------------------
>>>>>>>
>>>>>>>
>>>>>>>           
>>>>>> -- 
>>>>>>
>>>>>>
>>>>>>         
>>>>>
>>>>>       
>>>> -- 
>>>>
>>>> -------------------------------------------------------
>>>>
>>>> DR RICHARD HENSON
>>>>
>>>> MRC Cognition & Brain Sciences Unit
>>>> 15 Chaucer Road
>>>> Cambridge, CB2 7EF
>>>> England
>>>>
>>>> EMAIL:  [log in to unmask]
>>>> URL:    http://www.mrc-cbu.cam.ac.uk/people/rik.henson/personal
>>>>
>>>> TEL     +44 (0)1223 355 294 x522
>>>> FAX     +44 (0)1223 359 062
>>>> MOB     +44 (0)794 1377 345
>>>>
>>>> -------------------------------------------------------
>>>>
>>>>     
>>>
>>>
>>>   
>>
>>
>