<div dir="ltr"><div><div>Hi J.M,<br><br></div>I am using fieldtrip2016-03-09 and Matlab R2015b with a debian linux operating system. However the problem appears also on my windows 10 OS. I am unable to take a look at the 'seg' or 'mri' because the ft_sourceplot does not work with the same complaint as with trying to plot the source interpolation, I assume that's what you mean by checking them. Let me post the script to give you more information. ( the headmodel part of the script was modified from robert bauer)<br><br></div><div><b>%reading mri</b><br></div><div>[mri] = ft_read_mri('MNI152_T1_0.5mm.nii');<br>mri.coordsys ='MNI'<br>-----------------------------------<br></div><div><b>%segmentation</b><br><br></div><div>cfg = [];<br>cfg.brainthreshold = 0.5;<br>cfg.scalpthreshold = 0.15;<br>cfg.downsample = 1; %no downsampling<br>cfg.output = {'brain' 'scalp' 'skull'};<br>seg = ft_volumesegment(cfg, mri);<br>----------------------------------<br></div><div>%plotting segmentation <br></div><div>cfg = [];<br>cfg.funparameter = 'trishells';<br>cfg.funcolormap = [1 0 0;0 1 0;0 0 1];<br>ft_sourceplot(cfg,seg) <b>this does not work, same error.</b><br>------------------------------------------<br></div><div><b>%building mesh</b><br></div><div>cfg = [];<br>cfg.method= 'projectmesh';<br>cfg.tissue = {'scalp', 'skull', 'brain'};<br>cfg.numvertices = [1000 1000 1000];<br>bnd = ft_prepare_mesh(cfg, seg);<br><br>% i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping<br>bnd(1).pnt = bnd(1).pnt.*1.001<br>bnd(2).pnt = bnd(2).pnt.*1<br>bnd(3).pnt = bnd(3).pnt.*0.999<br><br>ft_plot_mesh(bnd(1))%scalp<br>ft_plot_mesh(bnd(2))%skull<br>ft_plot_mesh(bnd(3))%brain<br></div><div><br></div><div>----------------------------------------------------------<br></div><div><b>%preparing headmodel</b><br></div><div>cfg = [];<br>cfg.method = 'dipoli';<br>headmodel = ft_prepare_headmodel(cfg, bnd);<br>--------------------------------------------------------<br><b><br>%adding electrodes to headmodel</b><br>elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file <br><br>% visualize head surface (scalp)<br><br>figure;<br>ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); <br>hold on;<br>% plot electrodes<br>ft_plot_sens(elec,'style', 'sk')<br><br>% aligning electrodes<br>cfg = [];<br>cfg.method = 'interactive';<br>cfg.elec = elec;<br>cfg.headshape = headmodel.bnd(1);%scalp<br>st_elec_aligned = ft_electroderealign(cfg);<br>-----------------------------------------------<br></div><div><b>%using the standard template sourcemodel from fieldtrip.</b><br><br>load('standard_sourcemodel3d5mm.mat')<br>-------------------------------------<br><b>%% timelock data</b><br>cfg = [];<br>m0 = ft_timelockanalysis(cfg, dataM0);<br>--------------------------------------<br></div><div><b>%% perform source analysis<br></b><br></div><div>cfg = [];<br>cfg.method = 'lcmv';<br>cfg.lcmv.lambda='5%';<br>cfg.grid = sourcemodel.cfg.grid;---this is the standard template from fieldtrip<br>cfg.headmodel = headmodel;<br>cfg.lcmv.keepfilter = 'yes';<br>cfg.lcmv.projectnoise='yes';<br>cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD<br>source_m0=ft_sourceanalysis(cfg,m0);<br>------------------------------<br></div><div><b>%% source interpolation</b><br><br></div><div>cfg = [];<br>cfg.interpmethod = 'nearest';<br>cfg.parameter = 'pow';<br>cfg.grid=sourcemodel.cfg.grid;<br>sourceinterp_m0 = ft_sourceinterpolate( cfg, source_m0, seg);<br>----------------------------------------------<br></div><div><b>%plotting</b><br><br></div><div>cfg = [];<br>cfg.method = 'ortho';<br>cfg.funcolorlim = 'maxabs';<br>cfg.funparameter= 'pow';<br>ft_sourceplot(cfg, sourceinterp_m0);<br><br></div><div>This is where it gives me the error. Please let me know if you need more information. I also had a question about making a 'source' it seems that the fieldtrip tutorial does not use a 'sourcemodel' but instead use a dipolefitting source, is this comparable. Thank you for the help in advance.<br><br></div><div>Best,<br><br></div><div>Hassan<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 10, 2016 at 3:00 AM, Schoffelen, J.M. (Jan Mathijs) <span dir="ltr"><<a href="mailto:jan.schoffelen@donders.ru.nl" target="_blank">jan.schoffelen@donders.ru.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
Hassan,
<div>Can you please provide a bit more information with respect to what version of fieldtrip, matlab and operating system you use?</div>
<div>Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? We need more information to work with.</div>
<div>Best,</div>
<div>Jan-Mathijs</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
<div>
<blockquote type="cite"><div><div class="h5">
<div>On 09 Mar 2016, at 21:26, Hassan Aleem <<a href="mailto:ha438@georgetown.edu" target="_blank">ha438@georgetown.edu</a>> wrote:</div>
<br>
</div></div><div><div><div class="h5">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>Hi everyone,<br>
<br>
</div>
I have a question that is possibly very easy to solve but is evading me. I am unable to get ft_sourceplot to work. For example when I run the code:<br>
<br>
[mri] = ft_read_mri('MNI152_T1_0.5mm.nii');<br>
mri.coordsys ='MNI'<br>
<br>
cfg = [];<br>
cfg.output = {'brain' 'scalp' 'skull'};<br>
seg = ft_volumesegment(cfg, mri);<br>
seg.anatomy = mri.anatomy;<br>
<br>
cfg = [];<br>
cfg.funparameter = 'brain';<br>
<b>ft_sourceplot(cfg,seg)</b><br>
<br>
</div>
I get the error:<br>
<br>
<u>Error using textscan</u><br>
First input can not be empty. Expected a non-empty string or a valid file-id.<br>
<u><br>
Error in issubfield (line 44)</u><br>
t = textscan(f,'%s','delimiter','.');<br>
<u><br>
Error in ft_sourceplot (line 460)</u><br>
hasmsk = issubfield(functional, cfg.maskparameter);<br>
<br>
</div>
This is happening regardless of what stage I use ft_sourceplot.<br>
<br>
</div>
Thanks for your consideration!<br>
<br>
</div>
Hassan<br>
</div></div></div><span class="">
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></span></div>
</blockquote>
</div>
<br>
</div>
</div>
<br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>