Dear Carsten,
You are right, this is a bug. The attached should work. In general an
easy way to batch coregistration and other source analysis steps is to
use the batch tool ('Batch' button) where you can create a batch
configuration and then save it as a script and include in your code.
Best,
Vladimir
On Wed, Nov 10, 2010 at 1:55 PM, Carsten Stahlhut <[log in to unmask]> wrote:
> Dear Dr. Vladimir Litvak
>
> I have a question/concern regarding the spm_eeg_inv_datareg_ui.m
> I'm trying to run the co-registration of some EEG data to the sMRI space
> automatically.
> I have already run the GUI once and saved the positions of the mri fiducials
> and I now would like to load these in stead of doing the same work with the
> GUI again if I'm rerunning this step.
>
> So far so good - I have had success with this by using the
> spm_eeg_inv_datareg_ui( D, val, meegfid, newmrifid, useheadshape) as long as
> I'm not using the headshape, i.e. useheadshape = 0.
>
> However, if I want to use the headshape (useheadshape = 1), my problem is
> that it does not make use of the headshape. It seems as the information is
> overwritten by the else-part in:
>
> Line138-142 in spm_eeg_inv_datareg_ui
> if ~isempty(S.sourcefid.pnt) && ~isfield(S, 'useheadshape')
> S.useheadshape = spm_input('Use headshape points?' , '+1','yes|no',
> [1,0], 1);
> else
> S.useheadshape = 0;
> end
>
> since S.sourcefid.pnt in my case is of size (128 sensors x 3) and S consists
> of a field useheadshape.
> I'm wondering what I'm doing wrong or if it is not possible at all to do
> using the spm_eeg_inv_datareg_ui.
>
> In case of the latter situation a change could maybe be to leave out the
> else part with S.useheadshape = 0;.
> In my case it seems to work in both situations (useheadshape=0 and
> useheadshape=1), however, I might have overlooked something.
>
> I hope you can help me out.
>
> Best,
> Carsten
>
>
>
> --
> Carsten Stahlhut, PhD Student
> Section for Cognitive Systems
> Department of Informatics and Mathematical Modelling
>
> Richard Petersens Plads, Building 321
> Technical University of Denmark
> DK-2800 Kongens Lyngby, Denmark
>
|