Skip to content

Commit 04adeda

Browse files
committed
[brain2meseh] fix inconsistent loop marker in maxloop
1 parent a859360 commit 04adeda

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

maxloop.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@
1717

1818
newloop = curveloop;
1919

20+
if (~isnan(curveloop(end)))
21+
curveloop(end + 1) = nan;
22+
end
23+
2024
loopend = find(isnan(curveloop));
21-
if(length(loopend) > 1)
25+
if (length(loopend) > 1)
2226
seglen = [loopend(1), diff(loopend)];
2327
[maxlen, maxloc] = max(seglen);
2428
loopend = [0 loopend];
25-
newloop = curveloop((loopend(maxloc)+1):(loopend(maxloc+1)-maxloc));
29+
newloop = curveloop((loopend(maxloc) + 1):(loopend(maxloc + 1) - maxloc));
2630
end
2731
newloop(isnan(newloop)) = [];

mesh2mask.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
% -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)
3939
%
4040

41-
opt = varargin2struct(varargin{:})
41+
opt = varargin2struct(varargin{:});
4242

4343
if (nargin == 3 && length(xi) == 1 && xi > 0)
4444
mn = min(node);
@@ -65,9 +65,9 @@
6565
clf(hf);
6666
end
6767

68-
if(jsonopt('edge', 0, opt))
68+
if (jsonopt('edge', 0, opt))
6969
try
70-
set(gcf, 'GraphicsSmoothing', 'off')
70+
set(gcf, 'GraphicsSmoothing', 'off');
7171
catch
7272
end
7373
end

0 commit comments

Comments
 (0)