<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
I cannot reproduce your problem. It seems that you are using an incorrect/outdated copy of issubfield. The line number you report in your error message does not line up with the current version. Please ensure that your matlab path is set correctly, in particular
try to avoid copies of SPM or eeglab taking precedence. These may have old versions of FT code that can cause all kinds of erratic behaviour.
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On 11 Mar 2016, at 01:02, Hassan Aleem <<a href="mailto:ha438@georgetown.edu" class="">ha438@georgetown.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">
<div class="">Hi J.M,<br class="">
<br class="">
</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 class="">
<br class="">
</div>
<div class=""><b class="">%reading mri</b><br class="">
</div>
<div class="">[mri] = ft_read_mri('MNI152_T1_0.5mm.nii');<br class="">
mri.coordsys ='MNI'<br class="">
-----------------------------------<br class="">
</div>
<div class=""><b class="">%segmentation</b><br class="">
<br class="">
</div>
<div class="">cfg = [];<br class="">
cfg.brainthreshold = 0.5;<br class="">
cfg.scalpthreshold = 0.15;<br class="">
cfg.downsample = 1; %no downsampling<br class="">
cfg.output = {'brain' 'scalp' 'skull'};<br class="">
seg = ft_volumesegment(cfg, mri);<br class="">
----------------------------------<br class="">
</div>
<div class="">%plotting segmentation <br class="">
</div>
<div class="">cfg = [];<br class="">
cfg.funparameter = 'trishells';<br class="">
cfg.funcolormap = [1 0 0;0 1 0;0 0 1];<br class="">
ft_sourceplot(cfg,seg) <b class="">this does not work, same error.</b><br class="">
------------------------------------------<br class="">
</div>
<div class=""><b class="">%building mesh</b><br class="">
</div>
<div class="">cfg = [];<br class="">
cfg.method= 'projectmesh';<br class="">
cfg.tissue = {'scalp', 'skull', 'brain'};<br class="">
cfg.numvertices = [1000 1000 1000];<br class="">
bnd = ft_prepare_mesh(cfg, seg);<br class="">
<br class="">
% i enlarged / reduced the boundary mesh a little bit, because they were causing errors, probably due to overlapping<br class="">
bnd(1).pnt = bnd(1).pnt.*1.001<br class="">
bnd(2).pnt = bnd(2).pnt.*1<br class="">
bnd(3).pnt = bnd(3).pnt.*0.999<br class="">
<br class="">
ft_plot_mesh(bnd(1))%scalp<br class="">
ft_plot_mesh(bnd(2))%skull<br class="">
ft_plot_mesh(bnd(3))%brain<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">----------------------------------------------------------<br class="">
</div>
<div class=""><b class="">%preparing headmodel</b><br class="">
</div>
<div class="">cfg = [];<br class="">
cfg.method = 'dipoli';<br class="">
headmodel = ft_prepare_headmodel(cfg, bnd);<br class="">
--------------------------------------------------------<br class="">
<b class=""><br class="">
%adding electrodes to headmodel</b><br class="">
elec=ft_read_sens('Hydrocel_GSN_128_1.0_TRIM_mod.sfp'); %load electrode file
<br class="">
<br class="">
% visualize head surface (scalp)<br class="">
<br class="">
figure;<br class="">
ft_plot_mesh(headmodel.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]);
<br class="">
hold on;<br class="">
% plot electrodes<br class="">
ft_plot_sens(elec,'style', 'sk')<br class="">
<br class="">
% aligning electrodes<br class="">
cfg = [];<br class="">
cfg.method = 'interactive';<br class="">
cfg.elec = elec;<br class="">
cfg.headshape = headmodel.bnd(1);%scalp<br class="">
st_elec_aligned = ft_electroderealign(cfg);<br class="">
-----------------------------------------------<br class="">
</div>
<div class=""><b class="">%using the standard template sourcemodel from fieldtrip.</b><br class="">
<br class="">
load('standard_sourcemodel3d5mm.mat')<br class="">
-------------------------------------<br class="">
<b class="">%% timelock data</b><br class="">
cfg = [];<br class="">
m0 = ft_timelockanalysis(cfg, dataM0);<br class="">
--------------------------------------<br class="">
</div>
<div class=""><b class="">%% perform source analysis<br class="">
</b><br class="">
</div>
<div class="">cfg = [];<br class="">
cfg.method = 'lcmv';<br class="">
cfg.lcmv.lambda='5%';<br class="">
cfg.grid = sourcemodel.cfg.grid;---this is the standard template from fieldtrip<br class="">
cfg.headmodel = headmodel;<br class="">
cfg.lcmv.keepfilter = 'yes';<br class="">
cfg.lcmv.projectnoise='yes';<br class="">
cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD<br class="">
source_m0=ft_sourceanalysis(cfg,m0);<br class="">
------------------------------<br class="">
</div>
<div class=""><b class="">%% source interpolation</b><br class="">
<br class="">
</div>
<div class="">cfg = [];<br class="">
cfg.interpmethod = 'nearest';<br class="">
cfg.parameter = 'pow';<br class="">
cfg.grid=sourcemodel.cfg.grid;<br class="">
sourceinterp_m0 = ft_sourceinterpolate( cfg, source_m0, seg);<br class="">
----------------------------------------------<br class="">
</div>
<div class=""><b class="">%plotting</b><br class="">
<br class="">
</div>
<div class="">cfg = [];<br class="">
cfg.method = 'ortho';<br class="">
cfg.funcolorlim = 'maxabs';<br class="">
cfg.funparameter= 'pow';<br class="">
ft_sourceplot(cfg, sourceinterp_m0);<br class="">
<br class="">
</div>
<div class="">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 class="">
<br class="">
</div>
<div class="">Best,<br class="">
<br class="">
</div>
<div class="">Hassan<br class="">
</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Thu, Mar 10, 2016 at 3:00 AM, Schoffelen, J.M. (Jan Mathijs)
<span dir="ltr" class=""><<a href="mailto:jan.schoffelen@donders.ru.nl" target="_blank" class="">jan.schoffelen@donders.ru.nl</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word" class="">Hassan,
<div class="">Can you please provide a bit more information with respect to what version of fieldtrip, matlab and operating system you use?</div>
<div class="">Did you check whether the ‘seg’ looks healthy? Does the ‘mri’ plot well? We need more information to work with.</div>
<div class="">Best,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">
<div class="h5">
<div class="">On 09 Mar 2016, at 21:26, Hassan Aleem <<a href="mailto:ha438@georgetown.edu" target="_blank" class="">ha438@georgetown.edu</a>> wrote:</div>
<br class="">
</div>
</div>
<div class="">
<div class="">
<div class="h5">
<div dir="ltr" class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">Hi everyone,<br class="">
<br class="">
</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 class="">
<br class="">
[mri] = ft_read_mri('MNI152_T1_0.5mm.nii');<br class="">
mri.coordsys ='MNI'<br class="">
<br class="">
cfg = [];<br class="">
cfg.output = {'brain' 'scalp' 'skull'};<br class="">
seg = ft_volumesegment(cfg, mri);<br class="">
seg.anatomy = mri.anatomy;<br class="">
<br class="">
cfg = [];<br class="">
cfg.funparameter = 'brain';<br class="">
<b class="">ft_sourceplot(cfg,seg)</b><br class="">
<br class="">
</div>
I get the error:<br class="">
<br class="">
<u class="">Error using textscan</u><br class="">
First input can not be empty. Expected a non-empty string or a valid file-id.<br class="">
<u class=""><br class="">
Error in issubfield (line 44)</u><br class="">
t = textscan(f,'%s','delimiter','.');<br class="">
<u class=""><br class="">
Error in ft_sourceplot (line 460)</u><br class="">
hasmsk = issubfield(functional, cfg.maskparameter);<br class="">
<br class="">
</div>
This is happening regardless of what stage I use ft_sourceplot.<br class="">
<br class="">
</div>
Thanks for your consideration!<br class="">
<br class="">
</div>
Hassan<br class="">
</div>
</div>
</div>
<span class="">_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank" class="">fieldtrip@donders.ru.nl</a><br class="">
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank" class="">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></span></div>
</blockquote>
</div>
<br class="">
</div>
</div>
<br class="">
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank" class="">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
</blockquote>
</div>
<br class="">
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
<div class=""><br class="">
<br class="">
</div>
<br class="">
</body>
</html>