diff --git a/@file_array/private/file2mat.c b/@file_array/private/file2mat.c
index f964859d..bf3c7826 100644
--- a/@file_array/private/file2mat.c
+++ b/@file_array/private/file2mat.c
@@ -1,5 +1,5 @@
/*
- * $Id: file2mat.c 6988 2017-01-16 12:38:29Z guillaume $
+ * $Id: file2mat.c 7353 2018-06-19 10:39:55Z guillaume $
* John Ashburner
*/
@@ -26,8 +26,10 @@ Memory mapping is used by this module. For more information on this, see:
HANDLE hFile, hMapping;
typedef char *caddr_t;
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+#ifdef _MSC_VER_
#define stat _stati64
#define fstat _fstati64
+#endif
#define open _open
#define close _close
#if defined _MSC_VER
@@ -625,13 +627,13 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
if (map.dtype->channels == 1)
{
plhs[0] = mxCreateNumericArray(ndim,odim,map.dtype->clss,mxREAL);
-#ifdef SPM_WIN32
+#ifdef _MSC_VER_
/* https://msdn.microsoft.com/en-us/library/windows/desktop/aa366801.aspx */
__try
{
#endif
map.dtype->func(ndim-1, idim, iptr, idat, odim, mxGetData(plhs[0]));
-#ifdef SPM_WIN32
+#ifdef _MSC_VER_
}
__except(GetExceptionCode()==EXCEPTION_IN_PAGE_ERROR ?
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH)
diff --git a/@file_array/private/file2mat.mexw32 b/@file_array/private/file2mat.mexw32
index 1ea74fbc..a56fcc60 100755
Binary files a/@file_array/private/file2mat.mexw32 and b/@file_array/private/file2mat.mexw32 differ
diff --git a/@file_array/private/file2mat.mexw64 b/@file_array/private/file2mat.mexw64
index de4f6fbf..1130fc8e 100755
Binary files a/@file_array/private/file2mat.mexw64 and b/@file_array/private/file2mat.mexw64 differ
diff --git a/@file_array/private/init.mexw32 b/@file_array/private/init.mexw32
index abde5e91..8ab70d7e 100755
Binary files a/@file_array/private/init.mexw32 and b/@file_array/private/init.mexw32 differ
diff --git a/@file_array/private/init.mexw64 b/@file_array/private/init.mexw64
index 17301452..66b5ee1b 100755
Binary files a/@file_array/private/init.mexw64 and b/@file_array/private/init.mexw64 differ
diff --git a/@file_array/private/mat2file.mexw32 b/@file_array/private/mat2file.mexw32
index 48b129f6..81a15ee9 100755
Binary files a/@file_array/private/mat2file.mexw32 and b/@file_array/private/mat2file.mexw32 differ
diff --git a/@file_array/private/mat2file.mexw64 b/@file_array/private/mat2file.mexw64
index 787f6557..486c12e5 100755
Binary files a/@file_array/private/mat2file.mexw64 and b/@file_array/private/mat2file.mexw64 differ
diff --git a/@file_array/size.m b/@file_array/size.m
index 5b1c7473..660a4c1c 100644
--- a/@file_array/size.m
+++ b/@file_array/size.m
@@ -4,7 +4,7 @@
% Copyright (C) 2005-2017-2012 Wellcome Trust Centre for Neuroimaging
%
-% $Id: size.m 7147 2017-08-03 14:07:01Z spm $
+% $Id: size.m 7440 2018-10-10 17:28:26Z john $
sa = struct(a);
@@ -35,9 +35,8 @@
d = d(1:lim);
if nargin > 1
- if varargin{1} <= length(d)
- d = d(varargin{1});
- else
- d = 1;
- end
+ d_tmp = d;
+ d = ones(size(varargin{1}));
+ msk = varargin{1}<=length(d_tmp);
+ d(msk) = d_tmp(varargin{1}(msk));
end
diff --git a/@file_array/subsref.m b/@file_array/subsref.m
index 46a39245..277107a2 100644
--- a/@file_array/subsref.m
+++ b/@file_array/subsref.m
@@ -5,7 +5,7 @@
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
%
-% $Id: subsref.m 7209 2017-11-10 15:33:10Z guillaume $
+% $Id: subsref.m 7439 2018-10-10 17:19:31Z john $
if isempty(subs), return; end
diff --git a/@gifti/Contents.m b/@gifti/Contents.m
index d13b3f30..62edd7e2 100644
--- a/@gifti/Contents.m
+++ b/@gifti/Contents.m
@@ -6,23 +6,27 @@
% http://nifti.nimh.nih.gov/
%
% This MATLAB class is part of SPM:
-% http://www.fil.ion.ucl.ac.uk/spm/
+% https://www.fil.ion.ucl.ac.uk/spm/
%
% It relies on external libraries:
% Base64, by Peter J. Acklam:
% http://home.online.no/~pjacklam/
% miniz, by Rich Geldreich:
-% http://code.google.com/p/miniz/
-% XMLTree, by Guillaume Flandin:
-% http://www.artefact.tk/software/matlab/xml/
+% https://github.com/richgel999/miniz
+% dzip, by Michael Kleder:
+% https://www.mathworks.com/matlabcentral/fileexchange/8899
+% XMLTree, mVTK and JSONio, by Guillaume Flandin:
+% https://www.artefact.tk/software/matlab/xml/
+% https://www.artefact.tk/software/matlab/mvtk/
+% https://www.artefact.tk/software/matlab/jsonio/
%__________________________________________________________________________
-% Copyright (C) 2008-2015 Wellcome Trust Centre for Neuroimaging
+% Copyright (C) 2008-2018 Wellcome Trust Centre for Neuroimaging
% Guillaume Flandin
-% $Id: Contents.m 6404 2015-04-13 14:29:53Z guillaume $
+% $Id: Contents.m 7379 2018-07-25 09:11:24Z guillaume $
-% GIfTI file format for MATLAB (The Mathworks, Inc.).
-% Copyright (C) 2008-2015 Wellcome Trust Centre for Neuroimaging
+% GIfTI library for MATLAB
+% Copyright (C) 2008-2018 Wellcome Trust Centre for Neuroimaging
%
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
@@ -36,4 +40,4 @@
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
-% Foundation Inc, 59 Temple Pl. - Suite 330, Boston, MA 02111-1307, USA.
\ No newline at end of file
+% Foundation Inc, 59 Temple Pl. - Suite 330, Boston, MA 02111-1307, USA.
diff --git a/@gifti/export.m b/@gifti/export.m
index 961e7b77..9d7ebf74 100644
--- a/@gifti/export.m
+++ b/@gifti/export.m
@@ -8,12 +8,17 @@
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
% Guillaume Flandin
-% $Id: export.m 6401 2015-04-09 17:21:33Z guillaume $
-
-if numel(this) > 1, warning('Only handle scalar objects yet.'); end
+% $Id: export.m 7383 2018-07-31 10:53:37Z guillaume $
if nargin <= 1, target = 'MATLAB'; end
+if numel(this) > 1
+ for i=1:numel(this)
+ s(i) = export(this(i),target);
+ end
+ return;
+end
+
switch lower(target)
case 'matlab'
s = struct(this);
diff --git a/@gifti/gifti.m b/@gifti/gifti.m
index 2dcf6135..8cd37ebe 100644
--- a/@gifti/gifti.m
+++ b/@gifti/gifti.m
@@ -8,7 +8,7 @@
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
% Guillaume Flandin
-% $Id: gifti.m 7037 2017-03-15 11:45:13Z guillaume $
+% $Id: gifti.m 7471 2018-11-02 11:14:39Z guillaume $
switch nargin
@@ -41,7 +41,7 @@
elseif ishandle(varargin{1})
this = struct('vertices',get(varargin{1},'Vertices'), ...
'faces', get(varargin{1},'Faces'));
- if ~isempty(get(varargin{1},'FaceVertexCData'));
+ if ~isempty(get(varargin{1},'FaceVertexCData'))
this.cdata = get(varargin{1},'FaceVertexCData');
end
this = gifti(this);
@@ -76,7 +76,9 @@
catch
error('[GIFTI] Loading of file %s failed.', varargin{1});
end
- elseif strcmpi(e,'.asc') || strcmpi(e,'.srf')
+ elseif ismember(lower(e),{'.asc','.srf','.mgh','.mgz','.pial',...
+ '.white','.inflated','.nofix','.orig','.smoothwm',...
+ '.sphere','.reg','.surf','.curv','.area','.sulc'})
this = read_freesurfer_file(varargin{1});
this = gifti(this);
elseif strcmpi(e,'.vtk')
@@ -85,6 +87,15 @@
elseif strcmpi(e,'.obj')
this = obj_read(varargin{1});
this = gifti(this);
+ elseif strcmpi(e,'.ply')
+ this = ply_read(varargin{1});
+ this = gifti(this);
+ elseif strcmpi(e,'.stl')
+ this = stl_read(varargin{1});
+ this = gifti(this);
+ elseif strcmpi(e,'.mz3')
+ this = mz3_read(varargin{1});
+ this = gifti(this);
else
this = read_gifti_file(varargin{1},giftistruct);
this = class(this,'gifti');
diff --git a/@gifti/plot.m b/@gifti/plot.m
index 76ae4e5e..fe7ef7c0 100644
--- a/@gifti/plot.m
+++ b/@gifti/plot.m
@@ -4,7 +4,7 @@
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
% Guillaume Flandin
-% $Id: plot.m 5888 2014-02-19 19:54:12Z guillaume $
+% $Id: plot.m 7381 2018-07-25 10:27:54Z guillaume $
% if ishandle(varargin{1})
% h = figure(varargin{1});
@@ -14,9 +14,9 @@
% %axis off;
% %camlight;
% %camlight(-80,-10);
-% %lighting phong;
+% %lighting gouraud;
% end
-% cameramenu;
+% cameratoolbar;
cdata = [];
@@ -55,12 +55,10 @@
set(hp,'FaceVertexCData',cdata(:,indc), 'FaceColor','interp')
end
-axes(ax);
-camlight;
-camlight(-80,-10);
-lighting phong;
-axes(ax);
-cameramenu;
+camlight(ax);
+camlight(ax,-80,-10);
+lighting(ax,'gouraud');
+cameratoolbar(h);
if nargout
varargout{1} = hp;
diff --git a/@gifti/private/getdict.m b/@gifti/private/getdict.m
index 3d457b13..45d90afc 100644
--- a/@gifti/private/getdict.m
+++ b/@gifti/private/getdict.m
@@ -4,7 +4,7 @@
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
% Guillaume Flandin
-% $Id: getdict.m 4505 2011-09-30 11:45:58Z guillaume $
+% $Id: getdict.m 7379 2018-07-25 09:11:24Z guillaume $
persistent dict;
if ~isempty(dict)
@@ -13,8 +13,12 @@
end
table = {...
- 'NIFTI_TYPE_UINT8', 'uint8', '%d', @uint8, 'uint8'
- 'NIFTI_TYPE_INT32', 'int32', '%d', @int32, 'int32'
+ 'NIFTI_TYPE_UINT8', 'uint8', '%d', @uint8, 'uint8'
+ 'NIFTI_TYPE_INT8', 'int8', '%d', @int8, 'int8'
+ 'NIFTI_TYPE_UINT16', 'uint16', '%d', @uint16, 'uint16'
+ 'NIFTI_TYPE_INT16', 'int16', '%d', @int16, 'int16'
+ 'NIFTI_TYPE_UINT32', 'uint32', '%d', @uint32, 'uint32'
+ 'NIFTI_TYPE_INT32', 'int32', '%d', @int32, 'int32'
'NIFTI_TYPE_FLOAT32', 'float32', '%f', @single, 'single'
'NIFTI_TYPE_FLOAT64', 'float64', '%f', @double, 'double'};
diff --git a/@gifti/private/miniz.c b/@gifti/private/miniz.c
index ae4058cc..ff30323a 100644
--- a/@gifti/private/miniz.c
+++ b/@gifti/private/miniz.c
@@ -1,4 +1,30 @@
-/* miniz.c v1.15 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing
+/**************************************************************************
+ *
+ * Copyright 2013-2014 RAD Game Tools and Valve Software
+ * Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ **************************************************************************/
+
+/* miniz.c 2.0.7 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing
See "unlicense" statement at the end of this file.
Rich Geldreich Please refer to this version as "SPM12" in papers and communications. Please refer to this version as "SPM12" in papers and communications. The SPM12 Manual and Release Notes are available as PDF documents in the man directory of your SPM installation. Updates will be made available from time to time and advertised on the SPM mailing list. You can also check for updates by clicking here. Updates will be made available from time to time and advertised on the SPM mailing list. You can also check for updates by clicking here. We would love to hear your comments or bug reports - please contact us at <fil.spm@ucl.ac.uk>.Welcome to SPM12
-Welcome to SPM12
Welcome to SPM12
of the Licence, or (at your option) any later version.
=p0)&&!(p1>=hi)",["p0","p1"]),g=u("lo===p0",["p0"]),m=u("lo =r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a l.length)return r;var i,a=c[n-1];return null!=e&&n>=l.length?i=r.entries():(i=[],r.each(function(e,r){i.push({key:r,values:t(e,n)})})),null!=a?i.sort(function(t,e){return a(t.key,e.key)}):i}(u(t,0,a,o),0)},key:function(t){return l.push(t),s},sortKeys:function(t){return c[l.length-1]=t,s},sortValues:function(e){return t=e,s},rollup:function(t){return e=t,s}}},t.set=c,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],125:[function(t,e,r){var n;n=this,function(t){"use strict";var e=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t};function r(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function n(){}var i="\\s*([+-]?\\d+)\\s*",a="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",o="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s=/^#([0-9a-f]{3})$/,l=/^#([0-9a-f]{6})$/,c=new RegExp("^rgb\\("+[i,i,i]+"\\)$"),u=new RegExp("^rgb\\("+[o,o,o]+"\\)$"),f=new RegExp("^rgba\\("+[i,i,i,a]+"\\)$"),h=new RegExp("^rgba\\("+[o,o,o,a]+"\\)$"),p=new RegExp("^hsl\\("+[a,o,o]+"\\)$"),d=new RegExp("^hsla\\("+[a,o,o,a]+"\\)$"),g={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function m(t){var e;return t=(t+"").trim().toLowerCase(),(e=s.exec(t))?new _((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=l.exec(t))?v(parseInt(e[1],16)):(e=c.exec(t))?new _(e[1],e[2],e[3],1):(e=u.exec(t))?new _(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=f.exec(t))?y(e[1],e[2],e[3],e[4]):(e=h.exec(t))?y(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=p.exec(t))?w(e[1],e[2]/100,e[3]/100,1):(e=d.exec(t))?w(e[1],e[2]/100,e[3]/100,e[4]):g.hasOwnProperty(t)?v(g[t]):"transparent"===t?new _(NaN,NaN,NaN,0):null}function v(t){return new _(t>>16&255,t>>8&255,255&t,1)}function y(t,e,r,n){return n<=0&&(t=e=r=NaN),new _(t,e,r,n)}function x(t){return t instanceof n||(t=m(t)),t?new _((t=t.rgb()).r,t.g,t.b,t.opacity):new _}function b(t,e,r,n){return 1===arguments.length?x(t):new _(t,e,r,null==n?1:n)}function _(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function w(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new M(t,e,r,n)}function k(t,e,r,i){return 1===arguments.length?function(t){if(t instanceof M)return new M(t.h,t.s,t.l,t.opacity);if(t instanceof n||(t=m(t)),!t)return new M;if(t instanceof M)return t;var e=(t=t.rgb()).r/255,r=t.g/255,i=t.b/255,a=Math.min(e,r,i),o=Math.max(e,r,i),s=NaN,l=o-a,c=(o+a)/2;return l?(s=e===o?(r-i)/l+6*(r0&&c<1?0:s,new M(s,l,c,t.opacity)}(t):new M(t,e,r,null==i?1:i)}function M(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function A(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}e(n,m,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),e(_,b,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),e(M,k,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new M(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new M(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new _(A(t>=240?t-240:t+120,i,n),A(t,i,n),A(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var T=Math.PI/180,S=180/Math.PI,C=.95047,E=1,L=1.08883,z=4/29,P=6/29,D=3*P*P,O=P*P*P;function I(t){if(t instanceof B)return new B(t.l,t.a,t.b,t.opacity);if(t instanceof q){var e=t.h*T;return new B(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof _||(t=x(t));var r=V(t.r),n=V(t.g),i=V(t.b),a=F((.4124564*r+.3575761*n+.1804375*i)/C),o=F((.2126729*r+.7151522*n+.072175*i)/E);return new B(116*o-16,500*(a-o),200*(o-F((.0193339*r+.119192*n+.9503041*i)/L)),t.opacity)}function R(t,e,r,n){return 1===arguments.length?I(t):new B(t,e,r,null==n?1:n)}function B(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function F(t){return t>O?Math.pow(t,1/3):t/D+z}function N(t){return t>P?t*t*t:D*(t-z)}function j(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function V(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function U(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof q)return new q(t.h,t.c,t.l,t.opacity);t instanceof B||(t=I(t));var e=Math.atan2(t.b,t.a)*S;return new q(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new q(t,e,r,null==n?1:n)}function q(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}e(B,R,r(n,{brighter:function(t){return new B(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new B(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return t=E*N(t),new _(j(3.2404542*(e=C*N(e))-1.5371385*t-.4985314*(r=L*N(r))),j(-.969266*e+1.8760108*t+.041556*r),j(.0556434*e-.2040259*t+1.0572252*r),this.opacity)}})),e(q,U,r(n,{brighter:function(t){return new q(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new q(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return I(this).rgb()}}));var H=-.14861,G=1.78277,W=-.29227,Y=-.90649,X=1.97294,Z=X*Y,J=X*G,K=G*W-Y*H;function Q(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof $)return new $(t.h,t.s,t.l,t.opacity);t instanceof _||(t=x(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(K*n+Z*e-J*r)/(K+Z-J),a=n-i,o=(X*(r-i)-W*a)/Y,s=Math.sqrt(o*o+a*a)/(X*i*(1-i)),l=s?Math.atan2(o,a)*S-120:NaN;return new $(l<0?l+360:l,s,i,t.opacity)}(t):new $(t,e,r,null==n?1:n)}function $(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}e($,Q,r(n,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new $(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new $(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*T,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new _(255*(e+r*(H*n+G*i)),255*(e+r*(W*n+Y*i)),255*(e+r*(X*n)),this.opacity)}})),t.color=m,t.rgb=b,t.hsl=k,t.lab=R,t.hcl=U,t.cubehelix=Q,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof r&&void 0!==e?r:n.d3=n.d3||{})},{}],126:[function(t,e,r){var n;n=this,function(t){"use strict";var e={value:function(){}};function r(){for(var t,e=0,r=arguments.length,i={};e =i.length)return e;var n=[],o=a[r++];return e.forEach(function(e,i){n.push({key:e,values:t(i,r)})}),o?n.sort(function(t,e){return o(t.key,e.key)}):n}(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new L;if(t)for(var r=0,n=t.length;r 360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new ae(a(t+120),a(t),a(t-120))}function Gt(e,r,n){return this instanceof Gt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Gt?new Gt(e.h,e.c,e.l):ee(e instanceof Xt?e.l:(e=he((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Gt(e,r,n)}qt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ut(this.h,this.s,this.l/t)},qt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ut(this.h,this.s,t*this.l)},qt.rgb=function(){return Ht(this.h,this.s,this.l)},t.hcl=Gt;var Wt=Gt.prototype=new Vt;function Yt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Xt(r,Math.cos(t*=Et)*e,Math.sin(t)*e)}function Xt(t,e,r){return this instanceof Xt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Xt?new Xt(t.l,t.a,t.b):t instanceof Gt?Yt(t.h,t.c,t.l):he((t=ae(t)).r,t.g,t.b):new Xt(t,e,r)}Wt.brighter=function(t){return new Gt(this.h,this.c,Math.min(100,this.l+Zt*(arguments.length?t:1)))},Wt.darker=function(t){return new Gt(this.h,this.c,Math.max(0,this.l-Zt*(arguments.length?t:1)))},Wt.rgb=function(){return Yt(this.h,this.c,this.l).rgb()},t.lab=Xt;var Zt=18,Jt=.95047,Kt=1,Qt=1.08883,$t=Xt.prototype=new Vt;function te(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new ae(ie(3.2404542*(i=re(i)*Jt)-1.5371385*(n=re(n)*Kt)-.4985314*(a=re(a)*Qt)),ie(-.969266*i+1.8760108*n+.041556*a),ie(.0556434*i-.2040259*n+1.0572252*a))}function ee(t,e,r){return t>0?new Gt(Math.atan2(r,e)*Lt,Math.sqrt(e*e+r*r),t):new Gt(NaN,NaN,t)}function re(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ne(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ie(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ae(t,e,r){return this instanceof ae?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ae?new ae(t.r,t.g,t.b):ue(""+t,ae,Ht):new ae(t,e,r)}function oe(t){return new ae(t>>16,t>>8&255,255&t)}function se(t){return oe(t)+""}$t.brighter=function(t){return new Xt(Math.min(100,this.l+Zt*(arguments.length?t:1)),this.a,this.b)},$t.darker=function(t){return new Xt(Math.max(0,this.l-Zt*(arguments.length?t:1)),this.a,this.b)},$t.rgb=function(){return te(this.l,this.a,this.b)},t.rgb=ae;var le=ae.prototype=new Vt;function ce(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ue(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(de(i[0]),de(i[1]),de(i[2]))}return(a=ge.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function fe(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e=o)d(c,u,E--,L=L-o|0);else if(L>=0)d(s,l,C--,L);else if(L<=-o){L=-L-o|0;for(var z=0;zs&&(r=s-l),a=r;a>=0;a--){for(var f=!0,h=0;h0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",u,"]"].join(""))),l.push("}")}return l.join("\n")}function a(t,e,r){for(var n=t.body,i=[],a=[],o=0;of;)h.pop(),--p;var d,g=new Array(p+1);for(a=0;a<=p;++a)(d=g[a]=[]).x0=a>0?h[a-1]:u,d.x1=a=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),K.hasOwnProperty(r)?{space:K[r],local:t}:t}},Y.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(Q(r,e[r]));return this}return this.each(Q(e,r))},Y.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=et(t)).length,i=-1;if(e=r.classList){for(;++i