forked from BIDS/colormap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
erics-RdBuGnYl_r_v2.py
282 lines (275 loc) · 13.2 KB
/
erics-RdBuGnYl_r_v2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
from matplotlib.colors import LinearSegmentedColormap
from numpy import nan, inf
# Used to reconstruct the colormap in viscm
parameters = {'xp': [28.782590300914933, 59.705365170024862, -27.718282299434122, -58.259294515838988, -31.917671479189778, -2.9037098736051519],
'yp': [16.928446771378731, -47.207678883071537, -85.002181500872581, 2.4214659685864035, 64.64877835951134, 25.70898778359512],
'min_JK': 18.0859375,
'max_JK': 95.0390625}
cm_data = [[ 0.30593816, 0.00266902, 0.0061051 ],
[ 0.31042433, 0.00290942, 0.01120144],
[ 0.31487482, 0.00316892, 0.01705532],
[ 0.31929522, 0.0034243 , 0.02377678],
[ 0.32368145, 0.00369108, 0.03138252],
[ 0.32803605, 0.00395683, 0.03996463],
[ 0.33235797, 0.00422464, 0.04889124],
[ 0.33664671, 0.00449568, 0.05769627],
[ 0.34090418, 0.00475769, 0.06646696],
[ 0.34512721, 0.00502718, 0.07518485],
[ 0.34931976, 0.00527747, 0.08394564],
[ 0.35347816, 0.00552999, 0.09270339],
[ 0.35760415, 0.00577067, 0.10150609],
[ 0.36169739, 0.00599854, 0.11036215],
[ 0.36575644, 0.00622388, 0.11924992],
[ 0.36978375, 0.00641944, 0.12823988],
[ 0.37377653, 0.00660885, 0.13727486],
[ 0.37773556, 0.00677996, 0.14638528],
[ 0.38166083, 0.00692606, 0.15558655],
[ 0.38555095, 0.00706076, 0.16484709],
[ 0.38940658, 0.00716518, 0.17420925],
[ 0.39322665, 0.00724735, 0.18365416],
[ 0.39701037, 0.00731401, 0.19316726],
[ 0.40075782, 0.00734338, 0.20279477],
[ 0.40446776, 0.0073515 , 0.21250246],
[ 0.40813946, 0.00734193, 0.22228406],
[ 0.41177227, 0.00729445, 0.23218125],
[ 0.41536508, 0.00722533, 0.24216243],
[ 0.41891698, 0.00713925, 0.25222092],
[ 0.42242671, 0.00702265, 0.2623854 ],
[ 0.42589305, 0.00688324, 0.27264414],
[ 0.42931493, 0.00673171, 0.28298143],
[ 0.43269091, 0.00656683, 0.29340481],
[ 0.43601883, 0.00637817, 0.30393878],
[ 0.4392978 , 0.00618789, 0.31455025],
[ 0.44252616, 0.00600087, 0.32523894],
[ 0.44570162, 0.00581503, 0.33601771],
[ 0.44882183, 0.00563345, 0.34689141],
[ 0.45188553, 0.00547601, 0.35783771],
[ 0.45489058, 0.00535163, 0.36885498],
[ 0.45783445, 0.00526797, 0.37994531],
[ 0.46071339, 0.00522487, 0.39112549],
[ 0.46352625, 0.00525017, 0.40236761],
[ 0.46627033, 0.00535829, 0.4136684 ],
[ 0.46894281, 0.00556525, 0.42502414],
[ 0.47154041, 0.00588686, 0.43643389],
[ 0.47405858, 0.00633428, 0.44790711],
[ 0.47649567, 0.00694065, 0.45941943],
[ 0.47884828, 0.00772963, 0.4709651 ],
[ 0.48111287, 0.008727 , 0.48253784],
[ 0.48328575, 0.00996081, 0.49413082],
[ 0.48536308, 0.01146143, 0.50573662],
[ 0.48733949, 0.01325656, 0.51735676],
[ 0.48921171, 0.01538581, 0.5289754 ],
[ 0.49097605, 0.01788916, 0.5405796 ],
[ 0.49262816, 0.02080706, 0.55215963],
[ 0.49416356, 0.02418258, 0.5637052 ],
[ 0.49557768, 0.02806141, 0.57520544],
[ 0.49686584, 0.03249183, 0.58664893],
[ 0.49802326, 0.03752463, 0.59802371],
[ 0.49904511, 0.04311441, 0.60931731],
[ 0.49992649, 0.0489259 , 0.62051677],
[ 0.50066244, 0.05493755, 0.63160869],
[ 0.50124802, 0.0611424 , 0.64257928],
[ 0.50167805, 0.06753394, 0.65341504],
[ 0.50194745, 0.07410605, 0.66410175],
[ 0.50205186, 0.08085257, 0.67462323],
[ 0.50198648, 0.08776732, 0.68496474],
[ 0.50174664, 0.09484406, 0.69511141],
[ 0.50132778, 0.10207645, 0.70504838],
[ 0.50072556, 0.10945796, 0.71476088],
[ 0.4999358 , 0.11698182, 0.72423428],
[ 0.4989546 , 0.124641 , 0.7334542 ],
[ 0.49777787, 0.13242856, 0.74240728],
[ 0.49640237, 0.14033686, 0.75107968],
[ 0.49482544, 0.14835776, 0.75945791],
[ 0.49304454, 0.15648302, 0.76752951],
[ 0.49105756, 0.16470409, 0.7752828 ],
[ 0.48886287, 0.17301214, 0.78270692],
[ 0.48645935, 0.18139813, 0.78979192],
[ 0.48384638, 0.18985275, 0.79652888],
[ 0.48102392, 0.19836655, 0.80290995],
[ 0.47799249, 0.20692994, 0.80892843],
[ 0.47475321, 0.21553323, 0.8145788 ],
[ 0.47130781, 0.2241667 , 0.81985683],
[ 0.46765864, 0.23282061, 0.82475954],
[ 0.46380866, 0.24148532, 0.82928527],
[ 0.45976146, 0.25015129, 0.83343365],
[ 0.45552028, 0.25880983, 0.83720573],
[ 0.45109112, 0.26745087, 0.84060357],
[ 0.44647941, 0.27606548, 0.84363073],
[ 0.44169113, 0.28464506, 0.846292 ],
[ 0.43673279, 0.29318136, 0.84859337],
[ 0.43161138, 0.30166653, 0.8505419 ],
[ 0.42633438, 0.31009317, 0.85214573],
[ 0.42090971, 0.3184543 , 0.85341395],
[ 0.41534564, 0.32674346, 0.85435652],
[ 0.40965092, 0.3349546 , 0.85498422],
[ 0.40383518, 0.34308189, 0.85530874],
[ 0.39790721, 0.35112065, 0.85534204],
[ 0.39187644, 0.35906651, 0.85509668],
[ 0.38575248, 0.36691561, 0.85458563],
[ 0.37954506, 0.37466461, 0.85382216],
[ 0.37326401, 0.3823107 , 0.85281975],
[ 0.36691922, 0.38985158, 0.85159201],
[ 0.3605206 , 0.3972854 , 0.85015258],
[ 0.35407804, 0.4046108 , 0.84851507],
[ 0.34760137, 0.41182688, 0.84669298],
[ 0.34110068, 0.418933 , 0.84469981],
[ 0.33458695, 0.42592852, 0.84254941],
[ 0.32806815, 0.43281442, 0.84025373],
[ 0.32155363, 0.43959135, 0.83782518],
[ 0.31505256, 0.44626026, 0.83527582],
[ 0.30857391, 0.45282241, 0.83261726],
[ 0.30212647, 0.45927932, 0.82986069],
[ 0.29571876, 0.46563275, 0.82701682],
[ 0.28935907, 0.47188468, 0.82409585],
[ 0.28305542, 0.47803728, 0.8211075 ],
[ 0.27681555, 0.48409289, 0.81806095],
[ 0.2706469 , 0.490054 , 0.81496488],
[ 0.26455658, 0.49592324, 0.81182741],
[ 0.25855138, 0.50170333, 0.80865617],
[ 0.25263771, 0.50739708, 0.80545824],
[ 0.24682158, 0.51300741, 0.80224018],
[ 0.24110863, 0.51853725, 0.79900805],
[ 0.23550404, 0.5239896 , 0.79576739],
[ 0.23001251, 0.5293675 , 0.79252325],
[ 0.22463828, 0.53467399, 0.78928019],
[ 0.21938504, 0.53991213, 0.78604229],
[ 0.21425593, 0.54508498, 0.78281317],
[ 0.20925351, 0.55019557, 0.77959598],
[ 0.20437973, 0.55524693, 0.77639345],
[ 0.1996359 , 0.56024206, 0.77320787],
[ 0.19502264, 0.56518393, 0.77004111],
[ 0.1905399 , 0.57007544, 0.76689464],
[ 0.18618694, 0.57491948, 0.76376952],
[ 0.18196229, 0.57971887, 0.76066644],
[ 0.17786378, 0.58447638, 0.75758571],
[ 0.17388852, 0.58919471, 0.75452729],
[ 0.17003294, 0.5938765 , 0.75149077],
[ 0.16629282, 0.59852432, 0.74847543],
[ 0.16266329, 0.60314065, 0.74548018],
[ 0.15913894, 0.60772792, 0.74250365],
[ 0.15571382, 0.61228846, 0.73954414],
[ 0.15238157, 0.61682451, 0.73659967],
[ 0.14913546, 0.62133823, 0.73366794],
[ 0.14596854, 0.62583169, 0.73074641],
[ 0.14287371, 0.63030686, 0.72783226],
[ 0.13984385, 0.63476561, 0.72492243],
[ 0.136872 , 0.63920971, 0.72201358],
[ 0.13395143, 0.64364082, 0.7191022 ],
[ 0.13107621, 0.64806046, 0.71618473],
[ 0.12824075, 0.65247006, 0.71325724],
[ 0.12543969, 0.65687103, 0.71031523],
[ 0.12266916, 0.66126459, 0.70735437],
[ 0.11992657, 0.66565184, 0.70437015],
[ 0.11721077, 0.67003376, 0.70135794],
[ 0.11452237, 0.6744112 , 0.69831295],
[ 0.11186399, 0.6787849 , 0.69523031],
[ 0.10924059, 0.68315548, 0.69210502],
[ 0.10665982, 0.68752341, 0.68893201],
[ 0.1041323 , 0.69188907, 0.68570614],
[ 0.10167206, 0.69625269, 0.6824222 ],
[ 0.09929685, 0.70061438, 0.67907498],
[ 0.09702849, 0.70497413, 0.67565922],
[ 0.09489316, 0.70933179, 0.67216965],
[ 0.09292157, 0.71368713, 0.66860104],
[ 0.09114857, 0.71803979, 0.66494786],
[ 0.08961373, 0.7223893 , 0.6612048 ],
[ 0.0883611 , 0.72673501, 0.65736696],
[ 0.08743755, 0.73107618, 0.65342925],
[ 0.0868919 , 0.73541198, 0.64938667],
[ 0.08677335, 0.73974145, 0.6452343 ],
[ 0.0871296 , 0.74406354, 0.64096731],
[ 0.08800467, 0.74837709, 0.63658099],
[ 0.08943689, 0.75268084, 0.63207074],
[ 0.09145705, 0.75697343, 0.62743205],
[ 0.09408706, 0.76125342, 0.62266056],
[ 0.09733931, 0.76551925, 0.61775204],
[ 0.10121671, 0.76976931, 0.61270239],
[ 0.10571346, 0.77400187, 0.60750764],
[ 0.11081631, 0.77821515, 0.60216396],
[ 0.11650607, 0.78240726, 0.59666767],
[ 0.12275934, 0.78657624, 0.59101523],
[ 0.12955007, 0.79072007, 0.58520325],
[ 0.13685091, 0.79483663, 0.57922847],
[ 0.14463436, 0.79892374, 0.5730878 ],
[ 0.15287364, 0.80297914, 0.56677828],
[ 0.16154321, 0.80700049, 0.56029714],
[ 0.17061924, 0.8109854 , 0.55364172],
[ 0.18007975, 0.81493137, 0.54680956],
[ 0.18990469, 0.81883585, 0.53979837],
[ 0.20007598, 0.82269619, 0.53260603],
[ 0.21057737, 0.82650969, 0.52523062],
[ 0.22139437, 0.83027354, 0.51767044],
[ 0.23251411, 0.83398486, 0.50992404],
[ 0.24392516, 0.83764066, 0.50199022],
[ 0.25561743, 0.8412379 , 0.4938681 ],
[ 0.26758204, 0.84477341, 0.48555716],
[ 0.2798111 , 0.84824393, 0.47705727],
[ 0.29229769, 0.8516461 , 0.46836882],
[ 0.30503911, 0.85497633, 0.45948804],
[ 0.31803459, 0.85823075, 0.45041063],
[ 0.3312734 , 0.86140581, 0.4411472 ],
[ 0.34475123, 0.86449765, 0.43170106],
[ 0.35846408, 0.86750233, 0.42207673],
[ 0.37240817, 0.87041578, 0.41228026],
[ 0.38658826, 0.87323309, 0.40230911],
[ 0.40100945, 0.87594898, 0.39216307],
[ 0.41565394, 0.87856011, 0.3818722 ],
[ 0.4305174 , 0.88106203, 0.37145274],
[ 0.44560988, 0.88344846, 0.36090778],
[ 0.46093466, 0.88571342, 0.35025332],
[ 0.4764647 , 0.88785471, 0.33954538],
[ 0.49220945, 0.88986546, 0.32880446],
[ 0.50817213, 0.89173917, 0.31806706],
[ 0.52431221, 0.89347602, 0.30742727],
[ 0.54066232, 0.89506473, 0.29691207],
[ 0.55716338, 0.89650912, 0.28666067],
[ 0.57382757, 0.89780123, 0.27675452],
[ 0.59059978, 0.89894578, 0.26736171],
[ 0.60747495, 0.89993864, 0.25862194],
[ 0.62437986, 0.90079066, 0.25075587],
[ 0.64129372, 0.90150303, 0.2439532 ],
[ 0.65813362, 0.9020926 , 0.23845876],
[ 0.67483995, 0.90257348, 0.23448842],
[ 0.69134066, 0.90296535, 0.232238 ],
[ 0.7075586 , 0.90329222, 0.231855 ],
[ 0.72342267, 0.90357961, 0.23341551],
[ 0.73886245, 0.90385588, 0.23691527],
[ 0.75384169, 0.90414168, 0.2422736 ],
[ 0.76828873, 0.90447092, 0.24933693],
[ 0.78221676, 0.90485188, 0.25792794],
[ 0.79558008, 0.90531303, 0.26782053],
[ 0.80842177, 0.90585258, 0.27883421],
[ 0.8207006 , 0.90649867, 0.29072839],
[ 0.83248598, 0.90723837, 0.30337614],
[ 0.84378474, 0.90808079, 0.31661371],
[ 0.85460273, 0.90903543, 0.33028474],
[ 0.86499688, 0.91008983, 0.3443259 ],
[ 0.87499154, 0.91124343, 0.35865065],
[ 0.88461129, 0.91249469, 0.3731879 ],
[ 0.89387855, 0.91384221, 0.38787579],
[ 0.90281044, 0.9152864 , 0.4026516 ],
[ 0.9114428 , 0.91681782, 0.41750661],
[ 0.91979668, 0.91843305, 0.43241222],
[ 0.9278919 , 0.92012856, 0.44734592],
[ 0.93574701, 0.9219008 , 0.46229025],
[ 0.94337929, 0.92374622, 0.47723183],
[ 0.95080035, 0.92566398, 0.49214548],
[ 0.95802315, 0.92765211, 0.50701436],
[ 0.96506661, 0.92970447, 0.52184916],
[ 0.97194366, 0.93181788, 0.53664677],
[ 0.97866617, 0.93398929, 0.55140545],
[ 0.98524501, 0.93621585, 0.56612453],
[ 0.99169013, 0.93849488, 0.58080418]]
test_cm = LinearSegmentedColormap.from_list(__file__, cm_data)
if __name__ == "__main__":
import matplotlib.pyplot as plt
import numpy as np
try:
from viscm import viscm
viscm(test_cm)
except ImportError:
print("viscm not found, falling back on simple display")
plt.imshow(np.linspace(0, 100, 256)[None, :], aspect='auto',
cmap=test_cm)
plt.show()