[FieldTrip] channel_repair bug

Frederic Roux fredericroux at hotmail.de
Thu Sep 15 16:17:21 CEST 2011


Is the google code correct or does it still have the bug?

-- 
Frédéric Roux, PhD student
Department of Neurophysiology
Max Planck Institute for Brain Research
D-60529 Frankfurt am Main
Frederic.Roux at brain.mpg.de
+49(0)69630183225




> From: fieldtrip-request at donders.ru.nl
> Subject: fieldtrip Digest, Vol 10, Issue 18
> To: fieldtrip at donders.ru.nl
> Date: Thu, 15 Sep 2011 12:00:17 +0200
> 
> Send fieldtrip mailing list submissions to
> 	fieldtrip at donders.ru.nl
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> or, via email, send a message with subject or body 'help' to
> 	fieldtrip-request at donders.ru.nl
> 
> You can reach the person managing the list at
> 	fieldtrip-owner at donders.ru.nl
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of fieldtrip digest..."
> 
> 
> Today's Topics:
> 
>    1. Critical bug in ft_channelrepair fixed (J?rn M. Horschig)
>    2. Fwd: AW: Forward solution using concentric	spheres	and	BEM
>       models (Micheli, C.)
>    3. cortical time-course reconstruction (Paolo Belardinelli)
>    4. Re: interaction within-subject indepsamplesT (Eric Maris)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Wed, 14 Sep 2011 15:41:45 +0200
> From: "J?rn M. Horschig" <jm.horschig at donders.ru.nl>
> To: Email discussion list for the FieldTrip project
> 	<fieldtrip at donders.ru.nl>
> Subject: [FieldTrip] Critical bug in ft_channelrepair fixed
> Message-ID: <4E70AF19.2040003 at donders.ru.nl>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Hey everyone,
> 
> we found a critical bug in ft_channelrepair, which we fixed now. The bug 
> caused wrong channels to be chosen for interpolation in some situations, 
> meaning that the timecourse your repaired channel did not make sense. 
> Please be aware of this, check your reconstructed channels and re-run 
> your channel reconstruction if you are in doubt with the newest 
> FieldTrip version!
> 
> For more information, check Google code:
> http://code.google.com/p/fieldtrip/source/detail?r=4158
> and Bugzilla:
> http://bugzilla.fcdonders.nl/show_bug.cgi?id=941
> 
> Best regards,
> J?rn
> 
> 
> -- 
> J?rn M. Horschig
> PhD Student
> Donders Institute for Brain, Cognition and Behaviour
> Centre for Cognitive Neuroimaging
> Radboud University Nijmegen
> Neuronal Oscillations Group
> 
> P.O. Box 9101
> NL-6500 HB Nijmegen
> The Netherlands
> 
> Contact:
> E-Mail: jm.horschig at donders.ru.nl
> Tel:    +31-(0)24-36-68493
> Web: http://www.ru.nl/donders
> 
> Visiting address:
> Trigon, room 2.30
> Kapittelweg 29
> NL-6525 EN Nijmegen
> The Netherlands
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Wed, 14 Sep 2011 17:56:38 +0200 (CEST)
> From: "Micheli, C." <c.micheli at fcdonders.ru.nl>
> To: fieldtrip at donders.ru.nl
> Subject: [FieldTrip] Fwd: AW: Forward solution using concentric
> 	spheres	and	BEM	models
> Message-ID:
> 	<1624476173.1270054.1316015798685.JavaMail.root at draco.zimbra.ru.nl>
> Content-Type: text/plain; charset=utf-8
> 
> Hi Margit and Juan Pablo
> see my answers below.
> 
> ----- "Margit Sch?nherr" <Margit.Schoenherr at uk-erlangen.de> schreef:
> 
> > Van: "Margit Sch?nherr" <Margit.Schoenherr at uk-erlangen.de>
> > Aan: "c micheli" <c.micheli at fcdonders.ru.nl>
> > Verzonden: Woensdag 7 september 2011 09:33:53
> > Onderwerp: AW: [FieldTrip] Forward solution using concentric spheres	and	BEM	models
> >
> > Hello Cristiano,
> > 
> > thank you for your email. I have tried the code, but I have 2 problems
> > with it.
> > 1) When I do it exactly as suggested in the email, I get the following
> > error when using ft_prepare_mesh:
> > 
> > bnd = ft_prepare_mesh(cfg, mri_segment);
> > ??? Error using ==> ft_prepare_mesh at 159
> > unsupported cfg.method and/or input
> > 
> > I think, this is simply a problem concerning the naming of the
> > variables. The segmented mri is called 'seg', the labels are assigned
> > to 'mri_segment'. I think, this is the wrong input for
> > ft_prepare_mesh, because 'mri_segment' does not contain any mri
> > information. Putting the labels into a new field 'seg.seg' and calling
> > bnd = ft_prepare_mesh(cfg, seg) solves this.
> > 
> 
> I could replicate the error and this is due to the fact that ft_prepare_mesh accepts inputs of FieldTrip type 'volume'. See ft_datatype_volume. The function crashed because I simply used an old version of the test file where I inputted the volume matrix only, whereas three fields are required (dim, transform and anatomy), that's why the input should look like this:
> 
> mri2 = [];
> mri2.anatomy = mri_segment;
> mri2.dim = mri.dim;
> mri2.transform = mri.transform;
> 
> I patched the correct code at the end of the mail.
> 
> > 2) However, there is still only one surface triangulated. So as I
> > wrote in my last email, I still believe that line 25 in
> > prepare_mesh_segmentation needs to be commented. What do you mean?
> 
> 
> I agree. This function needs a general review altogether and at the moment I committed your correction. In the future I'll restructure the whole function taking care of the more recent guidelines. Thanks for your suggestion.
> 
> Try this:
> 
> % download from the FieldTrip ftp site 
> % (ftp://ftp.fcdonders.nl/pub/fieldtrip/tutorial/Subject01.zip)
> 
> % load the MRI
> mri = ft_read_mri('Subject01.mri');
> 
> % segment it
> cfg = [];
> cfg.output = {'scalp', 'skull', 'brain'};
> seg = ft_volumesegment(cfg, mri);
> 
> % volumetric preprocessing
> % Note: the three compartments have to be 'filled' otherwise the triangulation won't work correctly. The output of ft_volumesegment will change soon, making it compatible with ft_prepare_mesh. As of today we need the following:
> 
> mri_segment{1} = seg.scalp;
> mri_segment{2} = imfill(seg.skull,'holes'); % you need the image processing toolbox here!
> mri_segment{3} = seg.brain;
> 
> % triangulation (from volumes to surfaces)
> % Note: now the volumes are inputted one at a time
> mri2 = mri;
> cfg=[];
> cfg.sourceunits = 'mm';
> cfg.mrinuits = 'mm';
> cfg.tissue = 1;
> cfg.numvertices = 1000;
> for i=1:3
>   mri2.seg = mri_segment{i};
>   mesh{i}  = ft_prepare_mesh(cfg,mri2);
> end
> 
> % visualization of the triangulated surfaces
> figure,ft_plot_mesh(mesh{1},'edgecolor','none','facecolor','w','facealpha',0.5)
> ft_plot_mesh(mesh{2},'edgecolor','none','facecolor','g','facealpha',0.7)
> ft_plot_mesh(mesh{3},'edgecolor','none','facecolor','r','facealpha',1)
> 
> 
> > Thank you.
> 
> Be my guest.
> Cheers,
> Cristiano
> 
> > 
> > Best regards,
> > Margit
> > 
> > 
> > ***********************************
> > Margit Sch?nherr
> > Universit?tsklinikum Erlangen
> > Neurologische Klinik
> > Epilepsiezentrum (Biomagnetismus)
> > Schwabachanlage 6
> > 91054 Erlangen
> > Telefon: ++49 9131 / 85 36921
> > Email: margit.schoenherr at uk-erlangen.de
> > ***********************************
> > ________________________________________
> > Von: fieldtrip-bounces at donders.ru.nl [fieldtrip-bounces at donders.ru.nl]
> > im Auftrag von Micheli, C. [c.micheli at fcdonders.ru.nl]
> > Gesendet: Montag, 5. September 2011 12:59
> > An: Email discussion list for the FieldTrip project
> > Betreff: Re: [FieldTrip] Forward solution using concentric spheres    
> >  and     BEM     models
> > 
> > Dear Juan Pablo and Margit
> > 
> > The function 'ft_prepare_mesh' takes care of triangulating every
> > compartment via the cfg.tissue option. This option contains the
> > integers which describe a type of tissue, given that the user
> > beforehand defined all voxels of the segmented MRI compartment as
> > having that particular value.
> > As an example, download the sample MRI in FieldTrip ftp location:
> > 
> > ftp://ftp.fcdonders.nl/pub/fieldtrip/tutorial/Subject01.zip
> > Create a folder and unzip these files.
> > 
> > % read in the mri
> > mri = ft_read_mri('Subject01.mri');
> > 
> > % segment it
> > cfg = [];
> > cfg.output = {'scalp', 'skull', 'brain'};
> > seg = ft_volumesegment(cfg, mri);
> > 
> > % assign a label
> > scalp = (seg.scalp) & ~(seg.skull | seg.brain);
> > skull = 2*(seg.skull);
> > brain = 3*(seg.brain);
> > mri_segment = scalp + skull + brain;
> > 
> > % build the meshes
> > cfg             = [];
> > cfg.method      = 'segmentation';
> > cfg.tissue      = [1 2 3]; % scalp = 1; skull = 2; brain = 3;
> > cfg.numvertices = [2000 1000 800];
> > cfg.sourceunits = 'mm';
> > cfg.mriunits    = 'mm';
> > bnd = ft_prepare_mesh(cfg, mri_segment);
> > 
> > If any of the tissues has a different value from cfg.tissues this
> > won't be triangulated. To check for this use ft_sourceplot in the
> > interactive mode. By clicking around you can see the tissue's value in
> > the command window:
> > 
> > % view the labelled segmentations
> > mri2 = mri;
> > mri2.seg = mri_segment;
> > cfg=[];
> > cfg.interactive = 'yes';
> > cfg.funparameter = 'seg';
> > ft_sourceplot(cfg,mri2);
> > 
> > About the concentric spheres:
> > both ways to derive a concentric spheres model are correct. In one
> > case you directly build the vol structure and you assume you know the
> > radiuses of your spheres. In the other case you allow the
> > ft_prepare_concentricspheres function to build the spheres starting
> > from realistic geometrical boundaries.
> > The second approach is my favorite because the ft_prepare function
> > contains a function that fits a sphere to each boundary and I don't
> > have to do it myself.
> > The first approach (directly force the radiuses in your vol structure)
> > is preferable if you derive the information from other software (e.g.
> > CTF's MRIView) or if you fit the sphere yourself.
> > 
> > @Pablo
> > If the sphere is fitted inside the brain it is correct. You do not
> > want the sphere to include other tissues, because your assumption for
> > the construction of the forward model is that the tissue inside the
> > sphere is homogeneous.
> > For a more realistic model (encompassing the whole brain volume) I
> > would rather use a BEM model.
> > 
> > I hope this helps,
> > Cristiano
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Wed, 14 Sep 2011 18:18:36 +0200
> From: Paolo Belardinelli <paolo.belardinelli at med.uni-tuebingen.de>
> To: fieldtrip at donders.ru.nl
> Subject: [FieldTrip] cortical time-course reconstruction
> Message-ID: <4E70D3DC.4060403 at med.uni-tuebingen.de>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Hi Robert.
> We have some nice coherence maps with peaks in M1 for a finger tapping 
> task. We were wondering how to properly reconstruct the power 
> time-course in the M1 area in order to use it as a further reference
> signal.
> 
> -Is the code necessary for the approach described in (Schoffelen et al., 
> NeuroImage 2008) already implemented in ft (we observed in the code that 
> it is possible in ft_sourceanalysis.m to give a location for a
> reference dipole but we found no documentation)?
> 
> -Is the only reliable solution for reconstructing a time-course to 
> project the activity in the dominant direction? We have the eigenvalues 
> of the first dipole which are normally 3 to 6 times larger
> than the ones of the second. We are not sure this is enough to neglect 
> the second component.
> 
> - One last technical question: in the mailing list it is said that the 
> orientation of the dipole is saved in source.avg.ori but it doesn't seem 
> like that to us. Maybe we are doing something wrong.
> 
> Best regards and thank you for your work,
> 
> Paolo and Erick
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Thu, 15 Sep 2011 10:10:36 +0200
> From: "Eric Maris" <e.maris at donders.ru.nl>
> To: "'Email discussion list for the FieldTrip project'"
> 	<fieldtrip at donders.ru.nl>
> Subject: Re: [FieldTrip] interaction within-subject indepsamplesT
> Message-ID: <008d01cc737e$f6192ba0$e24b82e0$@maris at donders.ru.nl>
> Content-Type: text/plain;	charset="iso-8859-1"
> 
> Dear Kathrin,
> 
> > I need your advice on how to correctly test the interaction effects in a
> 2x2
> > within-subject design with cluster-based randomization tests. I have two
> > factors A and B with the levels a1/a2 and b1/b2. In addition, the number
> of
> > trials in A are about twice as much as in B.
> > 
> > The procedure would be totally clear in a between-subject design (as in a
> > previous post on the list:
> > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html)
> 
> This post is about a WITHIN-subjects design.
> 
> > because I could easily compute the differences of the factor levels
> > A_diff=a1-a2 and B_diff=b1-b2 and then run ft_freqstatistics on the
> > differences. However, since I have to run the statistics across trials and
> not
> > subjects I have independent samples and not dependent samples. 
> 
> So, you have a between-trials design.
> 
> If it is
> > possible at all, how can I calculate the differences A_diff and B_diff
> across
> > trials? Is it a problem that the number of trials are not equal?
> 
> This is not possible. Permutation tests cannot be used for testing
> interactions in a multi-factorial between-subjects/trials design. Michael
> Wibral has a post in which he refers to a nice statistics paper on the
> issue.
> 
> A proxy that is possible (but not statistically sound) is to perform two
> statistical tests of the first factor, once at the first level of second
> factor and once at the second level.
> 
> 
> Best,
> 
> Eric Maris
> 
> 
>  
> 
> 
> 
> 
> 
> > 
> > Any help is appreciated!
> > 
> > Best,
> > Kathrin
> > 
> > _____________________________________
> > Kathrin M?sch
> > 
> > Dept. of Neurophysiology and Pathophysiology
> > University Medical Center Hamburg-Eppendorf
> > Martinistr. 52
> > 20246 Hamburg
> > Germany
> > Phone: +49-40-7410-54680
> > Fax: +49-40-7410-57752
> > E-Mail: k.muesch at uke.uni-hamburg.de
> > _____________________________________
> > 
> > 
> > --
> > Pflichtangaben gem?? Gesetz ?ber elektronische Handelsregister und
> > Genossenschaftsregister sowie das Unternehmensregister (EHUG):
> > 
> > Universit?tsklinikum Hamburg-Eppendorf; K?rperschaft des ?ffentlichen
> > Rechts; Gerichtsstand: Hamburg
> > 
> > Vorstandsmitglieder: Prof. Dr. J?rg F. Debatin (Vorsitzender), Dr.
> Alexander
> > Kirstein, Joachim Pr?l?, Prof. Dr. Dr. Uwe Koch-Gromus
> > 
> > 
> > _______________________________________________
> > fieldtrip mailing list
> > fieldtrip at donders.ru.nl
> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> 
> 
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> 
> End of fieldtrip Digest, Vol 10, Issue 18
> *****************************************
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20110915/368227db/attachment-0002.html>


More information about the fieldtrip mailing list