@niivue/niivue 0.41.1 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +1012 -1054
- package/build/index.js +1186 -380
- package/build/index.js.map +1 -1
- package/build/index.min.js +1 -1
- package/package.json +3 -5
- package/src/niivue/index.ts +863 -269
- package/src/nvcontroller.ts +1 -0
- package/src/nvdocument.ts +27 -13
- package/src/nvimage/index.ts +368 -127
- package/src/nvimage/utils.ts +36 -1
- package/src/nvlabel.ts +2 -0
- package/src/nvmesh-loaders.ts +1 -0
- package/src/nvutilities.ts +1 -0
- package/src/types.ts +16 -0
package/build/index.d.ts
CHANGED
|
@@ -109,6 +109,7 @@ declare enum LabelLineTerminator {
|
|
|
109
109
|
}
|
|
110
110
|
/**
|
|
111
111
|
* Class representing label style.
|
|
112
|
+
* @ignore
|
|
112
113
|
*/
|
|
113
114
|
declare class NVLabel3DStyle {
|
|
114
115
|
textColor: number[];
|
|
@@ -133,6 +134,7 @@ declare class NVLabel3DStyle {
|
|
|
133
134
|
}
|
|
134
135
|
/**
|
|
135
136
|
* Label class
|
|
137
|
+
* @ignore
|
|
136
138
|
*/
|
|
137
139
|
declare class NVLabel3D {
|
|
138
140
|
text: string;
|
|
@@ -146,724 +148,392 @@ declare class NVLabel3D {
|
|
|
146
148
|
constructor(text: string, style: NVLabel3DStyle, points?: number[] | number[][]);
|
|
147
149
|
}
|
|
148
150
|
|
|
149
|
-
type NiftiHeader = {
|
|
150
|
-
littleEndian: boolean;
|
|
151
|
-
dim_info: number;
|
|
152
|
-
dims: number[];
|
|
153
|
-
pixDims: number[];
|
|
154
|
-
intent_p1: number;
|
|
155
|
-
intent_p2: number;
|
|
156
|
-
intent_p3: number;
|
|
157
|
-
intent_code: number;
|
|
158
|
-
datatypeCode: number;
|
|
159
|
-
numBitsPerVoxel: number;
|
|
160
|
-
slice_start: number;
|
|
161
|
-
vox_offset: number;
|
|
162
|
-
scl_slope: number;
|
|
163
|
-
scl_inter: number;
|
|
164
|
-
slice_end: number;
|
|
165
|
-
slice_code: number;
|
|
166
|
-
xyzt_units: number;
|
|
167
|
-
cal_max: number;
|
|
168
|
-
cal_min: number;
|
|
169
|
-
slice_duration: number;
|
|
170
|
-
toffset: number;
|
|
171
|
-
description: string;
|
|
172
|
-
aux_file: string;
|
|
173
|
-
qform_code: number;
|
|
174
|
-
sform_code: number;
|
|
175
|
-
quatern_b: number;
|
|
176
|
-
quatern_c: number;
|
|
177
|
-
quatern_d: number;
|
|
178
|
-
qoffset_x: number;
|
|
179
|
-
qoffset_y: number;
|
|
180
|
-
qoffset_z: number;
|
|
181
|
-
affine: number[][];
|
|
182
|
-
intent_name: string;
|
|
183
|
-
magic: string;
|
|
184
|
-
};
|
|
185
|
-
type Volume = Record<string, any>;
|
|
186
|
-
type Point = {
|
|
187
|
-
comments: Array<{
|
|
188
|
-
text: string;
|
|
189
|
-
prefilled?: string;
|
|
190
|
-
}>;
|
|
191
|
-
coordinates: {
|
|
192
|
-
x: number;
|
|
193
|
-
y: number;
|
|
194
|
-
z: number;
|
|
195
|
-
};
|
|
196
|
-
};
|
|
197
151
|
/**
|
|
198
|
-
*
|
|
152
|
+
* Enum for NIfTI datatype codes
|
|
153
|
+
* // https://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1.h
|
|
199
154
|
*/
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
155
|
+
declare enum NiiDataType {
|
|
156
|
+
DT_NONE = 0,
|
|
157
|
+
DT_BINARY = 1,
|
|
158
|
+
DT_UINT8 = 2,
|
|
159
|
+
DT_INT16 = 4,
|
|
160
|
+
DT_INT32 = 8,
|
|
161
|
+
DT_FLOAT32 = 16,
|
|
162
|
+
DT_COMPLEX64 = 32,
|
|
163
|
+
DT_FLOAT64 = 64,
|
|
164
|
+
DT_RGB24 = 128,
|
|
165
|
+
DT_INT8 = 256,
|
|
166
|
+
DT_UINT16 = 512,
|
|
167
|
+
DT_UINT32 = 768,
|
|
168
|
+
DT_INT64 = 1024,
|
|
169
|
+
DT_UINT64 = 1280,
|
|
170
|
+
DT_FLOAT128 = 1536,
|
|
171
|
+
DT_COMPLEX128 = 1792,
|
|
172
|
+
DT_COMPLEX256 = 2048,
|
|
173
|
+
DT_RGBA32 = 2304
|
|
174
|
+
}
|
|
209
175
|
/**
|
|
210
|
-
*
|
|
176
|
+
* Enum for supported image types (e.g. NII, NRRD, DICOM)
|
|
211
177
|
*/
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
type
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
Y: number[];
|
|
240
|
-
Z: number[];
|
|
241
|
-
Color: number[];
|
|
242
|
-
Size: number[];
|
|
243
|
-
};
|
|
244
|
-
type LegacyConnectome = Partial<ConnectomeOptions> & {
|
|
245
|
-
nodes: LegacyNodes;
|
|
246
|
-
edges: number[];
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
type ValuesArray = Array<{
|
|
250
|
-
id: string;
|
|
251
|
-
vals: Float32Array;
|
|
252
|
-
global_min?: number;
|
|
253
|
-
global_max?: number;
|
|
178
|
+
declare enum ImageType {
|
|
179
|
+
UNKNOWN = 0,
|
|
180
|
+
NII = 1,
|
|
181
|
+
DCM = 2,
|
|
182
|
+
DCM_MANIFEST = 3,
|
|
183
|
+
MIH = 4,
|
|
184
|
+
MIF = 5,
|
|
185
|
+
NHDR = 6,
|
|
186
|
+
NRRD = 7,
|
|
187
|
+
MHD = 8,
|
|
188
|
+
MHA = 9,
|
|
189
|
+
MGH = 10,
|
|
190
|
+
MGZ = 11,
|
|
191
|
+
V = 12,
|
|
192
|
+
V16 = 13,
|
|
193
|
+
VMR = 14,
|
|
194
|
+
HEAD = 15,
|
|
195
|
+
DCM_FOLDER = 16
|
|
196
|
+
}
|
|
197
|
+
type ImageFromUrlOptions = {
|
|
198
|
+
url: string;
|
|
199
|
+
urlImageData?: string;
|
|
200
|
+
headers?: Record<string, string>;
|
|
201
|
+
name?: string;
|
|
202
|
+
colorMap?: string;
|
|
203
|
+
colormap?: string;
|
|
204
|
+
opacity?: number;
|
|
254
205
|
cal_min?: number;
|
|
255
206
|
cal_max?: number;
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
};
|
|
273
|
-
type TRX = {
|
|
274
|
-
pts: Float32Array;
|
|
275
|
-
offsetPt0: Uint32Array;
|
|
276
|
-
dpg: ValuesArray;
|
|
277
|
-
dps: ValuesArray;
|
|
278
|
-
dpv: ValuesArray;
|
|
279
|
-
header: unknown;
|
|
280
|
-
};
|
|
281
|
-
type TRK = {
|
|
282
|
-
pts: Float32Array;
|
|
283
|
-
offsetPt0: Uint32Array;
|
|
284
|
-
dps: ValuesArray;
|
|
285
|
-
dpv: ValuesArray;
|
|
286
|
-
};
|
|
287
|
-
type TCK = {
|
|
288
|
-
pts: Float32Array;
|
|
289
|
-
offsetPt0: Uint32Array;
|
|
290
|
-
};
|
|
291
|
-
type VTK = DefaultMeshType | {
|
|
292
|
-
pts: Float32Array;
|
|
293
|
-
offsetPt0: Uint32Array;
|
|
294
|
-
};
|
|
295
|
-
type ANNOT = Uint32Array | {
|
|
296
|
-
scalars: Float32Array;
|
|
297
|
-
colormapLabel: LUT;
|
|
298
|
-
};
|
|
299
|
-
type MZ3 = Float32Array | {
|
|
300
|
-
positions: Float32Array | null;
|
|
301
|
-
indices: Uint32Array | null;
|
|
302
|
-
scalars: Float32Array;
|
|
303
|
-
colors: Float32Array | null;
|
|
207
|
+
trustCalMinMax?: boolean;
|
|
208
|
+
percentileFrac?: number;
|
|
209
|
+
useQFormNotSForm?: boolean;
|
|
210
|
+
alphaThreshold?: boolean;
|
|
211
|
+
colormapNegative?: string;
|
|
212
|
+
cal_minNeg?: number;
|
|
213
|
+
cal_maxNeg?: number;
|
|
214
|
+
colorbarVisible?: boolean;
|
|
215
|
+
ignoreZeroVoxels?: boolean;
|
|
216
|
+
imageType?: ImageType;
|
|
217
|
+
frame4D?: number;
|
|
218
|
+
colormapLabel?: string[];
|
|
219
|
+
pairedImgData?: null;
|
|
220
|
+
limitFrames4D?: number;
|
|
221
|
+
isManifest?: boolean;
|
|
222
|
+
urlImgData?: string;
|
|
304
223
|
};
|
|
305
|
-
type
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
224
|
+
type ImageFromFileOptions = {
|
|
225
|
+
file: File | File[];
|
|
226
|
+
name?: string;
|
|
227
|
+
colormap?: string;
|
|
228
|
+
opacity?: number;
|
|
229
|
+
urlImgData?: File | null;
|
|
230
|
+
cal_min?: number;
|
|
231
|
+
cal_max?: number;
|
|
232
|
+
trustCalMinMax?: boolean;
|
|
233
|
+
percentileFrac?: number;
|
|
234
|
+
ignoreZeroVoxels?: boolean;
|
|
235
|
+
useQFormNotSForm?: boolean;
|
|
236
|
+
colormapNegative?: string;
|
|
237
|
+
imageType?: ImageType;
|
|
238
|
+
frame4D?: number;
|
|
239
|
+
limitFrames4D?: number;
|
|
311
240
|
};
|
|
312
|
-
type
|
|
313
|
-
|
|
314
|
-
|
|
241
|
+
type ImageFromBase64 = {
|
|
242
|
+
base64: string;
|
|
243
|
+
name?: string;
|
|
244
|
+
colormap?: string;
|
|
245
|
+
opacity?: number;
|
|
246
|
+
cal_min?: number;
|
|
247
|
+
cal_max?: number;
|
|
248
|
+
trustCalMinMax?: boolean;
|
|
249
|
+
percentileFrac?: number;
|
|
250
|
+
ignoreZeroVoxels?: boolean;
|
|
315
251
|
};
|
|
316
|
-
type
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
252
|
+
type ImageMetadata = {
|
|
253
|
+
id: string;
|
|
254
|
+
datatypeCode: number;
|
|
255
|
+
nx: number;
|
|
256
|
+
ny: number;
|
|
257
|
+
nz: number;
|
|
258
|
+
nt: number;
|
|
259
|
+
dx: number;
|
|
260
|
+
dy: number;
|
|
261
|
+
dz: number;
|
|
262
|
+
dt: number;
|
|
263
|
+
bpv: number;
|
|
320
264
|
};
|
|
265
|
+
declare const NVImageFromUrlOptions: (url: string, urlImageData?: string, name?: string, colormap?: string, opacity?: number, cal_min?: number, cal_max?: number, trustCalMinMax?: boolean, percentileFrac?: number, ignoreZeroVoxels?: boolean, useQFormNotSForm?: boolean, colormapNegative?: string, frame4D?: number, imageType?: ImageType, cal_minNeg?: number, cal_maxNeg?: number, colorbarVisible?: boolean, alphaThreshold?: boolean, colormapLabel?: string[]) => ImageFromUrlOptions;
|
|
321
266
|
|
|
322
|
-
|
|
267
|
+
type TypedVoxelArray = Float32Array | Uint8Array | Int16Array | Float64Array | Uint16Array;
|
|
268
|
+
/**
|
|
269
|
+
* a NVImage encapsulates some images data and provides methods to query and operate on images
|
|
323
270
|
*/
|
|
324
|
-
declare
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
FIBER = "fiber"
|
|
328
|
-
}
|
|
329
|
-
type NVMeshLayer = {
|
|
330
|
-
name?: string;
|
|
331
|
-
key?: string;
|
|
271
|
+
declare class NVImage {
|
|
272
|
+
name: string;
|
|
273
|
+
id: string;
|
|
332
274
|
url?: string;
|
|
333
275
|
headers?: Record<string, string>;
|
|
334
|
-
|
|
335
|
-
|
|
276
|
+
_colormap: string;
|
|
277
|
+
_opacity: number;
|
|
278
|
+
percentileFrac: number;
|
|
279
|
+
ignoreZeroVoxels: boolean;
|
|
280
|
+
trustCalMinMax: boolean;
|
|
336
281
|
colormapNegative: string;
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
cal_min: number;
|
|
343
|
-
cal_max: number;
|
|
282
|
+
colormapLabel: LUT | null;
|
|
283
|
+
colormapInvert?: boolean;
|
|
284
|
+
nFrame4D?: number;
|
|
285
|
+
frame4D: number;
|
|
286
|
+
nTotalFrame4D?: number;
|
|
344
287
|
cal_minNeg: number;
|
|
345
288
|
cal_maxNeg: number;
|
|
346
|
-
isAdditiveBlend: boolean;
|
|
347
|
-
frame4D: number;
|
|
348
|
-
nFrame4D: number;
|
|
349
|
-
values: number[];
|
|
350
|
-
outlineBorder?: number;
|
|
351
|
-
isTransparentBelowCalMin?: boolean;
|
|
352
|
-
alphaThreshold: boolean;
|
|
353
|
-
base64?: string;
|
|
354
|
-
colorbarVisible?: boolean;
|
|
355
|
-
};
|
|
356
|
-
declare class NVMeshFromUrlOptions {
|
|
357
|
-
url: string;
|
|
358
|
-
gl: WebGL2RenderingContext | null;
|
|
359
|
-
name: string;
|
|
360
|
-
opacity: number;
|
|
361
|
-
rgba255: Uint8Array;
|
|
362
|
-
visible: boolean;
|
|
363
|
-
layers: NVMeshLayer[];
|
|
364
|
-
colorbarVisible: boolean;
|
|
365
|
-
constructor(url?: string, gl?: null, name?: string, opacity?: number, rgba255?: Uint8Array, visible?: boolean, layers?: never[], colorbarVisible?: boolean);
|
|
366
|
-
}
|
|
367
|
-
type BaseLoadParams = {
|
|
368
|
-
gl: WebGL2RenderingContext;
|
|
369
|
-
name: string;
|
|
370
|
-
opacity: number;
|
|
371
|
-
rgba255: number[] | Uint8Array;
|
|
372
|
-
visible: boolean;
|
|
373
|
-
layers: NVMeshLayer[];
|
|
374
|
-
};
|
|
375
|
-
type LoadFromUrlParams = Partial<BaseLoadParams> & {
|
|
376
|
-
url: string;
|
|
377
|
-
headers?: Record<string, string>;
|
|
378
|
-
};
|
|
379
|
-
type LoadFromFileParams = BaseLoadParams & {
|
|
380
|
-
file: Blob;
|
|
381
|
-
};
|
|
382
|
-
type LoadFromBase64Params = BaseLoadParams & {
|
|
383
|
-
base64: string;
|
|
384
|
-
};
|
|
385
|
-
/**
|
|
386
|
-
* a NVMesh encapsulates some mesh data and provides methods to query and operate on meshes
|
|
387
|
-
*/
|
|
388
|
-
declare class NVMesh {
|
|
389
|
-
id: string;
|
|
390
|
-
name: string;
|
|
391
|
-
anatomicalStructurePrimary: string;
|
|
392
289
|
colorbarVisible: boolean;
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
nodeMaxColor?: number;
|
|
438
|
-
edgeMin?: number;
|
|
439
|
-
edgeMax?: number;
|
|
440
|
-
nodes?: LegacyNodes | NVConnectomeNode[];
|
|
441
|
-
edges?: number[] | NVConnectomeEdge[];
|
|
442
|
-
points?: Point[];
|
|
290
|
+
modulationImage: number | null;
|
|
291
|
+
modulateAlpha: number;
|
|
292
|
+
series: any;
|
|
293
|
+
nVox3D?: number;
|
|
294
|
+
oblique_angle?: number;
|
|
295
|
+
maxShearDeg?: number;
|
|
296
|
+
useQFormNotSForm: boolean;
|
|
297
|
+
alphaThreshold?: number;
|
|
298
|
+
pixDims?: number[];
|
|
299
|
+
matRAS?: mat4;
|
|
300
|
+
pixDimsRAS?: number[];
|
|
301
|
+
obliqueRAS?: mat4;
|
|
302
|
+
dimsRAS?: number[];
|
|
303
|
+
permRAS?: number[];
|
|
304
|
+
img2RASstep?: number[];
|
|
305
|
+
img2RASstart?: number[];
|
|
306
|
+
toRAS?: mat4;
|
|
307
|
+
toRASvox?: mat4;
|
|
308
|
+
frac2mm?: mat4;
|
|
309
|
+
frac2mmOrtho?: mat4;
|
|
310
|
+
extentsMinOrtho?: number[];
|
|
311
|
+
extentsMaxOrtho?: number[];
|
|
312
|
+
mm2ortho?: mat4;
|
|
313
|
+
hdr: nifti.NIFTI1 | nifti.NIFTI2 | null;
|
|
314
|
+
imageType?: ImageType;
|
|
315
|
+
img?: TypedVoxelArray;
|
|
316
|
+
imaginary?: Float32Array;
|
|
317
|
+
fileObject?: File | File[];
|
|
318
|
+
dims?: number[];
|
|
319
|
+
onColormapChange: (img: NVImage) => void;
|
|
320
|
+
onOpacityChange: (img: NVImage) => void;
|
|
321
|
+
mm000?: vec3;
|
|
322
|
+
mm100?: vec3;
|
|
323
|
+
mm010?: vec3;
|
|
324
|
+
mm001?: vec3;
|
|
325
|
+
cal_min?: number;
|
|
326
|
+
cal_max?: number;
|
|
327
|
+
robust_min?: number;
|
|
328
|
+
robust_max?: number;
|
|
329
|
+
global_min?: number;
|
|
330
|
+
global_max?: number;
|
|
331
|
+
urlImgData?: string;
|
|
332
|
+
isManifest?: boolean;
|
|
333
|
+
limitFrames4D?: number;
|
|
443
334
|
/**
|
|
444
|
-
*
|
|
445
|
-
* @param
|
|
335
|
+
*
|
|
336
|
+
* @param dataBuffer - an array buffer of image data to load (there are also methods that abstract this more. See loadFromUrl, and loadFromFile)
|
|
446
337
|
* @param name - a name for this image. Default is an empty string
|
|
447
|
-
* @param
|
|
448
|
-
* @param opacity - the opacity for this
|
|
449
|
-
* @param
|
|
450
|
-
* @param
|
|
451
|
-
* @param
|
|
452
|
-
* @param
|
|
453
|
-
* @param
|
|
454
|
-
* @param
|
|
455
|
-
* @param
|
|
456
|
-
* @param
|
|
338
|
+
* @param colormap - a color map to use. default is gray
|
|
339
|
+
* @param opacity - the opacity for this image. default is 1
|
|
340
|
+
* @param pairedImgData - Allows loading formats where header and image are separate files (e.g. nifti.hdr, nifti.img)
|
|
341
|
+
* @param cal_min - minimum intensity for color brightness/contrast
|
|
342
|
+
* @param cal_max - maximum intensity for color brightness/contrast
|
|
343
|
+
* @param trustCalMinMax - whether or not to trust cal_min and cal_max from the nifti header (trusting results in faster loading)
|
|
344
|
+
* @param percentileFrac - the percentile to use for setting the robust range of the display values (smart intensity setting for images with large ranges)
|
|
345
|
+
* @param ignoreZeroVoxels - whether or not to ignore zero voxels in setting the robust range of display values
|
|
346
|
+
* @param useQFormNotSForm - give precedence to QForm (Quaternion) or SForm (Matrix)
|
|
347
|
+
* @param colormapNegative - a color map to use for symmetrical negative intensities
|
|
348
|
+
* @param frame4D - volume displayed, 0 indexed, must be less than nFrame4D
|
|
349
|
+
*
|
|
350
|
+
* FIXME the following params are documented but not included in the actual constructor
|
|
351
|
+
* @param onColormapChange - callback for color map change
|
|
352
|
+
* @param onOpacityChange -callback for color map change
|
|
353
|
+
*
|
|
354
|
+
* TODO the following parameters were not documented
|
|
355
|
+
* @param imageType - TODO
|
|
356
|
+
* @param cal_minNeg - TODO
|
|
357
|
+
* @param cal_maxNeg - TODO
|
|
358
|
+
* @param colorbarVisible - TODO
|
|
359
|
+
* @param colormapLabel - TODO
|
|
457
360
|
*/
|
|
458
|
-
constructor(
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
361
|
+
constructor(dataBuffer?: ArrayBuffer | ArrayBuffer[] | null, name?: string, colormap?: string, opacity?: number, pairedImgData?: ArrayBuffer | null, cal_min?: number, cal_max?: number, trustCalMinMax?: boolean, percentileFrac?: number, ignoreZeroVoxels?: boolean, useQFormNotSForm?: boolean, colormapNegative?: string, frame4D?: number, imageType?: ImageType, cal_minNeg?: number, cal_maxNeg?: number, colorbarVisible?: boolean, colormapLabel?: LUT | null);
|
|
362
|
+
computeObliqueAngle(mtx44: mat4): number;
|
|
363
|
+
calculateOblique(): void;
|
|
364
|
+
THD_daxes_to_NIFTI(xyzDelta: number[], xyzOrigin: number[], orientSpecific: number[]): void;
|
|
365
|
+
SetPixDimFromSForm(): void;
|
|
366
|
+
readDICOM(buf: ArrayBuffer | ArrayBuffer[]): ArrayBuffer;
|
|
367
|
+
readECAT(buffer: ArrayBuffer): ArrayBuffer;
|
|
368
|
+
readV16(buffer: ArrayBuffer): ArrayBuffer;
|
|
369
|
+
readVMR(buffer: ArrayBuffer): ArrayBuffer;
|
|
370
|
+
readMGH(buffer: ArrayBuffer): ArrayBuffer;
|
|
371
|
+
readHEAD(dataBuffer: ArrayBuffer, pairedImgData: ArrayBuffer | null): ArrayBuffer;
|
|
372
|
+
readMHA(buffer: ArrayBuffer, pairedImgData: ArrayBuffer | null): ArrayBuffer;
|
|
373
|
+
readMIF(buffer: ArrayBuffer, pairedImgData: ArrayBuffer | null): ArrayBuffer;
|
|
374
|
+
readNRRD(dataBuffer: ArrayBuffer, pairedImgData: ArrayBuffer | null): ArrayBuffer;
|
|
375
|
+
calculateRAS(): void;
|
|
376
|
+
img2RAS(): TypedVoxelArray;
|
|
377
|
+
vox2mm(XYZ: number[], mtx: mat4): vec3;
|
|
378
|
+
mm2vox(mm: number[], frac?: boolean): Float32Array | vec3;
|
|
379
|
+
arrayEquals(a: unknown[], b: unknown[]): boolean;
|
|
380
|
+
setColormap(cm: string): void;
|
|
381
|
+
setColormapLabel(cm: ColorMap): void;
|
|
382
|
+
setColormapLabelFromUrl(url: string): Promise<void>;
|
|
383
|
+
get colormap(): string;
|
|
384
|
+
get colorMap(): string;
|
|
385
|
+
set colormap(cm: string);
|
|
386
|
+
set colorMap(cm: string);
|
|
387
|
+
get opacity(): number;
|
|
388
|
+
set opacity(opacity: number);
|
|
389
|
+
calMinMax(): number[];
|
|
390
|
+
intensityRaw2Scaled(raw: number): number;
|
|
391
|
+
intensityScaled2Raw(scaled: number): number;
|
|
392
|
+
saveToUint8Array(fnm: string, drawing8?: Uint8Array | null): Uint8Array;
|
|
393
|
+
saveToDisk(fnm?: string, drawing8?: Uint8Array | null): Uint8Array;
|
|
394
|
+
static fetchDicomData(url: string, headers?: Record<string, string>): Promise<ArrayBuffer[]>;
|
|
395
|
+
static fetchPartial(url: string, bytesToLoad: number, headers?: Record<string, string>): Promise<Response>;
|
|
470
396
|
/**
|
|
471
|
-
* factory function to load and return a new
|
|
397
|
+
* factory function to load and return a new NVImage instance from a given URL
|
|
398
|
+
* @returns NVImage instance
|
|
472
399
|
*/
|
|
473
|
-
static loadFromUrl({ url,
|
|
474
|
-
|
|
400
|
+
static loadFromUrl({ url, urlImgData, headers, name, colormap, opacity, cal_min, cal_max, trustCalMinMax, percentileFrac, ignoreZeroVoxels, useQFormNotSForm, colormapNegative, frame4D, isManifest, limitFrames4D, imageType, colorbarVisible }?: Partial<Omit<ImageFromUrlOptions, 'url'>> & {
|
|
401
|
+
url?: string | Uint8Array | ArrayBuffer;
|
|
402
|
+
}): Promise<NVImage>;
|
|
403
|
+
static readFileAsync(file: File, bytesToLoad?: number): Promise<ArrayBuffer>;
|
|
475
404
|
/**
|
|
476
|
-
* factory function to load and return a new
|
|
477
|
-
*
|
|
478
|
-
* @returns NVMesh instance
|
|
405
|
+
* factory function to load and return a new NVImage instance from a file in the browser
|
|
479
406
|
*/
|
|
480
|
-
static loadFromFile({ file,
|
|
407
|
+
static loadFromFile({ file, // file can be an array of file objects or a single file object
|
|
408
|
+
name, colormap, opacity, urlImgData, cal_min, cal_max, trustCalMinMax, percentileFrac, ignoreZeroVoxels, useQFormNotSForm, colormapNegative, frame4D, limitFrames4D, imageType }: ImageFromFileOptions): Promise<NVImage>;
|
|
481
409
|
/**
|
|
482
|
-
* load and return a new
|
|
410
|
+
* factory function to load and return a new NVImage instance from a base64 encoded string
|
|
411
|
+
*
|
|
412
|
+
* @returns NVImage instance
|
|
413
|
+
* @example
|
|
414
|
+
* myImage = NVImage.loadFromBase64('SomeBase64String')
|
|
483
415
|
*/
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
static
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
static
|
|
512
|
-
|
|
513
|
-
|
|
416
|
+
static createNiftiArray(dims?: number[], pixDims?: number[], affine?: number[], datatypeCode?: number, // DT_UINT8
|
|
417
|
+
img?: Uint8Array): Uint8Array;
|
|
418
|
+
static createNiftiHeader(dims?: number[], pixDims?: number[], affine?: number[], datatypeCode?: number): nifti.NIFTI1;
|
|
419
|
+
/**
|
|
420
|
+
* read a 3D slab of voxels from a volume
|
|
421
|
+
* @param voxStart - first row, column and slice (RAS order) for selection
|
|
422
|
+
* @param voxEnd - final row, column and slice (RAS order) for selection
|
|
423
|
+
* @param dataType - array data type. Options: 'same' (default), 'uint8', 'float32'
|
|
424
|
+
* @returns the an array where ret[0] is the voxel values and ret[1] is dimension of selection
|
|
425
|
+
* @see {@link https://niivue.github.io/niivue/features/slab_selection.html | live demo usage}
|
|
426
|
+
*/
|
|
427
|
+
getVolumeData(voxStart?: number[], voxEnd?: number[], dataType?: string): [TypedVoxelArray, number[]];
|
|
428
|
+
/**
|
|
429
|
+
* write a 3D slab of voxels from a volume
|
|
430
|
+
* @param voxStart - first row, column and slice (RAS order) for selection
|
|
431
|
+
* @param voxEnd - final row, column and slice (RAS order) for selection
|
|
432
|
+
* @param img - array of voxel values to insert (RAS order)
|
|
433
|
+
* @see {@link https://niivue.github.io/niivue/features/slab_selection.html | live demo usage}
|
|
434
|
+
*/
|
|
435
|
+
setVolumeData(voxStart?: number[], voxEnd?: number[], img?: TypedVoxelArray): void;
|
|
436
|
+
/**
|
|
437
|
+
* factory function to load and return a new NVImage instance from a base64 encoded string
|
|
438
|
+
*
|
|
439
|
+
* @returns NVImage instance
|
|
440
|
+
* @example
|
|
441
|
+
* myImage = NVImage.loadFromBase64('SomeBase64String')
|
|
442
|
+
*/
|
|
443
|
+
static loadFromBase64({ base64, name, colormap, opacity, cal_min, cal_max, trustCalMinMax, percentileFrac, ignoreZeroVoxels }: ImageFromBase64): NVImage;
|
|
444
|
+
/**
|
|
445
|
+
* make a clone of a NVImage instance and return a new NVImage
|
|
446
|
+
* @returns NVImage instance
|
|
447
|
+
* @example
|
|
448
|
+
* myImage = NVImage.loadFromFile(SomeFileObject) // files can be from dialogs or drag and drop
|
|
449
|
+
* clonedImage = myImage.clone()
|
|
450
|
+
*/
|
|
451
|
+
clone(): NVImage;
|
|
452
|
+
/**
|
|
453
|
+
* fill a NVImage instance with zeros for the image data
|
|
454
|
+
* @example
|
|
455
|
+
* myImage = NVImage.loadFromFile(SomeFileObject) // files can be from dialogs or drag and drop
|
|
456
|
+
* clonedImageWithZeros = myImage.clone().zeroImage()
|
|
457
|
+
*/
|
|
458
|
+
zeroImage(): void;
|
|
459
|
+
/**
|
|
460
|
+
* get nifti specific metadata about the image
|
|
461
|
+
*/
|
|
462
|
+
getImageMetadata(): ImageMetadata;
|
|
463
|
+
/**
|
|
464
|
+
* a factory function to make a zero filled image given a NVImage as a reference
|
|
465
|
+
* @param nvImage - an existing NVImage as a reference
|
|
466
|
+
* @param dataType - the output data type. Options: 'same', 'uint8'
|
|
467
|
+
* @returns new NVImage filled with zeros for the image data
|
|
468
|
+
* @example
|
|
469
|
+
* myImage = NVImage.loadFromFile(SomeFileObject) // files can be from dialogs or drag and drop
|
|
470
|
+
* newZeroImage = NVImage.zerosLike(myImage)
|
|
471
|
+
*/
|
|
472
|
+
static zerosLike(nvImage: NVImage, dataType?: string): NVImage;
|
|
473
|
+
getValue(x: number, y: number, z: number, frame4D?: number, isReadImaginary?: boolean): number;
|
|
474
|
+
/**
|
|
475
|
+
* @param id - id of 3D Object (is this the base volume or an overlay?)
|
|
476
|
+
* @param gl - WebGL rendering context
|
|
477
|
+
* @returns new 3D object in model space
|
|
478
|
+
*/
|
|
479
|
+
toNiivueObject3D(id: number, gl: WebGL2RenderingContext): NiivueObject3D;
|
|
480
|
+
/**
|
|
481
|
+
* Update options for image
|
|
482
|
+
*/
|
|
483
|
+
applyOptionsUpdate(options: ImageFromUrlOptions): void;
|
|
484
|
+
getImageOptions(): ImageFromUrlOptions;
|
|
485
|
+
/**
|
|
486
|
+
* Converts NVImage to NIfTI compliant byte array
|
|
487
|
+
*/
|
|
488
|
+
toUint8Array(drawingBytes?: Uint8Array | null): Uint8Array;
|
|
489
|
+
convertVox2Frac(vox: vec3): vec3;
|
|
490
|
+
convertFrac2Vox(frac: vec3): vec3;
|
|
491
|
+
convertFrac2MM(frac: vec3, isForceSliceMM?: boolean): vec4;
|
|
492
|
+
convertMM2Frac(mm: vec3 | vec4, isForceSliceMM?: boolean): vec3;
|
|
514
493
|
}
|
|
515
494
|
|
|
495
|
+
type FreeSurferConnectome = {
|
|
496
|
+
data_type: string;
|
|
497
|
+
points: Array<{
|
|
498
|
+
comments?: Array<{
|
|
499
|
+
text: string;
|
|
500
|
+
}>;
|
|
501
|
+
coordinates: {
|
|
502
|
+
x: number;
|
|
503
|
+
y: number;
|
|
504
|
+
z: number;
|
|
505
|
+
};
|
|
506
|
+
}>;
|
|
507
|
+
};
|
|
516
508
|
/**
|
|
517
|
-
*
|
|
509
|
+
* Represents a connectome
|
|
518
510
|
*/
|
|
519
|
-
declare
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
511
|
+
declare class NVConnectome extends NVMesh {
|
|
512
|
+
gl: WebGL2RenderingContext;
|
|
513
|
+
nodesChanged: EventTarget;
|
|
514
|
+
constructor(gl: WebGL2RenderingContext, connectome: LegacyConnectome);
|
|
515
|
+
static convertLegacyConnectome(json: LegacyConnectome): Connectome;
|
|
516
|
+
static convertFreeSurferConnectome(json: FreeSurferConnectome, colormap?: string): Connectome;
|
|
517
|
+
updateLabels(): void;
|
|
518
|
+
addConnectomeNode(node: NVConnectomeNode): void;
|
|
519
|
+
deleteConnectomeNode(node: NVConnectomeNode): void;
|
|
520
|
+
updateConnectomeNodeByIndex(index: number, updatedNode: NVConnectomeNode): void;
|
|
521
|
+
updateConnectomeNodeByPoint(point: [number, number, number], updatedNode: NVConnectomeNode): void;
|
|
522
|
+
addConnectomeEdge(first: number, second: number, colorValue: number): NVConnectomeEdge;
|
|
523
|
+
deleteConnectomeEdge(first: number, second: number): NVConnectomeEdge;
|
|
524
|
+
findClosestConnectomeNode(point: number[], distance: number): NVConnectomeNode | null;
|
|
525
|
+
updateConnectome(gl: WebGL2RenderingContext): void;
|
|
526
|
+
updateMesh(gl: WebGL2RenderingContext): void;
|
|
527
|
+
json(): Connectome;
|
|
528
|
+
/**
|
|
529
|
+
* Factory method to create connectome from options
|
|
530
|
+
*/
|
|
531
|
+
static loadConnectomeFromUrl(gl: WebGL2RenderingContext, url: string): Promise<NVConnectome>;
|
|
537
532
|
}
|
|
538
|
-
type ImageFromUrlOptions = {
|
|
539
|
-
url: string;
|
|
540
|
-
urlImageData?: string;
|
|
541
|
-
headers?: Record<string, string>;
|
|
542
|
-
name?: string;
|
|
543
|
-
colorMap?: string;
|
|
544
|
-
colormap?: string;
|
|
545
|
-
opacity?: number;
|
|
546
|
-
cal_min?: number;
|
|
547
|
-
cal_max?: number;
|
|
548
|
-
trustCalMinMax?: boolean;
|
|
549
|
-
percentileFrac?: number;
|
|
550
|
-
useQFormNotSForm?: boolean;
|
|
551
|
-
alphaThreshold?: boolean;
|
|
552
|
-
colormapNegative?: string;
|
|
553
|
-
cal_minNeg?: number;
|
|
554
|
-
cal_maxNeg?: number;
|
|
555
|
-
colorbarVisible?: boolean;
|
|
556
|
-
ignoreZeroVoxels?: boolean;
|
|
557
|
-
imageType?: ImageType;
|
|
558
|
-
frame4D?: number;
|
|
559
|
-
colormapLabel?: string[];
|
|
560
|
-
pairedImgData?: null;
|
|
561
|
-
limitFrames4D?: number;
|
|
562
|
-
isManifest?: boolean;
|
|
563
|
-
urlImgData?: string;
|
|
564
|
-
};
|
|
565
|
-
type ImageFromFileOptions = {
|
|
566
|
-
file: File | File[];
|
|
567
|
-
name?: string;
|
|
568
|
-
colormap?: string;
|
|
569
|
-
opacity?: number;
|
|
570
|
-
urlImgData?: File | null;
|
|
571
|
-
cal_min?: number;
|
|
572
|
-
cal_max?: number;
|
|
573
|
-
trustCalMinMax?: boolean;
|
|
574
|
-
percentileFrac?: number;
|
|
575
|
-
ignoreZeroVoxels?: boolean;
|
|
576
|
-
useQFormNotSForm?: boolean;
|
|
577
|
-
colormapNegative?: string;
|
|
578
|
-
imageType?: ImageType;
|
|
579
|
-
frame4D?: number;
|
|
580
|
-
limitFrames4D?: number;
|
|
581
|
-
};
|
|
582
|
-
type ImageFromBase64 = {
|
|
583
|
-
base64: string;
|
|
584
|
-
name?: string;
|
|
585
|
-
colormap?: string;
|
|
586
|
-
opacity?: number;
|
|
587
|
-
cal_min?: number;
|
|
588
|
-
cal_max?: number;
|
|
589
|
-
trustCalMinMax?: boolean;
|
|
590
|
-
percentileFrac?: number;
|
|
591
|
-
ignoreZeroVoxels?: boolean;
|
|
592
|
-
};
|
|
593
|
-
type ImageMetadata = {
|
|
594
|
-
id: string;
|
|
595
|
-
datatypeCode: number;
|
|
596
|
-
nx: number;
|
|
597
|
-
ny: number;
|
|
598
|
-
nz: number;
|
|
599
|
-
nt: number;
|
|
600
|
-
dx: number;
|
|
601
|
-
dy: number;
|
|
602
|
-
dz: number;
|
|
603
|
-
dt: number;
|
|
604
|
-
bpv: number;
|
|
605
|
-
};
|
|
606
|
-
declare const NVImageFromUrlOptions: (url: string, urlImageData?: string, name?: string, colormap?: string, opacity?: number, cal_min?: number, cal_max?: number, trustCalMinMax?: boolean, percentileFrac?: number, ignoreZeroVoxels?: boolean, useQFormNotSForm?: boolean, colormapNegative?: string, frame4D?: number, imageType?: ImageType, cal_minNeg?: number, cal_maxNeg?: number, colorbarVisible?: boolean, alphaThreshold?: boolean, colormapLabel?: string[]) => ImageFromUrlOptions;
|
|
607
533
|
|
|
608
534
|
/**
|
|
609
|
-
*
|
|
610
|
-
|
|
611
|
-
declare class NVImage {
|
|
612
|
-
name: string;
|
|
613
|
-
id: string;
|
|
614
|
-
url?: string;
|
|
615
|
-
headers?: Record<string, string>;
|
|
616
|
-
_colormap: string;
|
|
617
|
-
_opacity: number;
|
|
618
|
-
percentileFrac: number;
|
|
619
|
-
ignoreZeroVoxels: boolean;
|
|
620
|
-
trustCalMinMax: boolean;
|
|
621
|
-
colormapNegative: string;
|
|
622
|
-
colormapLabel: LUT | null;
|
|
623
|
-
colormapInvert?: boolean;
|
|
624
|
-
nFrame4D?: number;
|
|
625
|
-
frame4D: number;
|
|
626
|
-
nTotalFrame4D?: number;
|
|
627
|
-
cal_minNeg: number;
|
|
628
|
-
cal_maxNeg: number;
|
|
629
|
-
colorbarVisible: boolean;
|
|
630
|
-
modulationImage: number | null;
|
|
631
|
-
modulateAlpha: number;
|
|
632
|
-
series: any;
|
|
633
|
-
nVox3D?: number;
|
|
634
|
-
oblique_angle?: number;
|
|
635
|
-
maxShearDeg?: number;
|
|
636
|
-
useQFormNotSForm: boolean;
|
|
637
|
-
alphaThreshold?: number;
|
|
638
|
-
pixDims?: number[];
|
|
639
|
-
matRAS?: mat4;
|
|
640
|
-
pixDimsRAS?: number[];
|
|
641
|
-
obliqueRAS?: mat4;
|
|
642
|
-
dimsRAS?: number[];
|
|
643
|
-
permRAS?: number[];
|
|
644
|
-
toRAS?: mat4;
|
|
645
|
-
toRASvox?: mat4;
|
|
646
|
-
frac2mm?: mat4;
|
|
647
|
-
frac2mmOrtho?: mat4;
|
|
648
|
-
extentsMinOrtho?: number[];
|
|
649
|
-
extentsMaxOrtho?: number[];
|
|
650
|
-
mm2ortho?: mat4;
|
|
651
|
-
hdr: nifti.NIFTI1 | nifti.NIFTI2 | null;
|
|
652
|
-
imageType?: ImageType;
|
|
653
|
-
img?: Uint8Array | Int16Array | Float32Array | Float64Array | Uint16Array;
|
|
654
|
-
imaginary?: Float32Array;
|
|
655
|
-
fileObject?: File | File[];
|
|
656
|
-
dims?: number[];
|
|
657
|
-
onColormapChange: (img: NVImage) => void;
|
|
658
|
-
onOpacityChange: (img: NVImage) => void;
|
|
659
|
-
mm000?: vec3;
|
|
660
|
-
mm100?: vec3;
|
|
661
|
-
mm010?: vec3;
|
|
662
|
-
mm001?: vec3;
|
|
663
|
-
cal_min?: number;
|
|
664
|
-
cal_max?: number;
|
|
665
|
-
robust_min?: number;
|
|
666
|
-
robust_max?: number;
|
|
667
|
-
global_min?: number;
|
|
668
|
-
global_max?: number;
|
|
669
|
-
urlImgData?: string;
|
|
670
|
-
isManifest?: boolean;
|
|
671
|
-
limitFrames4D?: number;
|
|
672
|
-
DT_NONE: number;
|
|
673
|
-
DT_UNKNOWN: number;
|
|
674
|
-
DT_BINARY: number;
|
|
675
|
-
DT_UNSIGNED_CHAR: number;
|
|
676
|
-
DT_SIGNED_SHORT: number;
|
|
677
|
-
DT_SIGNED_INT: number;
|
|
678
|
-
DT_FLOAT: number;
|
|
679
|
-
DT_COMPLEX: number;
|
|
680
|
-
DT_DOUBLE: number;
|
|
681
|
-
DT_RGB: number;
|
|
682
|
-
DT_ALL: number;
|
|
683
|
-
DT_INT8: number;
|
|
684
|
-
DT_UINT16: number;
|
|
685
|
-
DT_UINT32: number;
|
|
686
|
-
DT_INT64: number;
|
|
687
|
-
DT_UINT64: number;
|
|
688
|
-
DT_FLOAT128: number;
|
|
689
|
-
DT_COMPLEX128: number;
|
|
690
|
-
DT_COMPLEX256: number;
|
|
691
|
-
DT_RGBA32: number;
|
|
692
|
-
/**
|
|
693
|
-
*
|
|
694
|
-
* @param dataBuffer - an array buffer of image data to load (there are also methods that abstract this more. See loadFromUrl, and loadFromFile)
|
|
695
|
-
* @param name - a name for this image. Default is an empty string
|
|
696
|
-
* @param colormap - a color map to use. default is gray
|
|
697
|
-
* @param opacity - the opacity for this image. default is 1
|
|
698
|
-
* @param pairedImgData - Allows loading formats where header and image are separate files (e.g. nifti.hdr, nifti.img)
|
|
699
|
-
* @param cal_min - minimum intensity for color brightness/contrast
|
|
700
|
-
* @param cal_max - maximum intensity for color brightness/contrast
|
|
701
|
-
* @param trustCalMinMax - whether or not to trust cal_min and cal_max from the nifti header (trusting results in faster loading)
|
|
702
|
-
* @param percentileFrac - the percentile to use for setting the robust range of the display values (smart intensity setting for images with large ranges)
|
|
703
|
-
* @param ignoreZeroVoxels - whether or not to ignore zero voxels in setting the robust range of display values
|
|
704
|
-
* @param useQFormNotSForm - give precedence to QForm (Quaternion) or SForm (Matrix)
|
|
705
|
-
* @param colormapNegative - a color map to use for symmetrical negative intensities
|
|
706
|
-
* @param frame4D - volume displayed, 0 indexed, must be less than nFrame4D
|
|
707
|
-
*
|
|
708
|
-
* FIXME the following params are documented but not included in the actual constructor
|
|
709
|
-
* @param onColormapChange - callback for color map change
|
|
710
|
-
* @param onOpacityChange -callback for color map change
|
|
711
|
-
*
|
|
712
|
-
* TODO the following parameters were not documented
|
|
713
|
-
* @param imageType - TODO
|
|
714
|
-
* @param cal_minNeg - TODO
|
|
715
|
-
* @param cal_maxNeg - TODO
|
|
716
|
-
* @param colorbarVisible - TODO
|
|
717
|
-
* @param colormapLabel - TODO
|
|
718
|
-
*/
|
|
719
|
-
constructor(dataBuffer?: ArrayBuffer | ArrayBuffer[] | null, name?: string, colormap?: string, opacity?: number, pairedImgData?: ArrayBuffer | null, cal_min?: number, cal_max?: number, trustCalMinMax?: boolean, percentileFrac?: number, ignoreZeroVoxels?: boolean, useQFormNotSForm?: boolean, colormapNegative?: string, frame4D?: number, imageType?: ImageType, cal_minNeg?: number, cal_maxNeg?: number, colorbarVisible?: boolean, colormapLabel?: LUT | null);
|
|
720
|
-
computeObliqueAngle(mtx44: mat4): number;
|
|
721
|
-
calculateOblique(): void;
|
|
722
|
-
THD_daxes_to_NIFTI(xyzDelta: number[], xyzOrigin: number[], orientSpecific: number[]): void;
|
|
723
|
-
SetPixDimFromSForm(): void;
|
|
724
|
-
readDICOM(buf: ArrayBuffer | ArrayBuffer[]): ArrayBuffer;
|
|
725
|
-
readECAT(buffer: ArrayBuffer): ArrayBuffer;
|
|
726
|
-
readV16(buffer: ArrayBuffer): ArrayBuffer;
|
|
727
|
-
readVMR(buffer: ArrayBuffer): ArrayBuffer;
|
|
728
|
-
readMGH(buffer: ArrayBuffer): ArrayBuffer;
|
|
729
|
-
readHEAD(dataBuffer: ArrayBuffer, pairedImgData: ArrayBuffer | null): ArrayBuffer;
|
|
730
|
-
readMHA(buffer: ArrayBuffer, pairedImgData: ArrayBuffer | null): ArrayBuffer;
|
|
731
|
-
readMIF(buffer: ArrayBuffer, pairedImgData: ArrayBuffer | null): ArrayBuffer;
|
|
732
|
-
readNRRD(dataBuffer: ArrayBuffer, pairedImgData: ArrayBuffer | null): ArrayBuffer;
|
|
733
|
-
calculateRAS(): void;
|
|
734
|
-
img2RAS(): Float32Array | Uint8Array | Int16Array | Float64Array | Uint16Array;
|
|
735
|
-
vox2mm(XYZ: number[], mtx: mat4): vec3;
|
|
736
|
-
mm2vox(mm: number[], frac?: boolean): Float32Array | vec3;
|
|
737
|
-
arrayEquals(a: unknown[], b: unknown[]): boolean;
|
|
738
|
-
setColormap(cm: string): void;
|
|
739
|
-
setColormapLabel(cm: ColorMap): void;
|
|
740
|
-
setColormapLabelFromUrl(url: string): Promise<void>;
|
|
741
|
-
get colormap(): string;
|
|
742
|
-
get colorMap(): string;
|
|
743
|
-
set colormap(cm: string);
|
|
744
|
-
set colorMap(cm: string);
|
|
745
|
-
get opacity(): number;
|
|
746
|
-
set opacity(opacity: number);
|
|
747
|
-
calMinMax(): number[];
|
|
748
|
-
intensityRaw2Scaled(raw: number): number;
|
|
749
|
-
intensityScaled2Raw(scaled: number): number;
|
|
750
|
-
saveToUint8Array(fnm: string, drawing8?: Uint8Array | null): Uint8Array;
|
|
751
|
-
saveToDisk(fnm?: string, drawing8?: Uint8Array | null): Uint8Array;
|
|
752
|
-
static fetchDicomData(url: string, headers?: Record<string, string>): Promise<ArrayBuffer[]>;
|
|
753
|
-
static fetchPartial(url: string, bytesToLoad: number, headers?: Record<string, string>): Promise<Response>;
|
|
754
|
-
/**
|
|
755
|
-
* factory function to load and return a new NVImage instance from a given URL
|
|
756
|
-
* @returns NVImage instance
|
|
757
|
-
*/
|
|
758
|
-
static loadFromUrl({ url, urlImgData, headers, name, colormap, opacity, cal_min, cal_max, trustCalMinMax, percentileFrac, ignoreZeroVoxels, useQFormNotSForm, colormapNegative, frame4D, isManifest, limitFrames4D, imageType, colorbarVisible }?: Partial<Omit<ImageFromUrlOptions, 'url'>> & {
|
|
759
|
-
url?: string | Uint8Array | ArrayBuffer;
|
|
760
|
-
}): Promise<NVImage>;
|
|
761
|
-
static readFileAsync(file: File, bytesToLoad?: number): Promise<ArrayBuffer>;
|
|
762
|
-
/**
|
|
763
|
-
* factory function to load and return a new NVImage instance from a file in the browser
|
|
764
|
-
*/
|
|
765
|
-
static loadFromFile({ file, // file can be an array of file objects or a single file object
|
|
766
|
-
name, colormap, opacity, urlImgData, cal_min, cal_max, trustCalMinMax, percentileFrac, ignoreZeroVoxels, useQFormNotSForm, colormapNegative, frame4D, limitFrames4D, imageType }: ImageFromFileOptions): Promise<NVImage>;
|
|
767
|
-
/**
|
|
768
|
-
* factory function to load and return a new NVImage instance from a base64 encoded string
|
|
769
|
-
*
|
|
770
|
-
* @returns NVImage instance
|
|
771
|
-
* @example
|
|
772
|
-
* myImage = NVImage.loadFromBase64('SomeBase64String')
|
|
773
|
-
*/
|
|
774
|
-
static loadFromBase64({ base64, name, colormap, opacity, cal_min, cal_max, trustCalMinMax, percentileFrac, ignoreZeroVoxels }: ImageFromBase64): NVImage;
|
|
775
|
-
/**
|
|
776
|
-
* make a clone of a NVImage instance and return a new NVImage
|
|
777
|
-
* @returns NVImage instance
|
|
778
|
-
* @example
|
|
779
|
-
* myImage = NVImage.loadFromFile(SomeFileObject) // files can be from dialogs or drag and drop
|
|
780
|
-
* clonedImage = myImage.clone()
|
|
781
|
-
*/
|
|
782
|
-
clone(): NVImage;
|
|
783
|
-
/**
|
|
784
|
-
* fill a NVImage instance with zeros for the image data
|
|
785
|
-
* @example
|
|
786
|
-
* myImage = NVImage.loadFromFile(SomeFileObject) // files can be from dialogs or drag and drop
|
|
787
|
-
* clonedImageWithZeros = myImage.clone().zeroImage()
|
|
788
|
-
*/
|
|
789
|
-
zeroImage(): void;
|
|
790
|
-
/**
|
|
791
|
-
* get nifti specific metadata about the image
|
|
792
|
-
*/
|
|
793
|
-
getImageMetadata(): ImageMetadata;
|
|
794
|
-
/**
|
|
795
|
-
* a factory function to make a zero filled image given a NVImage as a reference
|
|
796
|
-
* @param nvImage - an existing NVImage as a reference
|
|
797
|
-
* @param dataType - the output data type. Options: 'same', 'uint8'
|
|
798
|
-
* @returns new NVImage filled with zeros for the image data
|
|
799
|
-
* @example
|
|
800
|
-
* myImage = NVImage.loadFromFile(SomeFileObject) // files can be from dialogs or drag and drop
|
|
801
|
-
* newZeroImage = NVImage.zerosLike(myImage)
|
|
802
|
-
*/
|
|
803
|
-
static zerosLike(nvImage: NVImage, dataType?: string): NVImage;
|
|
804
|
-
getValue(x: number, y: number, z: number, frame4D?: number, isReadImaginary?: boolean): number;
|
|
805
|
-
/**
|
|
806
|
-
* @param id - id of 3D Object (is this the base volume or an overlay?)
|
|
807
|
-
* @param gl - WebGL rendering context
|
|
808
|
-
* @returns new 3D object in model space
|
|
809
|
-
*/
|
|
810
|
-
toNiivueObject3D(id: number, gl: WebGL2RenderingContext): NiivueObject3D;
|
|
811
|
-
/**
|
|
812
|
-
* Update options for image
|
|
813
|
-
*/
|
|
814
|
-
applyOptionsUpdate(options: ImageFromUrlOptions): void;
|
|
815
|
-
getImageOptions(): ImageFromUrlOptions;
|
|
816
|
-
/**
|
|
817
|
-
* Converts NVImage to NIfTI compliant byte array
|
|
818
|
-
*/
|
|
819
|
-
toUint8Array(drawingBytes?: Uint8Array | null): Uint8Array;
|
|
820
|
-
convertVox2Frac(vox: vec3): vec3;
|
|
821
|
-
convertFrac2Vox(frac: vec3): vec3;
|
|
822
|
-
convertFrac2MM(frac: vec3, isForceSliceMM?: boolean): vec4;
|
|
823
|
-
convertMM2Frac(mm: vec3 | vec4, isForceSliceMM?: boolean): vec3;
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
type FreeSurferConnectome = {
|
|
827
|
-
data_type: string;
|
|
828
|
-
points: Array<{
|
|
829
|
-
comments?: Array<{
|
|
830
|
-
text: string;
|
|
831
|
-
}>;
|
|
832
|
-
coordinates: {
|
|
833
|
-
x: number;
|
|
834
|
-
y: number;
|
|
835
|
-
z: number;
|
|
836
|
-
};
|
|
837
|
-
}>;
|
|
838
|
-
};
|
|
839
|
-
/**
|
|
840
|
-
* Represents a connectome
|
|
841
|
-
*/
|
|
842
|
-
declare class NVConnectome extends NVMesh {
|
|
843
|
-
gl: WebGL2RenderingContext;
|
|
844
|
-
nodesChanged: EventTarget;
|
|
845
|
-
constructor(gl: WebGL2RenderingContext, connectome: LegacyConnectome);
|
|
846
|
-
static convertLegacyConnectome(json: LegacyConnectome): Connectome;
|
|
847
|
-
static convertFreeSurferConnectome(json: FreeSurferConnectome, colormap?: string): Connectome;
|
|
848
|
-
updateLabels(): void;
|
|
849
|
-
addConnectomeNode(node: NVConnectomeNode): void;
|
|
850
|
-
deleteConnectomeNode(node: NVConnectomeNode): void;
|
|
851
|
-
updateConnectomeNodeByIndex(index: number, updatedNode: NVConnectomeNode): void;
|
|
852
|
-
updateConnectomeNodeByPoint(point: [number, number, number], updatedNode: NVConnectomeNode): void;
|
|
853
|
-
addConnectomeEdge(first: number, second: number, colorValue: number): NVConnectomeEdge;
|
|
854
|
-
deleteConnectomeEdge(first: number, second: number): NVConnectomeEdge;
|
|
855
|
-
findClosestConnectomeNode(point: number[], distance: number): NVConnectomeNode | null;
|
|
856
|
-
updateConnectome(gl: WebGL2RenderingContext): void;
|
|
857
|
-
updateMesh(gl: WebGL2RenderingContext): void;
|
|
858
|
-
json(): Connectome;
|
|
859
|
-
/**
|
|
860
|
-
* Factory method to create connectome from options
|
|
861
|
-
*/
|
|
862
|
-
static loadConnectomeFromUrl(gl: WebGL2RenderingContext, url: string): Promise<NVConnectome>;
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
/**
|
|
866
|
-
* Slice Type
|
|
535
|
+
* Slice Type
|
|
536
|
+
* @ignore
|
|
867
537
|
*/
|
|
868
538
|
declare enum SLICE_TYPE {
|
|
869
539
|
AXIAL = 0,
|
|
@@ -874,6 +544,7 @@ declare enum SLICE_TYPE {
|
|
|
874
544
|
}
|
|
875
545
|
/**
|
|
876
546
|
* Multi-planar layout
|
|
547
|
+
* @ignore
|
|
877
548
|
*/
|
|
878
549
|
declare enum MULTIPLANAR_TYPE {
|
|
879
550
|
AUTO = 0,
|
|
@@ -881,6 +552,10 @@ declare enum MULTIPLANAR_TYPE {
|
|
|
881
552
|
GRID = 2,
|
|
882
553
|
ROW = 3
|
|
883
554
|
}
|
|
555
|
+
/**
|
|
556
|
+
* Drag mode
|
|
557
|
+
* @ignore
|
|
558
|
+
*/
|
|
884
559
|
declare enum DRAG_MODE {
|
|
885
560
|
none = 0,
|
|
886
561
|
contrast = 1,
|
|
@@ -889,6 +564,9 @@ declare enum DRAG_MODE {
|
|
|
889
564
|
slicer3D = 4,
|
|
890
565
|
callbackOnly = 5
|
|
891
566
|
}
|
|
567
|
+
/**
|
|
568
|
+
* NVConfigOptions
|
|
569
|
+
*/
|
|
892
570
|
type NVConfigOptions = {
|
|
893
571
|
textHeight: number;
|
|
894
572
|
colorbarHeight: number;
|
|
@@ -898,7 +576,7 @@ type NVConfigOptions = {
|
|
|
898
576
|
show3Dcrosshair: boolean;
|
|
899
577
|
backColor: number[];
|
|
900
578
|
crosshairColor: number[];
|
|
901
|
-
fontColor:
|
|
579
|
+
fontColor: Float32List;
|
|
902
580
|
selectionBoxColor: number[];
|
|
903
581
|
clipPlaneColor: number[];
|
|
904
582
|
rulerColor: number[];
|
|
@@ -947,6 +625,7 @@ type NVConfigOptions = {
|
|
|
947
625
|
legendTextColor: number[];
|
|
948
626
|
multiplanarLayout: MULTIPLANAR_TYPE;
|
|
949
627
|
renderOverlayBlend: number;
|
|
628
|
+
sliceMosaicString: string;
|
|
950
629
|
};
|
|
951
630
|
declare const DEFAULT_OPTIONS: NVConfigOptions;
|
|
952
631
|
type SceneData = {
|
|
@@ -958,6 +637,15 @@ type SceneData = {
|
|
|
958
637
|
volScaleMultiplier: number;
|
|
959
638
|
pan2Dxyzmm: vec4;
|
|
960
639
|
};
|
|
640
|
+
declare const INITIAL_SCENE_DATA: {
|
|
641
|
+
azimuth: number;
|
|
642
|
+
elevation: number;
|
|
643
|
+
crosshairPos: vec3;
|
|
644
|
+
clipPlane: number[];
|
|
645
|
+
clipPlaneDepthAziElev: number[];
|
|
646
|
+
volScaleMultiplier: number;
|
|
647
|
+
pan2Dxyzmm: vec4;
|
|
648
|
+
};
|
|
961
649
|
type Scene = {
|
|
962
650
|
onAzimuthElevationChange: (azimuth: number, elevation: number) => void;
|
|
963
651
|
onZoom3DChange: (scale: number) => void;
|
|
@@ -985,119 +673,500 @@ type DocumentData = {
|
|
|
985
673
|
sceneData?: SceneData;
|
|
986
674
|
connectomes?: string[];
|
|
987
675
|
};
|
|
988
|
-
type ExportDocumentData = {
|
|
989
|
-
encodedImageBlobs: string[];
|
|
990
|
-
encodedDrawingBlob: string;
|
|
991
|
-
previewImageDataURL: string;
|
|
992
|
-
imageOptionsMap: Map<string, number>;
|
|
993
|
-
imageOptionsArray: ImageFromUrlOptions[];
|
|
994
|
-
sceneData: Partial<SceneData>;
|
|
995
|
-
opts: NVConfigOptions;
|
|
996
|
-
meshesString: string;
|
|
997
|
-
labels: NVLabel3D[];
|
|
998
|
-
connectomes: string[];
|
|
676
|
+
type ExportDocumentData = {
|
|
677
|
+
encodedImageBlobs: string[];
|
|
678
|
+
encodedDrawingBlob: string;
|
|
679
|
+
previewImageDataURL: string;
|
|
680
|
+
imageOptionsMap: Map<string, number>;
|
|
681
|
+
imageOptionsArray: ImageFromUrlOptions[];
|
|
682
|
+
sceneData: Partial<SceneData>;
|
|
683
|
+
opts: NVConfigOptions;
|
|
684
|
+
meshesString: string;
|
|
685
|
+
labels: NVLabel3D[];
|
|
686
|
+
connectomes: string[];
|
|
687
|
+
};
|
|
688
|
+
/**
|
|
689
|
+
* Creates and instance of NVDocument
|
|
690
|
+
* @ignore
|
|
691
|
+
*/
|
|
692
|
+
declare class NVDocument {
|
|
693
|
+
data: DocumentData;
|
|
694
|
+
scene: Scene;
|
|
695
|
+
volumes: NVImage[];
|
|
696
|
+
meshDataObjects?: Array<NVMesh | NVConnectome>;
|
|
697
|
+
meshes: Array<NVMesh | NVConnectome>;
|
|
698
|
+
drawBitmap: Uint8Array | null;
|
|
699
|
+
imageOptionsMap: Map<any, any>;
|
|
700
|
+
meshOptionsMap: Map<any, any>;
|
|
701
|
+
constructor();
|
|
702
|
+
/**
|
|
703
|
+
* Title of the document
|
|
704
|
+
*/
|
|
705
|
+
get title(): string;
|
|
706
|
+
/**
|
|
707
|
+
* Gets preview image blob
|
|
708
|
+
* @returns dataURL of preview image
|
|
709
|
+
*/
|
|
710
|
+
get previewImageDataURL(): string;
|
|
711
|
+
/**
|
|
712
|
+
* Sets preview image blob
|
|
713
|
+
* @param dataURL - encoded preview image
|
|
714
|
+
*/
|
|
715
|
+
set previewImageDataURL(dataURL: string);
|
|
716
|
+
/**
|
|
717
|
+
* @param title - title of document
|
|
718
|
+
*/
|
|
719
|
+
set title(title: string);
|
|
720
|
+
get imageOptionsArray(): ImageFromUrlOptions[];
|
|
721
|
+
/**
|
|
722
|
+
* Gets the base 64 encoded blobs of associated images
|
|
723
|
+
*/
|
|
724
|
+
get encodedImageBlobs(): string[];
|
|
725
|
+
/**
|
|
726
|
+
* Gets the base 64 encoded blob of the associated drawing
|
|
727
|
+
* TODO the return type was marked as string[] here, was that an error?
|
|
728
|
+
*/
|
|
729
|
+
get encodedDrawingBlob(): string;
|
|
730
|
+
/**
|
|
731
|
+
* Gets the options of the {@link Niivue} instance
|
|
732
|
+
*/
|
|
733
|
+
get opts(): NVConfigOptions;
|
|
734
|
+
/**
|
|
735
|
+
* Sets the options of the {@link Niivue} instance
|
|
736
|
+
*/
|
|
737
|
+
set opts(opts: NVConfigOptions);
|
|
738
|
+
/**
|
|
739
|
+
* Gets the 3D labels of the {@link Niivue} instance
|
|
740
|
+
*/
|
|
741
|
+
get labels(): NVLabel3D[];
|
|
742
|
+
/**
|
|
743
|
+
* Sets the 3D labels of the {@link Niivue} instance
|
|
744
|
+
*/
|
|
745
|
+
set labels(labels: NVLabel3D[]);
|
|
746
|
+
/**
|
|
747
|
+
* Checks if document has an image by id
|
|
748
|
+
*/
|
|
749
|
+
hasImage(image: NVImage): boolean;
|
|
750
|
+
/**
|
|
751
|
+
* Checks if document has an image by url
|
|
752
|
+
*/
|
|
753
|
+
hasImageFromUrl(url: string): boolean;
|
|
754
|
+
/**
|
|
755
|
+
* Adds an image and the options an image was created with
|
|
756
|
+
*/
|
|
757
|
+
addImageOptions(image: NVImage, imageOptions: ImageFromUrlOptions): void;
|
|
758
|
+
/**
|
|
759
|
+
* Removes image from the document as well as its options
|
|
760
|
+
*/
|
|
761
|
+
removeImage(image: NVImage): void;
|
|
762
|
+
/**
|
|
763
|
+
* Returns the options for the image if it was added by url
|
|
764
|
+
*/
|
|
765
|
+
getImageOptions(image: NVImage): ImageFromUrlOptions | null;
|
|
766
|
+
/**
|
|
767
|
+
* Converts NVDocument to JSON
|
|
768
|
+
*/
|
|
769
|
+
json(): ExportDocumentData;
|
|
770
|
+
/**
|
|
771
|
+
* Downloads a JSON file with options, scene, images, meshes and drawing of {@link Niivue} instance
|
|
772
|
+
*/
|
|
773
|
+
download(fileName: string): void;
|
|
774
|
+
/**
|
|
775
|
+
* Deserialize mesh data objects
|
|
776
|
+
*/
|
|
777
|
+
static deserializeMeshDataObjects(document: NVDocument): void;
|
|
778
|
+
/**
|
|
779
|
+
* Factory method to return an instance of NVDocument from a URL
|
|
780
|
+
*/
|
|
781
|
+
static loadFromUrl(url: string): Promise<NVDocument>;
|
|
782
|
+
/**
|
|
783
|
+
* Factory method to return an instance of NVDocument from a File object
|
|
784
|
+
*/
|
|
785
|
+
static loadFromFile(file: Blob): Promise<NVDocument>;
|
|
786
|
+
/**
|
|
787
|
+
* Factory method to return an instance of NVDocument from JSON
|
|
788
|
+
*/
|
|
789
|
+
static loadFromJSON(data: DocumentData): NVDocument;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
type NiftiHeader = {
|
|
793
|
+
littleEndian: boolean;
|
|
794
|
+
dim_info: number;
|
|
795
|
+
dims: number[];
|
|
796
|
+
pixDims: number[];
|
|
797
|
+
intent_p1: number;
|
|
798
|
+
intent_p2: number;
|
|
799
|
+
intent_p3: number;
|
|
800
|
+
intent_code: number;
|
|
801
|
+
datatypeCode: number;
|
|
802
|
+
numBitsPerVoxel: number;
|
|
803
|
+
slice_start: number;
|
|
804
|
+
vox_offset: number;
|
|
805
|
+
scl_slope: number;
|
|
806
|
+
scl_inter: number;
|
|
807
|
+
slice_end: number;
|
|
808
|
+
slice_code: number;
|
|
809
|
+
xyzt_units: number;
|
|
810
|
+
cal_max: number;
|
|
811
|
+
cal_min: number;
|
|
812
|
+
slice_duration: number;
|
|
813
|
+
toffset: number;
|
|
814
|
+
description: string;
|
|
815
|
+
aux_file: string;
|
|
816
|
+
qform_code: number;
|
|
817
|
+
sform_code: number;
|
|
818
|
+
quatern_b: number;
|
|
819
|
+
quatern_c: number;
|
|
820
|
+
quatern_d: number;
|
|
821
|
+
qoffset_x: number;
|
|
822
|
+
qoffset_y: number;
|
|
823
|
+
qoffset_z: number;
|
|
824
|
+
affine: number[][];
|
|
825
|
+
intent_name: string;
|
|
826
|
+
magic: string;
|
|
827
|
+
};
|
|
828
|
+
type Volume = Record<string, any>;
|
|
829
|
+
type Point = {
|
|
830
|
+
comments: Array<{
|
|
831
|
+
text: string;
|
|
832
|
+
prefilled?: string;
|
|
833
|
+
}>;
|
|
834
|
+
coordinates: {
|
|
835
|
+
x: number;
|
|
836
|
+
y: number;
|
|
837
|
+
z: number;
|
|
838
|
+
};
|
|
839
|
+
};
|
|
840
|
+
/**
|
|
841
|
+
* Representes the vertices of a connectome
|
|
842
|
+
* @ignore
|
|
843
|
+
*/
|
|
844
|
+
type NVConnectomeNode = {
|
|
845
|
+
name: string;
|
|
846
|
+
x: number;
|
|
847
|
+
y: number;
|
|
848
|
+
z: number;
|
|
849
|
+
colorValue: number;
|
|
850
|
+
sizeValue: number;
|
|
851
|
+
label?: NVLabel3D;
|
|
852
|
+
};
|
|
853
|
+
/**
|
|
854
|
+
* Represents edges between connectome nodes
|
|
855
|
+
* @ignore
|
|
856
|
+
*/
|
|
857
|
+
type NVConnectomeEdge = {
|
|
858
|
+
first: number;
|
|
859
|
+
second: number;
|
|
860
|
+
colorValue: number;
|
|
861
|
+
};
|
|
862
|
+
type ConnectomeOptions = {
|
|
863
|
+
name: string;
|
|
864
|
+
nodeColormap: string;
|
|
865
|
+
nodeColormapNegative: string;
|
|
866
|
+
nodeMinColor: number;
|
|
867
|
+
nodeMaxColor: number;
|
|
868
|
+
nodeScale: number;
|
|
869
|
+
edgeColormap: string;
|
|
870
|
+
edgeColormapNegative: string;
|
|
871
|
+
edgeMin: number;
|
|
872
|
+
edgeMax: number;
|
|
873
|
+
edgeScale: number;
|
|
874
|
+
legendLineThickness?: number;
|
|
875
|
+
};
|
|
876
|
+
type Connectome = ConnectomeOptions & {
|
|
877
|
+
nodes: NVConnectomeNode[];
|
|
878
|
+
edges: NVConnectomeEdge[];
|
|
879
|
+
};
|
|
880
|
+
type LegacyNodes = {
|
|
881
|
+
names: string[];
|
|
882
|
+
prefilled: unknown[];
|
|
883
|
+
X: number[];
|
|
884
|
+
Y: number[];
|
|
885
|
+
Z: number[];
|
|
886
|
+
Color: number[];
|
|
887
|
+
Size: number[];
|
|
888
|
+
};
|
|
889
|
+
type LegacyConnectome = Partial<ConnectomeOptions> & {
|
|
890
|
+
nodes: LegacyNodes;
|
|
891
|
+
edges: number[];
|
|
892
|
+
};
|
|
893
|
+
type DragReleaseParams = {
|
|
894
|
+
fracStart: vec3;
|
|
895
|
+
fracEnd: vec3;
|
|
896
|
+
voxStart: vec3;
|
|
897
|
+
voxEnd: vec3;
|
|
898
|
+
mmStart: vec4;
|
|
899
|
+
mmEnd: vec4;
|
|
900
|
+
mmLength: number;
|
|
901
|
+
tileIdx: number;
|
|
902
|
+
axCorSag: SLICE_TYPE;
|
|
903
|
+
};
|
|
904
|
+
|
|
905
|
+
type ValuesArray = Array<{
|
|
906
|
+
id: string;
|
|
907
|
+
vals: Float32Array;
|
|
908
|
+
global_min?: number;
|
|
909
|
+
global_max?: number;
|
|
910
|
+
cal_min?: number;
|
|
911
|
+
cal_max?: number;
|
|
912
|
+
}>;
|
|
913
|
+
type TypedNumberArray = Float64Array | Float32Array | Uint32Array | Uint16Array | Uint8Array | Int32Array | Int16Array | Int8Array;
|
|
914
|
+
type AnyNumberArray = number[] | TypedNumberArray;
|
|
915
|
+
type DefaultMeshType = {
|
|
916
|
+
positions: Float32Array;
|
|
917
|
+
indices: Uint32Array;
|
|
918
|
+
colors?: Float32Array;
|
|
919
|
+
};
|
|
920
|
+
type TRACT = {
|
|
921
|
+
pts: Float32Array;
|
|
922
|
+
offsetPt0: Uint32Array;
|
|
923
|
+
dps: ValuesArray;
|
|
924
|
+
};
|
|
925
|
+
type TT = {
|
|
926
|
+
pts: Float32Array;
|
|
927
|
+
offsetPt0: Uint32Array;
|
|
928
|
+
};
|
|
929
|
+
type TRX = {
|
|
930
|
+
pts: Float32Array;
|
|
931
|
+
offsetPt0: Uint32Array;
|
|
932
|
+
dpg: ValuesArray;
|
|
933
|
+
dps: ValuesArray;
|
|
934
|
+
dpv: ValuesArray;
|
|
935
|
+
header: unknown;
|
|
936
|
+
};
|
|
937
|
+
type TRK = {
|
|
938
|
+
pts: Float32Array;
|
|
939
|
+
offsetPt0: Uint32Array;
|
|
940
|
+
dps: ValuesArray;
|
|
941
|
+
dpv: ValuesArray;
|
|
942
|
+
};
|
|
943
|
+
type TCK = {
|
|
944
|
+
pts: Float32Array;
|
|
945
|
+
offsetPt0: Uint32Array;
|
|
946
|
+
};
|
|
947
|
+
type VTK = DefaultMeshType | {
|
|
948
|
+
pts: Float32Array;
|
|
949
|
+
offsetPt0: Uint32Array;
|
|
950
|
+
};
|
|
951
|
+
type ANNOT = Uint32Array | {
|
|
952
|
+
scalars: Float32Array;
|
|
953
|
+
colormapLabel: LUT;
|
|
954
|
+
};
|
|
955
|
+
type MZ3 = Float32Array | {
|
|
956
|
+
positions: Float32Array | null;
|
|
957
|
+
indices: Uint32Array | null;
|
|
958
|
+
scalars: Float32Array;
|
|
959
|
+
colors: Float32Array | null;
|
|
960
|
+
};
|
|
961
|
+
type GII = {
|
|
962
|
+
scalars: Float32Array;
|
|
963
|
+
positions?: Float32Array;
|
|
964
|
+
indices?: Uint32Array;
|
|
965
|
+
colormapLabel?: LUT;
|
|
966
|
+
anatomicalStructurePrimary: string;
|
|
967
|
+
};
|
|
968
|
+
type MGH = AnyNumberArray | {
|
|
969
|
+
scalars: AnyNumberArray;
|
|
970
|
+
colormapLabel: LUT;
|
|
971
|
+
};
|
|
972
|
+
type X3D = {
|
|
973
|
+
positions: Float32Array;
|
|
974
|
+
indices: Uint32Array;
|
|
975
|
+
rgba255: Uint8Array;
|
|
976
|
+
};
|
|
977
|
+
|
|
978
|
+
/** Enum for text alignment
|
|
979
|
+
*/
|
|
980
|
+
declare enum MeshType {
|
|
981
|
+
MESH = "mesh",
|
|
982
|
+
CONNECTOME = "connectome",
|
|
983
|
+
FIBER = "fiber"
|
|
984
|
+
}
|
|
985
|
+
type NVMeshLayer = {
|
|
986
|
+
name?: string;
|
|
987
|
+
key?: string;
|
|
988
|
+
url?: string;
|
|
989
|
+
headers?: Record<string, string>;
|
|
990
|
+
opacity: number;
|
|
991
|
+
colormap: string;
|
|
992
|
+
colormapNegative: string;
|
|
993
|
+
colormapInvert: boolean;
|
|
994
|
+
colormapLabel?: ColorMap | LUT;
|
|
995
|
+
useNegativeCmap: boolean;
|
|
996
|
+
global_min: number;
|
|
997
|
+
global_max: number;
|
|
998
|
+
cal_min: number;
|
|
999
|
+
cal_max: number;
|
|
1000
|
+
cal_minNeg: number;
|
|
1001
|
+
cal_maxNeg: number;
|
|
1002
|
+
isAdditiveBlend: boolean;
|
|
1003
|
+
frame4D: number;
|
|
1004
|
+
nFrame4D: number;
|
|
1005
|
+
values: number[];
|
|
1006
|
+
outlineBorder?: number;
|
|
1007
|
+
isTransparentBelowCalMin?: boolean;
|
|
1008
|
+
alphaThreshold: boolean;
|
|
1009
|
+
base64?: string;
|
|
1010
|
+
colorbarVisible?: boolean;
|
|
1011
|
+
};
|
|
1012
|
+
declare class NVMeshFromUrlOptions {
|
|
1013
|
+
url: string;
|
|
1014
|
+
gl: WebGL2RenderingContext | null;
|
|
1015
|
+
name: string;
|
|
1016
|
+
opacity: number;
|
|
1017
|
+
rgba255: Uint8Array;
|
|
1018
|
+
visible: boolean;
|
|
1019
|
+
layers: NVMeshLayer[];
|
|
1020
|
+
colorbarVisible: boolean;
|
|
1021
|
+
constructor(url?: string, gl?: null, name?: string, opacity?: number, rgba255?: Uint8Array, visible?: boolean, layers?: never[], colorbarVisible?: boolean);
|
|
1022
|
+
}
|
|
1023
|
+
type BaseLoadParams = {
|
|
1024
|
+
gl: WebGL2RenderingContext;
|
|
1025
|
+
name: string;
|
|
1026
|
+
opacity: number;
|
|
1027
|
+
rgba255: number[] | Uint8Array;
|
|
1028
|
+
visible: boolean;
|
|
1029
|
+
layers: NVMeshLayer[];
|
|
1030
|
+
};
|
|
1031
|
+
type LoadFromUrlParams = Partial<BaseLoadParams> & {
|
|
1032
|
+
url: string;
|
|
1033
|
+
headers?: Record<string, string>;
|
|
1034
|
+
};
|
|
1035
|
+
type LoadFromFileParams = BaseLoadParams & {
|
|
1036
|
+
file: Blob;
|
|
1037
|
+
};
|
|
1038
|
+
type LoadFromBase64Params = BaseLoadParams & {
|
|
1039
|
+
base64: string;
|
|
999
1040
|
};
|
|
1000
1041
|
/**
|
|
1001
|
-
*
|
|
1042
|
+
* a NVMesh encapsulates some mesh data and provides methods to query and operate on meshes
|
|
1002
1043
|
*/
|
|
1003
|
-
declare class
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
* Checks if document has an image by id
|
|
1059
|
-
*/
|
|
1060
|
-
hasImage(image: NVImage): boolean;
|
|
1061
|
-
/**
|
|
1062
|
-
* Checks if document has an image by url
|
|
1063
|
-
*/
|
|
1064
|
-
hasImageFromUrl(url: string): boolean;
|
|
1065
|
-
/**
|
|
1066
|
-
* Adds an image and the options an image was created with
|
|
1067
|
-
*/
|
|
1068
|
-
addImageOptions(image: NVImage, imageOptions: ImageFromUrlOptions): void;
|
|
1069
|
-
/**
|
|
1070
|
-
* Removes image from the document as well as its options
|
|
1071
|
-
*/
|
|
1072
|
-
removeImage(image: NVImage): void;
|
|
1073
|
-
/**
|
|
1074
|
-
* Returns the options for the image if it was added by url
|
|
1075
|
-
*/
|
|
1076
|
-
getImageOptions(image: NVImage): ImageFromUrlOptions | null;
|
|
1077
|
-
/**
|
|
1078
|
-
* Converts NVDocument to JSON
|
|
1079
|
-
*/
|
|
1080
|
-
json(): ExportDocumentData;
|
|
1081
|
-
/**
|
|
1082
|
-
* Downloads a JSON file with options, scene, images, meshes and drawing of {@link Niivue} instance
|
|
1083
|
-
*/
|
|
1084
|
-
download(fileName: string): void;
|
|
1044
|
+
declare class NVMesh {
|
|
1045
|
+
id: string;
|
|
1046
|
+
name: string;
|
|
1047
|
+
anatomicalStructurePrimary: string;
|
|
1048
|
+
colorbarVisible: boolean;
|
|
1049
|
+
furthestVertexFromOrigin: number;
|
|
1050
|
+
extentsMin: number | number[];
|
|
1051
|
+
extentsMax: number | number[];
|
|
1052
|
+
opacity: number;
|
|
1053
|
+
visible: boolean;
|
|
1054
|
+
meshShaderIndex: number;
|
|
1055
|
+
offsetPt0: Uint32Array | null;
|
|
1056
|
+
colormapInvert: boolean;
|
|
1057
|
+
fiberGroupColormap: ColorMap | null;
|
|
1058
|
+
indexBuffer: WebGLBuffer;
|
|
1059
|
+
vertexBuffer: WebGLBuffer;
|
|
1060
|
+
vao: WebGLVertexArrayObject;
|
|
1061
|
+
vaoFiber: WebGLVertexArrayObject;
|
|
1062
|
+
pts: Float32Array;
|
|
1063
|
+
tris?: Uint32Array;
|
|
1064
|
+
layers: NVMeshLayer[];
|
|
1065
|
+
type: MeshType;
|
|
1066
|
+
data_type?: string;
|
|
1067
|
+
rgba255: Uint8Array;
|
|
1068
|
+
fiberLength?: number;
|
|
1069
|
+
fiberLengths?: Uint32Array;
|
|
1070
|
+
fiberDither: number;
|
|
1071
|
+
fiberColor: string;
|
|
1072
|
+
fiberDecimationStride: number;
|
|
1073
|
+
fiberSides: number;
|
|
1074
|
+
fiberRadius: number;
|
|
1075
|
+
f32PerVertex: number;
|
|
1076
|
+
fiberMask?: unknown[];
|
|
1077
|
+
colormap?: ColorMap | LegacyConnectome | string | null;
|
|
1078
|
+
dpg?: ValuesArray | null;
|
|
1079
|
+
dps?: ValuesArray | null;
|
|
1080
|
+
dpv?: ValuesArray | null;
|
|
1081
|
+
hasConnectome: boolean;
|
|
1082
|
+
connectome?: LegacyConnectome | string;
|
|
1083
|
+
indexCount?: number;
|
|
1084
|
+
vertexCount: number;
|
|
1085
|
+
nodeScale: number;
|
|
1086
|
+
edgeScale: number;
|
|
1087
|
+
legendLineThickness: number;
|
|
1088
|
+
nodeColormap: string;
|
|
1089
|
+
edgeColormap: string;
|
|
1090
|
+
nodeColormapNegative?: string;
|
|
1091
|
+
edgeColormapNegative?: string;
|
|
1092
|
+
nodeMinColor?: number;
|
|
1093
|
+
nodeMaxColor?: number;
|
|
1094
|
+
edgeMin?: number;
|
|
1095
|
+
edgeMax?: number;
|
|
1096
|
+
nodes?: LegacyNodes | NVConnectomeNode[];
|
|
1097
|
+
edges?: number[] | NVConnectomeEdge[];
|
|
1098
|
+
points?: Point[];
|
|
1085
1099
|
/**
|
|
1086
|
-
*
|
|
1100
|
+
* @param pts - a 3xN array of vertex positions (X,Y,Z coordinates).
|
|
1101
|
+
* @param tris - a 3xN array of triangle indices (I,J,K; indexed from zero). Each triangle generated from three vertices.
|
|
1102
|
+
* @param name - a name for this image. Default is an empty string
|
|
1103
|
+
* @param rgba255 - the base color of the mesh. RGBA values from 0 to 255. Default is white
|
|
1104
|
+
* @param opacity - the opacity for this mesh. default is 1
|
|
1105
|
+
* @param visible - whether or not this image is to be visible
|
|
1106
|
+
* @param gl - WebGL rendering context
|
|
1107
|
+
* @param connectome - specify connectome edges and nodes. Default is null (not a connectome).
|
|
1108
|
+
* @param dpg - Data per group for tractography, see TRK format. Default is null (not tractograpgy)
|
|
1109
|
+
* @param dps - Data per streamline for tractography, see TRK format. Default is null (not tractograpgy)
|
|
1110
|
+
* @param dpv - Data per vertex for tractography, see TRK format. Default is null (not tractograpgy)
|
|
1111
|
+
* @param colorbarVisible - does this mesh display a colorbar
|
|
1112
|
+
* @param anatomicalStructurePrimary - region for mesh. Default is an empty string
|
|
1087
1113
|
*/
|
|
1088
|
-
|
|
1114
|
+
constructor(pts: Float32Array, tris: Uint32Array, name: string | undefined, rgba255: Uint8Array | undefined, opacity: number | undefined, visible: boolean | undefined, gl: WebGL2RenderingContext, connectome?: LegacyConnectome | string | null, dpg?: ValuesArray | null, dps?: ValuesArray | null, dpv?: ValuesArray | null, colorbarVisible?: boolean, anatomicalStructurePrimary?: string);
|
|
1115
|
+
initValuesArray(va: ValuesArray): ValuesArray;
|
|
1116
|
+
linesToCylinders(gl: WebGL2RenderingContext, posClrF32: Float32Array, indices: number[]): void;
|
|
1117
|
+
updateFibers(gl: WebGL2RenderingContext): void;
|
|
1118
|
+
indexNearestXYZmm(Xmm: number, Ymm: number, Zmm: number): number[];
|
|
1119
|
+
updateMesh(gl: WebGL2RenderingContext): void;
|
|
1120
|
+
reverseFaces(gl: WebGL2RenderingContext): void;
|
|
1121
|
+
setLayerProperty(id: number, key: keyof NVMeshLayer, val: number | string | boolean, gl: WebGL2RenderingContext): void;
|
|
1122
|
+
setProperty(key: keyof this, val: unknown, gl: WebGL2RenderingContext): void;
|
|
1123
|
+
generatePosNormClr(pts: Float32Array, tris: Uint32Array, rgba255: Uint8Array): Float32Array;
|
|
1124
|
+
static readMesh(buffer: ArrayBuffer, name: string, gl: WebGL2RenderingContext, opacity?: number, rgba255?: Uint8Array, visible?: boolean): NVMesh;
|
|
1125
|
+
static loadLayer(layer: NVMeshLayer, nvmesh: NVMesh): Promise<void>;
|
|
1089
1126
|
/**
|
|
1090
|
-
*
|
|
1127
|
+
* factory function to load and return a new NVMesh instance from a given URL
|
|
1091
1128
|
*/
|
|
1092
|
-
static loadFromUrl(url
|
|
1129
|
+
static loadFromUrl({ url, headers, gl, name, opacity, rgba255, visible, layers }?: Partial<LoadFromUrlParams>): Promise<NVMesh>;
|
|
1130
|
+
static readFileAsync(file: Blob): Promise<ArrayBuffer>;
|
|
1093
1131
|
/**
|
|
1094
|
-
*
|
|
1132
|
+
* factory function to load and return a new NVMesh instance from a file in the browser
|
|
1133
|
+
*
|
|
1134
|
+
* @returns NVMesh instance
|
|
1095
1135
|
*/
|
|
1096
|
-
static loadFromFile(file
|
|
1136
|
+
static loadFromFile({ file, gl, name, opacity, rgba255, visible, layers }?: Partial<LoadFromFileParams>): Promise<NVMesh>;
|
|
1097
1137
|
/**
|
|
1098
|
-
*
|
|
1138
|
+
* load and return a new NVMesh instance from a base64 encoded string
|
|
1099
1139
|
*/
|
|
1100
|
-
|
|
1140
|
+
loadFromBase64({ base64, gl, name, opacity, rgba255, visible, layers }?: Partial<LoadFromBase64Params>): Promise<NVMesh>;
|
|
1141
|
+
static readGII(buffer: ArrayBuffer): GII;
|
|
1142
|
+
static readX3D(buffer: ArrayBuffer): X3D;
|
|
1143
|
+
static readNII(buffer: ArrayBuffer, n_vert?: number): Uint8Array | Float32Array | Int32Array | Int16Array;
|
|
1144
|
+
static readNII2(buffer: ArrayBuffer, n_vert?: number): Uint8Array | Float32Array | Int32Array | Int16Array;
|
|
1145
|
+
static readMGH(buffer: ArrayBuffer): MGH;
|
|
1146
|
+
static readSTL(buffer: ArrayBuffer): DefaultMeshType;
|
|
1147
|
+
static readTxtSTL(buffer: ArrayBuffer): DefaultMeshType;
|
|
1148
|
+
static readSRF(buffer: ArrayBuffer): DefaultMeshType;
|
|
1149
|
+
static readFreeSurfer(buffer: ArrayBuffer): DefaultMeshType;
|
|
1150
|
+
static readOBJ(buffer: ArrayBuffer): DefaultMeshType;
|
|
1151
|
+
static readOFF(buffer: ArrayBuffer): DefaultMeshType;
|
|
1152
|
+
static readGEO(buffer: ArrayBuffer, isFlipWinding?: boolean): DefaultMeshType;
|
|
1153
|
+
static readICO(buffer: ArrayBuffer): DefaultMeshType;
|
|
1154
|
+
static readPLY(buffer: ArrayBuffer): DefaultMeshType;
|
|
1155
|
+
static readMZ3(buffer: ArrayBuffer, n_vert?: number): MZ3;
|
|
1156
|
+
static readVTK(buffer: ArrayBuffer): VTK;
|
|
1157
|
+
static readASC(buffer: ArrayBuffer): DefaultMeshType;
|
|
1158
|
+
static readNV(buffer: ArrayBuffer): DefaultMeshType;
|
|
1159
|
+
static readANNOT(buffer: ArrayBuffer, n_vert: number, isReadColortables?: boolean): ANNOT;
|
|
1160
|
+
static readCURV(buffer: ArrayBuffer, n_vert: number): Float32Array;
|
|
1161
|
+
static readSTC(buffer: ArrayBuffer, n_vert: number): Float32Array;
|
|
1162
|
+
static readSMP(buffer: ArrayBuffer, n_vert: number): Float32Array;
|
|
1163
|
+
static readTxtVTK(buffer: ArrayBuffer): VTK;
|
|
1164
|
+
static readTRK(buffer: ArrayBuffer): TRK;
|
|
1165
|
+
static readTCK(buffer: ArrayBuffer): TCK;
|
|
1166
|
+
static readTSF(buffer: ArrayBuffer): Float32Array;
|
|
1167
|
+
static readTT(buffer: ArrayBuffer): TT;
|
|
1168
|
+
static readTRX(buffer: ArrayBuffer): TRX;
|
|
1169
|
+
static readTRACT(buffer: ArrayBuffer): TRACT;
|
|
1101
1170
|
}
|
|
1102
1171
|
|
|
1103
1172
|
/**
|
|
@@ -1219,6 +1288,7 @@ declare class SessionBus {
|
|
|
1219
1288
|
|
|
1220
1289
|
/**
|
|
1221
1290
|
* NVController is for synchronizing both remote and local instances of Niivue
|
|
1291
|
+
* @ignore
|
|
1222
1292
|
*/
|
|
1223
1293
|
declare class NVController {
|
|
1224
1294
|
niivue: Niivue;
|
|
@@ -1308,6 +1378,7 @@ declare class NVController {
|
|
|
1308
1378
|
|
|
1309
1379
|
/**
|
|
1310
1380
|
* Namespace for utility functions
|
|
1381
|
+
* @ignore
|
|
1311
1382
|
*/
|
|
1312
1383
|
declare class NVUtilities {
|
|
1313
1384
|
static arrayBufferToBase64(arrayBuffer: ArrayBuffer): string;
|
|
@@ -1341,6 +1412,7 @@ declare class NVUtilities {
|
|
|
1341
1412
|
|
|
1342
1413
|
/**
|
|
1343
1414
|
* Class to load different mesh formats
|
|
1415
|
+
* @ignore
|
|
1344
1416
|
*/
|
|
1345
1417
|
declare class NVMeshLoaders {
|
|
1346
1418
|
static readTRACT(buffer: ArrayBuffer): TRACT;
|
|
@@ -1377,17 +1449,6 @@ declare class NVMeshLoaders {
|
|
|
1377
1449
|
static readGII(buffer: ArrayBuffer, n_vert?: number): GII;
|
|
1378
1450
|
}
|
|
1379
1451
|
|
|
1380
|
-
type DragReleaseParams = {
|
|
1381
|
-
fracStart: vec3;
|
|
1382
|
-
fracEnd: vec3;
|
|
1383
|
-
voxStart: vec3;
|
|
1384
|
-
voxEnd: vec3;
|
|
1385
|
-
mmStart: vec4;
|
|
1386
|
-
mmEnd: vec4;
|
|
1387
|
-
mmLength: number;
|
|
1388
|
-
tileIdx: number;
|
|
1389
|
-
axCorSag: SLICE_TYPE;
|
|
1390
|
-
};
|
|
1391
1452
|
type ColormapListEntry = {
|
|
1392
1453
|
name: string;
|
|
1393
1454
|
min: number;
|
|
@@ -1450,55 +1511,6 @@ type MM = {
|
|
|
1450
1511
|
rotation: mat4;
|
|
1451
1512
|
fovMM: vec3;
|
|
1452
1513
|
};
|
|
1453
|
-
/**
|
|
1454
|
-
* Niivue exposes many properties. It's always good to call `updateGLVolume` after altering one of these settings.
|
|
1455
|
-
*/
|
|
1456
|
-
type NiiVueOptions = {
|
|
1457
|
-
textHeight?: number;
|
|
1458
|
-
colorbarHeight?: number;
|
|
1459
|
-
colorbarMargin?: number;
|
|
1460
|
-
crosshairWidth?: number;
|
|
1461
|
-
rulerWidth?: number;
|
|
1462
|
-
backColor?: number[];
|
|
1463
|
-
crosshairColor?: number[];
|
|
1464
|
-
fontColor?: number[];
|
|
1465
|
-
selectionBoxColor?: number[];
|
|
1466
|
-
clipPlaneColor?: number[];
|
|
1467
|
-
rulerColor?: number[];
|
|
1468
|
-
show3Dcrosshair?: boolean;
|
|
1469
|
-
trustCalMinMax?: boolean;
|
|
1470
|
-
clipPlaneHotKey?: string;
|
|
1471
|
-
viewModeHotKey?: string;
|
|
1472
|
-
keyDebounceTime?: number;
|
|
1473
|
-
doubleTouchTimeout?: number;
|
|
1474
|
-
longTouchTimeout?: number;
|
|
1475
|
-
isRadiologicalConvention?: boolean;
|
|
1476
|
-
logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'silent';
|
|
1477
|
-
loadingText?: string;
|
|
1478
|
-
dragAndDropEnabled?: boolean;
|
|
1479
|
-
isNearestInterpolation?: boolean;
|
|
1480
|
-
atlasOutline?: number;
|
|
1481
|
-
isRuler?: boolean;
|
|
1482
|
-
isColorbar?: boolean;
|
|
1483
|
-
isOrientCube?: boolean;
|
|
1484
|
-
multiplanarPadPixels?: number;
|
|
1485
|
-
multiplanarForceRender?: boolean;
|
|
1486
|
-
meshThicknessOn2D?: number;
|
|
1487
|
-
dragMode?: DRAG_MODE;
|
|
1488
|
-
isDepthPickMesh?: boolean;
|
|
1489
|
-
isCornerOrientationText?: boolean;
|
|
1490
|
-
sagittalNoseLeft?: boolean;
|
|
1491
|
-
isSliceMM?: boolean;
|
|
1492
|
-
isV1SliceShader?: boolean;
|
|
1493
|
-
isHighResolutionCapable?: boolean;
|
|
1494
|
-
isForceMouseClickToVoxelCenters?: boolean;
|
|
1495
|
-
drawingEnabled?: boolean;
|
|
1496
|
-
penValue?: number;
|
|
1497
|
-
floodFillNeighbors?: number;
|
|
1498
|
-
maxDrawUndoBitmaps?: number;
|
|
1499
|
-
thumbnail?: string;
|
|
1500
|
-
meshXRay?: number;
|
|
1501
|
-
};
|
|
1502
1514
|
type UIData = {
|
|
1503
1515
|
mousedown: boolean;
|
|
1504
1516
|
touchdown: boolean;
|
|
@@ -1534,7 +1546,7 @@ type SaveImageOptions = {
|
|
|
1534
1546
|
* loading and rendering NIFTI image data in a WebGL 2.0 context.
|
|
1535
1547
|
*
|
|
1536
1548
|
* @example
|
|
1537
|
-
* let niivue = new Niivue(
|
|
1549
|
+
* let niivue = new Niivue({crosshairColor: [0,1,0,0.5], textHeight: 0.5}) // a see-through green crosshair, and larger text labels
|
|
1538
1550
|
*/
|
|
1539
1551
|
declare class Niivue {
|
|
1540
1552
|
canvas: HTMLCanvasElement | null;
|
|
@@ -1657,132 +1669,131 @@ declare class Niivue {
|
|
|
1657
1669
|
sliceTypeSagittal: SLICE_TYPE;
|
|
1658
1670
|
sliceTypeMultiplanar: SLICE_TYPE;
|
|
1659
1671
|
sliceTypeRender: SLICE_TYPE;
|
|
1660
|
-
sliceMosaicString: string;
|
|
1661
1672
|
/**
|
|
1662
1673
|
* callback function to run when the right mouse button is released after dragging
|
|
1663
1674
|
* @example
|
|
1664
|
-
* niivue.onDragRelease = ()
|
|
1675
|
+
* niivue.onDragRelease = () => {
|
|
1665
1676
|
* console.log('drag ended')
|
|
1666
|
-
*
|
|
1677
|
+
* }
|
|
1667
1678
|
*/
|
|
1668
1679
|
onDragRelease: (params: DragReleaseParams) => void;
|
|
1669
1680
|
/**
|
|
1670
1681
|
* callback function to run when the left mouse button is released
|
|
1671
1682
|
* @example
|
|
1672
|
-
* niivue.onMouseUp = ()
|
|
1683
|
+
* niivue.onMouseUp = () => {
|
|
1673
1684
|
* console.log('mouse up')
|
|
1674
|
-
*
|
|
1685
|
+
* }
|
|
1675
1686
|
*/
|
|
1676
1687
|
onMouseUp: (data: Partial<UIData>) => void;
|
|
1677
1688
|
/**
|
|
1678
1689
|
* callback function to run when the crosshair location changes
|
|
1679
1690
|
* @example
|
|
1680
|
-
* niivue.onLocationChange = (data)
|
|
1691
|
+
* niivue.onLocationChange = (data) => {
|
|
1681
1692
|
* console.log('location changed')
|
|
1682
1693
|
* console.log('mm: ', data.mm)
|
|
1683
1694
|
* console.log('vox: ', data.vox)
|
|
1684
1695
|
* console.log('frac: ', data.frac)
|
|
1685
1696
|
* console.log('values: ', data.values)
|
|
1686
|
-
*
|
|
1697
|
+
* }
|
|
1687
1698
|
*/
|
|
1688
1699
|
onLocationChange: (location: unknown) => void;
|
|
1689
1700
|
/**
|
|
1690
1701
|
* callback function to run when the user changes the intensity range with the selection box action (right click)
|
|
1691
1702
|
* @example
|
|
1692
|
-
* niivue.onIntensityChange = (volume)
|
|
1703
|
+
* niivue.onIntensityChange = (volume) => {
|
|
1693
1704
|
* console.log('intensity changed')
|
|
1694
1705
|
* console.log('volume: ', volume)
|
|
1695
|
-
*
|
|
1706
|
+
* }
|
|
1696
1707
|
*/
|
|
1697
1708
|
onIntensityChange: (volume: NVImage) => void;
|
|
1698
1709
|
/**
|
|
1699
1710
|
* callback function to run when a new volume is loaded
|
|
1700
1711
|
* @example
|
|
1701
|
-
* niivue.onImageLoaded = (volume)
|
|
1712
|
+
* niivue.onImageLoaded = (volume) => {
|
|
1702
1713
|
* console.log('volume loaded')
|
|
1703
1714
|
* console.log('volume: ', volume)
|
|
1704
|
-
*
|
|
1715
|
+
* }
|
|
1705
1716
|
*/
|
|
1706
1717
|
onImageLoaded: (volume: NVImage) => void;
|
|
1707
1718
|
/**
|
|
1708
1719
|
* callback function to run when a new mesh is loaded
|
|
1709
1720
|
* @example
|
|
1710
|
-
* niivue.onMeshLoaded = (mesh)
|
|
1721
|
+
* niivue.onMeshLoaded = (mesh) => {
|
|
1711
1722
|
* console.log('mesh loaded')
|
|
1712
1723
|
* console.log('mesh: ', mesh)
|
|
1713
|
-
*
|
|
1724
|
+
* }
|
|
1714
1725
|
*/
|
|
1715
1726
|
onMeshLoaded: (mesh: NVMesh) => void;
|
|
1716
1727
|
/**
|
|
1717
1728
|
* callback function to run when the user changes the volume when a 4D image is loaded
|
|
1718
1729
|
* @example
|
|
1719
|
-
* niivue.onFrameChange = (volume, frameNumber)
|
|
1730
|
+
* niivue.onFrameChange = (volume, frameNumber) => {
|
|
1720
1731
|
* console.log('frame changed')
|
|
1721
1732
|
* console.log('volume: ', volume)
|
|
1722
1733
|
* console.log('frameNumber: ', frameNumber)
|
|
1723
|
-
*
|
|
1734
|
+
* }
|
|
1724
1735
|
*/
|
|
1725
1736
|
onFrameChange: (volume: NVImage, index: number) => void;
|
|
1726
1737
|
/**
|
|
1727
1738
|
* callback function to run when niivue reports an error
|
|
1728
1739
|
* @example
|
|
1729
|
-
* niivue.onError = (error)
|
|
1740
|
+
* niivue.onError = (error) => {
|
|
1730
1741
|
* console.log('error: ', error)
|
|
1731
|
-
*
|
|
1742
|
+
* }
|
|
1732
1743
|
*/
|
|
1733
1744
|
onError: () => void;
|
|
1734
1745
|
onColormapChange: () => void;
|
|
1735
1746
|
/**
|
|
1736
1747
|
* callback function to run when niivue reports detailed info
|
|
1737
1748
|
* @example
|
|
1738
|
-
* niivue.onInfo = (info)
|
|
1749
|
+
* niivue.onInfo = (info) => {
|
|
1739
1750
|
* console.log('info: ', info)
|
|
1740
|
-
*
|
|
1751
|
+
* }
|
|
1741
1752
|
*/
|
|
1742
1753
|
onInfo: () => void;
|
|
1743
1754
|
/**
|
|
1744
1755
|
* callback function to run when niivue reports a warning
|
|
1745
1756
|
* @example
|
|
1746
|
-
* niivue.onWarn = (warn)
|
|
1757
|
+
* niivue.onWarn = (warn) => {
|
|
1747
1758
|
* console.log('warn: ', warn)
|
|
1748
|
-
*
|
|
1759
|
+
* }
|
|
1749
1760
|
*/
|
|
1750
1761
|
onWarn: () => void;
|
|
1751
1762
|
/**
|
|
1752
1763
|
* callback function to run when niivue reports a debug message
|
|
1753
1764
|
* @example
|
|
1754
|
-
* niivue.onDebug = (debug)
|
|
1765
|
+
* niivue.onDebug = (debug) => {
|
|
1755
1766
|
* console.log('debug: ', debug)
|
|
1756
|
-
*
|
|
1767
|
+
* }
|
|
1757
1768
|
*/
|
|
1758
1769
|
onDebug: () => void;
|
|
1759
1770
|
/**
|
|
1760
1771
|
* callback function to run when a volume is added from a url
|
|
1761
1772
|
* @example
|
|
1762
|
-
* niivue.onVolumeAddedFromUrl = (imageOptions, volume)
|
|
1773
|
+
* niivue.onVolumeAddedFromUrl = (imageOptions, volume) => {
|
|
1763
1774
|
* console.log('volume added from url')
|
|
1764
1775
|
* console.log('imageOptions: ', imageOptions)
|
|
1765
1776
|
* console.log('volume: ', volume)
|
|
1766
|
-
*
|
|
1777
|
+
* }
|
|
1767
1778
|
*/
|
|
1768
1779
|
onVolumeAddedFromUrl: (imageOptions: ImageFromUrlOptions, volume: NVImage) => void;
|
|
1769
1780
|
onVolumeWithUrlRemoved: (url: string) => void;
|
|
1770
1781
|
/**
|
|
1771
1782
|
* callback function to run when updateGLVolume is called (most users will not need to use
|
|
1772
1783
|
* @example
|
|
1773
|
-
* niivue.onVolumeUpdated = ()
|
|
1784
|
+
* niivue.onVolumeUpdated = () => {
|
|
1774
1785
|
* console.log('volume updated')
|
|
1775
|
-
*
|
|
1786
|
+
* }
|
|
1776
1787
|
*/
|
|
1777
1788
|
onVolumeUpdated: () => void;
|
|
1778
1789
|
/**
|
|
1779
1790
|
* callback function to run when a mesh is added from a url
|
|
1780
1791
|
* @example
|
|
1781
|
-
* niivue.onMeshAddedFromUrl = (meshOptions, mesh)
|
|
1792
|
+
* niivue.onMeshAddedFromUrl = (meshOptions, mesh) => {
|
|
1782
1793
|
* console.log('mesh added from url')
|
|
1783
1794
|
* console.log('meshOptions: ', meshOptions)
|
|
1784
1795
|
* console.log('mesh: ', mesh)
|
|
1785
|
-
*
|
|
1796
|
+
* }
|
|
1786
1797
|
*/
|
|
1787
1798
|
onMeshAddedFromUrl: (meshOptions: LoadFromUrlParams, mesh: NVMesh) => void;
|
|
1788
1799
|
onMeshAdded: () => void;
|
|
@@ -1791,18 +1802,18 @@ declare class Niivue {
|
|
|
1791
1802
|
/**
|
|
1792
1803
|
* callback function to run when the user changes the rotation of the 3D rendering
|
|
1793
1804
|
* @example
|
|
1794
|
-
* niivue.onAzimuthElevationChange = (azimuth, elevation)
|
|
1805
|
+
* niivue.onAzimuthElevationChange = (azimuth, elevation) => {
|
|
1795
1806
|
* console.log('azimuth: ', azimuth)
|
|
1796
1807
|
* console.log('elevation: ', elevation)
|
|
1797
|
-
*
|
|
1808
|
+
* }
|
|
1798
1809
|
*/
|
|
1799
1810
|
onAzimuthElevationChange: (azimuth: number, elevation: number) => void;
|
|
1800
1811
|
/**
|
|
1801
1812
|
* callback function to run when the user changes the clip plane
|
|
1802
1813
|
* @example
|
|
1803
|
-
* niivue.onClipPlaneChange = (clipPlane)
|
|
1814
|
+
* niivue.onClipPlaneChange = (clipPlane) => {
|
|
1804
1815
|
* console.log('clipPlane: ', clipPlane)
|
|
1805
|
-
*
|
|
1816
|
+
* }
|
|
1806
1817
|
*/
|
|
1807
1818
|
onClipPlaneChange: (clipPlane: number[]) => void;
|
|
1808
1819
|
onCustomMeshShaderAdded: (fragmentShaderText: string, name: string) => void;
|
|
@@ -1811,101 +1822,24 @@ declare class Niivue {
|
|
|
1811
1822
|
/**
|
|
1812
1823
|
* callback function to run when the user loads a new NiiVue document
|
|
1813
1824
|
* @example
|
|
1814
|
-
* niivue.onDocumentLoaded = (document)
|
|
1825
|
+
* niivue.onDocumentLoaded = (document) => {
|
|
1815
1826
|
* console.log('document: ', document)
|
|
1816
|
-
*
|
|
1827
|
+
* }
|
|
1817
1828
|
*/
|
|
1818
1829
|
onDocumentLoaded: (document: NVDocument) => void;
|
|
1819
1830
|
document: NVDocument;
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
crosshairGap: number;
|
|
1825
|
-
rulerWidth: number;
|
|
1826
|
-
show3Dcrosshair: boolean;
|
|
1827
|
-
backColor: number[];
|
|
1828
|
-
crosshairColor: number[];
|
|
1829
|
-
fontColor: number[];
|
|
1830
|
-
selectionBoxColor: number[];
|
|
1831
|
-
clipPlaneColor: number[];
|
|
1832
|
-
rulerColor: number[];
|
|
1833
|
-
colorbarMargin: number;
|
|
1834
|
-
trustCalMinMax: boolean;
|
|
1835
|
-
clipPlaneHotKey: string;
|
|
1836
|
-
viewModeHotKey: string;
|
|
1837
|
-
doubleTouchTimeout: number;
|
|
1838
|
-
longTouchTimeout: number;
|
|
1839
|
-
keyDebounceTime: number;
|
|
1840
|
-
isNearestInterpolation: boolean;
|
|
1841
|
-
atlasOutline: number;
|
|
1842
|
-
isRuler: boolean;
|
|
1843
|
-
isColorbar: boolean;
|
|
1844
|
-
isOrientCube: boolean;
|
|
1845
|
-
multiplanarPadPixels: number;
|
|
1846
|
-
multiplanarForceRender: boolean;
|
|
1847
|
-
isRadiologicalConvention: boolean;
|
|
1848
|
-
meshThicknessOn2D: string | number;
|
|
1849
|
-
dragMode: DRAG_MODE;
|
|
1850
|
-
yoke3Dto2DZoom: boolean;
|
|
1851
|
-
isDepthPickMesh: boolean;
|
|
1852
|
-
isCornerOrientationText: boolean;
|
|
1853
|
-
sagittalNoseLeft: boolean;
|
|
1854
|
-
isSliceMM: boolean;
|
|
1855
|
-
isV1SliceShader: boolean;
|
|
1856
|
-
isHighResolutionCapable: boolean;
|
|
1857
|
-
logLevel: "debug" | "info" | "warn" | "error" | "fatal" | "silent";
|
|
1858
|
-
loadingText: string;
|
|
1859
|
-
isForceMouseClickToVoxelCenters: boolean;
|
|
1860
|
-
dragAndDropEnabled: boolean;
|
|
1861
|
-
drawingEnabled: boolean;
|
|
1862
|
-
penValue: number;
|
|
1863
|
-
floodFillNeighbors: number;
|
|
1864
|
-
isFilledPen: boolean;
|
|
1865
|
-
thumbnail: string;
|
|
1866
|
-
maxDrawUndoBitmaps: number;
|
|
1867
|
-
sliceType: SLICE_TYPE;
|
|
1868
|
-
isAntiAlias: boolean | null;
|
|
1869
|
-
isAdditiveBlend: boolean;
|
|
1870
|
-
isResizeCanvas: boolean;
|
|
1871
|
-
meshXRay: number;
|
|
1872
|
-
limitFrames4D: number;
|
|
1873
|
-
showLegend: boolean;
|
|
1874
|
-
legendBackgroundColor: number[];
|
|
1875
|
-
legendTextColor: number[];
|
|
1876
|
-
multiplanarLayout: MULTIPLANAR_TYPE;
|
|
1877
|
-
renderOverlayBlend: number;
|
|
1878
|
-
};
|
|
1879
|
-
scene: {
|
|
1880
|
-
onAzimuthElevationChange: (azimuth: number, elevation: number) => void;
|
|
1881
|
-
onZoom3DChange: (scale: number) => void;
|
|
1882
|
-
sceneData: {
|
|
1883
|
-
azimuth: number;
|
|
1884
|
-
elevation: number;
|
|
1885
|
-
crosshairPos: vec3;
|
|
1886
|
-
clipPlane: number[];
|
|
1887
|
-
clipPlaneDepthAziElev: number[];
|
|
1888
|
-
volScaleMultiplier: number;
|
|
1889
|
-
pan2Dxyzmm: vec4;
|
|
1890
|
-
};
|
|
1891
|
-
renderAzimuth: number;
|
|
1892
|
-
renderElevation: number;
|
|
1893
|
-
volScaleMultiplier: number;
|
|
1894
|
-
crosshairPos: vec3;
|
|
1895
|
-
clipPlane: number[];
|
|
1896
|
-
clipPlaneDepthAziElev: number[];
|
|
1897
|
-
pan2Dxyzmm: vec4;
|
|
1898
|
-
_elevation?: number | undefined;
|
|
1899
|
-
_azimuth?: number | undefined;
|
|
1900
|
-
};
|
|
1831
|
+
get scene(): Scene;
|
|
1832
|
+
get opts(): NVConfigOptions;
|
|
1833
|
+
get sliceMosaicString(): string;
|
|
1834
|
+
set sliceMosaicString(newSliceMosaicString: string);
|
|
1901
1835
|
mediaUrlMap: Map<NVImage | NVMesh, string>;
|
|
1902
1836
|
initialized: boolean;
|
|
1903
1837
|
currentDrawUndoBitmap: number;
|
|
1904
1838
|
loadingText: string;
|
|
1905
1839
|
/**
|
|
1906
|
-
* @param options
|
|
1840
|
+
* @param options - options object to set modifiable Niivue properties
|
|
1907
1841
|
*/
|
|
1908
|
-
constructor(options?: Partial<
|
|
1842
|
+
constructor(options?: Partial<NVConfigOptions>);
|
|
1909
1843
|
get volumes(): NVImage[];
|
|
1910
1844
|
set volumes(volumes: NVImage[]);
|
|
1911
1845
|
get meshes(): NVMesh[];
|
|
@@ -1918,7 +1852,7 @@ declare class Niivue {
|
|
|
1918
1852
|
* save webgl2 canvas as png format bitmap
|
|
1919
1853
|
* @param filename - filename for screen capture
|
|
1920
1854
|
* @example niivue.saveScene('test.png');
|
|
1921
|
-
* @see {@link https://niivue.github.io/niivue/features/ui.html|live demo usage}
|
|
1855
|
+
* @see {@link https://niivue.github.io/niivue/features/ui.html | live demo usage}
|
|
1922
1856
|
*/
|
|
1923
1857
|
saveScene(filename?: string): Promise<void>;
|
|
1924
1858
|
/**
|
|
@@ -1927,7 +1861,7 @@ declare class Niivue {
|
|
|
1927
1861
|
* @param isAntiAlias - determines if anti-aliasing is requested (if not specified, AA usage depends on hardware)
|
|
1928
1862
|
* @example niivue = new Niivue().attachTo('gl')
|
|
1929
1863
|
* @example niivue.attachTo('gl')
|
|
1930
|
-
* @see {@link https://niivue.github.io/niivue/features/multiplanar.html|live demo usage}
|
|
1864
|
+
* @see {@link https://niivue.github.io/niivue/features/basic.multiplanar.html | live demo usage}
|
|
1931
1865
|
*/
|
|
1932
1866
|
attachTo(id: string, isAntiAlias?: null): Promise<this>;
|
|
1933
1867
|
/**
|
|
@@ -1946,7 +1880,7 @@ declare class Niivue {
|
|
|
1946
1880
|
* niivue2 = new Niivue()
|
|
1947
1881
|
* niivue2.syncWith(niivue1)
|
|
1948
1882
|
* @deprecated use broadcastTo instead
|
|
1949
|
-
* @see {@link https://niivue.github.io/niivue/features/sync.mesh.html|live demo usage}
|
|
1883
|
+
* @see {@link https://niivue.github.io/niivue/features/sync.mesh.html | live demo usage}
|
|
1950
1884
|
*/
|
|
1951
1885
|
syncWith(otherNV: Niivue, syncOpts?: {
|
|
1952
1886
|
'2d': boolean;
|
|
@@ -1961,7 +1895,7 @@ declare class Niivue {
|
|
|
1961
1895
|
* niivue3 = new Niivue()
|
|
1962
1896
|
* niivue1.broadcastTo(niivue2)
|
|
1963
1897
|
* niivue1.broadcastTo([niivue2, niivue3])
|
|
1964
|
-
* @see {@link https://niivue.github.io/niivue/features/sync.mesh.html|live demo usage}
|
|
1898
|
+
* @see {@link https://niivue.github.io/niivue/features/sync.mesh.html | live demo usage}
|
|
1965
1899
|
*/
|
|
1966
1900
|
broadcastTo(otherNV: Niivue | Niivue[], syncOpts?: {
|
|
1967
1901
|
'2d': boolean;
|
|
@@ -2038,7 +1972,7 @@ declare class Niivue {
|
|
|
2038
1972
|
getFileExt(fullname: string, upperCase?: boolean): string;
|
|
2039
1973
|
/**
|
|
2040
1974
|
* Add an image and notify subscribers
|
|
2041
|
-
* @see {@link https://niivue.github.io/niivue/features/document.3d.html|live demo usage}
|
|
1975
|
+
* @see {@link https://niivue.github.io/niivue/features/document.3d.html | live demo usage}
|
|
2042
1976
|
*/
|
|
2043
1977
|
addVolumeFromUrl(imageOptions: ImageFromUrlOptions): Promise<NVImage>;
|
|
2044
1978
|
/**
|
|
@@ -2048,7 +1982,7 @@ declare class Niivue {
|
|
|
2048
1982
|
/**
|
|
2049
1983
|
* Remove volume by url
|
|
2050
1984
|
* @param url - Volume added by url to remove
|
|
2051
|
-
* @see {@link https://niivue.github.io/niivue/features/document.3d.html|live demo usage}
|
|
1985
|
+
* @see {@link https://niivue.github.io/niivue/features/document.3d.html | live demo usage}
|
|
2052
1986
|
*/
|
|
2053
1987
|
removeVolumeByUrl(url: string): void;
|
|
2054
1988
|
readDirectory(directory: FileSystemDirectoryEntry): FileSystemEntry[];
|
|
@@ -2062,28 +1996,28 @@ declare class Niivue {
|
|
|
2062
1996
|
* insert a gap between slices of a mutliplanar view.
|
|
2063
1997
|
* @param pixels - spacing between tiles of multiplanar view
|
|
2064
1998
|
* @example niivue.setMultiplanarPadPixels(4)
|
|
2065
|
-
* @see {@link https://niivue.github.io/niivue/features/atlas.html|live demo usage}
|
|
1999
|
+
* @see {@link https://niivue.github.io/niivue/features/atlas.html | live demo usage}
|
|
2066
2000
|
*/
|
|
2067
2001
|
setMultiplanarPadPixels(pixels: number): void;
|
|
2068
2002
|
/**
|
|
2069
2003
|
* control placement of 2D slices.
|
|
2070
2004
|
* @param layout - AUTO: 0, COLUMN: 1, GRID: 2, ROW: 3,
|
|
2071
2005
|
* @example niivue.setMultiplanarLayout(2)
|
|
2072
|
-
* @see {@link https://niivue.github.io/niivue/features/layout.html|live demo usage}
|
|
2006
|
+
* @see {@link https://niivue.github.io/niivue/features/layout.html | live demo usage}
|
|
2073
2007
|
*/
|
|
2074
2008
|
setMultiplanarLayout(layout: number): void;
|
|
2075
2009
|
/**
|
|
2076
2010
|
* determine if text appears at corner (true) or sides of 2D slice.
|
|
2077
2011
|
* @param isCornerOrientationText - controls position of text
|
|
2078
2012
|
* @example niivue.setCornerOrientationText(true)
|
|
2079
|
-
* @see {@link https://niivue.github.io/niivue/features/worldspace2.html|live demo usage}
|
|
2013
|
+
* @see {@link https://niivue.github.io/niivue/features/worldspace2.html | live demo usage}
|
|
2080
2014
|
*/
|
|
2081
2015
|
setCornerOrientationText(isCornerOrientationText: boolean): void;
|
|
2082
2016
|
/**
|
|
2083
2017
|
* control whether 2D slices use radiological or neurological convention.
|
|
2084
2018
|
* @param isRadiologicalConvention - new display convention
|
|
2085
|
-
* @example niivue.
|
|
2086
|
-
* @see {@link https://niivue.github.io/niivue/features/worldspace.html|live demo usage}
|
|
2019
|
+
* @example niivue.setRadiologicalConvention(true)
|
|
2020
|
+
* @see {@link https://niivue.github.io/niivue/features/worldspace.html | live demo usage}
|
|
2087
2021
|
*/
|
|
2088
2022
|
setRadiologicalConvention(isRadiologicalConvention: boolean): void;
|
|
2089
2023
|
/**
|
|
@@ -2091,35 +2025,35 @@ declare class Niivue {
|
|
|
2091
2025
|
* @param options - @see NiiVueOptions
|
|
2092
2026
|
* @param resetBriCon - also reset contrast (default false).
|
|
2093
2027
|
* @example niivue.nv1.setDefaults(opts, true);
|
|
2094
|
-
* @see {@link https://niivue.github.io/niivue/features/connectome.html|live demo usage}
|
|
2028
|
+
* @see {@link https://niivue.github.io/niivue/features/connectome.html | live demo usage}
|
|
2095
2029
|
*/
|
|
2096
|
-
setDefaults(options?: Partial<
|
|
2030
|
+
setDefaults(options?: Partial<NVConfigOptions>, resetBriCon?: boolean): void;
|
|
2097
2031
|
/**
|
|
2098
2032
|
* Limit visibility of mesh in front of a 2D image. Requires world-space mode.
|
|
2099
2033
|
* @param meshThicknessOn2D - distance from voxels for clipping mesh. Use Infinity to show entire mesh or 0.0 to hide mesh.
|
|
2100
2034
|
* @example niivue.setMeshThicknessOn2D(42)
|
|
2101
|
-
* @see {@link https://niivue.github.io/niivue/features/worldspace2.html|live demo usage}
|
|
2035
|
+
* @see {@link https://niivue.github.io/niivue/features/worldspace2.html | live demo usage}
|
|
2102
2036
|
*/
|
|
2103
2037
|
setMeshThicknessOn2D(meshThicknessOn2D: number): void;
|
|
2104
2038
|
/**
|
|
2105
2039
|
* Create a custom multi-slice mosaic (aka lightbox, montage) view.
|
|
2106
2040
|
* @param str - description of mosaic.
|
|
2107
2041
|
* @example niivue.setSliceMosaicString("A 0 20 C 30 S 42")
|
|
2108
|
-
* @see {@link https://niivue.github.io/niivue/features/mosaics.html|live demo usage}
|
|
2042
|
+
* @see {@link https://niivue.github.io/niivue/features/mosaics.html | live demo usage}
|
|
2109
2043
|
*/
|
|
2110
2044
|
setSliceMosaicString(str: string): void;
|
|
2111
2045
|
/**
|
|
2112
2046
|
* control 2D slice view mode.
|
|
2113
2047
|
* @param isSliceMM - control whether 2D slices use world space (true) or voxel space (false). Beware that voxel space mode limits properties like panning, zooming and mesh visibility.
|
|
2114
2048
|
* @example niivue.setSliceMM(true)
|
|
2115
|
-
* @see {@link https://niivue.github.io/niivue/features/worldspace2.html|live demo usage}
|
|
2049
|
+
* @see {@link https://niivue.github.io/niivue/features/worldspace2.html | live demo usage}
|
|
2116
2050
|
*/
|
|
2117
2051
|
setSliceMM(isSliceMM: boolean): void;
|
|
2118
2052
|
/**
|
|
2119
2053
|
* control whether voxel overlays are combined using additive (emission) or traditional (transmission) blending.
|
|
2120
2054
|
* @param isAdditiveBlend - emission (true) or transmission (false) mixing
|
|
2121
2055
|
* @example niivue.isAdditiveBlend(true)
|
|
2122
|
-
* @see {@link https://niivue.github.io/niivue/features/additive.voxels.html|live demo usage}
|
|
2056
|
+
* @see {@link https://niivue.github.io/niivue/features/additive.voxels.html | live demo usage}
|
|
2123
2057
|
*/
|
|
2124
2058
|
setAdditiveBlend(isAdditiveBlend: boolean): void;
|
|
2125
2059
|
/**
|
|
@@ -2132,7 +2066,7 @@ declare class Niivue {
|
|
|
2132
2066
|
* Force WebGL canvas to use high resolution display, regardless of browser defaults.
|
|
2133
2067
|
* @param isHighResolutionCapable - allow high-DPI display
|
|
2134
2068
|
* @example niivue.setHighResolutionCapable(true);
|
|
2135
|
-
* @see {@link https://niivue.github.io/niivue/features/sync.mesh.html|live demo usage}
|
|
2069
|
+
* @see {@link https://niivue.github.io/niivue/features/sync.mesh.html | live demo usage}
|
|
2136
2070
|
*/
|
|
2137
2071
|
setHighResolutionCapable(isHighResolutionCapable: boolean): void;
|
|
2138
2072
|
/**
|
|
@@ -2140,8 +2074,8 @@ declare class Niivue {
|
|
|
2140
2074
|
* @param volume - the new volume to add to the canvas
|
|
2141
2075
|
* @example
|
|
2142
2076
|
* niivue = new Niivue()
|
|
2143
|
-
* niivue.addVolume(NVImage.loadFromUrl(
|
|
2144
|
-
* @see {@link https://niivue.github.io/niivue/features/document.3d.html|live demo usage}
|
|
2077
|
+
* niivue.addVolume(NVImage.loadFromUrl({url:'../someURL.nii.gz'}))
|
|
2078
|
+
* @see {@link https://niivue.github.io/niivue/features/document.3d.html | live demo usage}
|
|
2145
2079
|
*/
|
|
2146
2080
|
addVolume(volume: NVImage): void;
|
|
2147
2081
|
/**
|
|
@@ -2149,8 +2083,8 @@ declare class Niivue {
|
|
|
2149
2083
|
* @param mesh - the new mesh to add to the canvas
|
|
2150
2084
|
* @example
|
|
2151
2085
|
* niivue = new Niivue()
|
|
2152
|
-
* niivue.addMesh(NVMesh.loadFromUrl(
|
|
2153
|
-
* @see {@link https://niivue.github.io/niivue/features/document.3d.html|live demo usage}
|
|
2086
|
+
* niivue.addMesh(NVMesh.loadFromUrl({url:'../someURL.gii'}))
|
|
2087
|
+
* @see {@link https://niivue.github.io/niivue/features/document.3d.html | live demo usage}
|
|
2154
2088
|
*/
|
|
2155
2089
|
addMesh(mesh: NVMesh): void;
|
|
2156
2090
|
/**
|
|
@@ -2166,7 +2100,7 @@ declare class Niivue {
|
|
|
2166
2100
|
/**
|
|
2167
2101
|
* Restore drawing to previous state
|
|
2168
2102
|
* @example niivue.drawUndo();
|
|
2169
|
-
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html|live demo usage}
|
|
2103
|
+
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html | live demo usage}
|
|
2170
2104
|
*/
|
|
2171
2105
|
drawUndo(): void;
|
|
2172
2106
|
loadDrawing(drawingBitmap: NVImage): boolean;
|
|
@@ -2176,7 +2110,7 @@ declare class Niivue {
|
|
|
2176
2110
|
* @param filename - of NIfTI format drawing
|
|
2177
2111
|
* @param isBinarize - if true will force drawing voxels to be either 0 or 1.
|
|
2178
2112
|
* @example niivue.loadDrawingFromUrl("../images/lesion.nii.gz");
|
|
2179
|
-
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html|live demo usage}
|
|
2113
|
+
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html | live demo usage}
|
|
2180
2114
|
*/
|
|
2181
2115
|
loadDrawingFromUrl(fnm: string, isBinarize?: boolean): Promise<boolean>;
|
|
2182
2116
|
findOtsu(mlevel?: number): number[];
|
|
@@ -2184,7 +2118,7 @@ declare class Niivue {
|
|
|
2184
2118
|
* remove dark voxels in air
|
|
2185
2119
|
* @param levels - (2-4) segment brain into this many types. For example drawOtsu(2) will create a binary drawing where bright voxels are colored and dark voxels are clear.
|
|
2186
2120
|
* @example niivue.drawOtsu(3);
|
|
2187
|
-
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html|live demo usage}
|
|
2121
|
+
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html | live demo usage}
|
|
2188
2122
|
*/
|
|
2189
2123
|
drawOtsu(levels?: number): void;
|
|
2190
2124
|
/**
|
|
@@ -2192,7 +2126,7 @@ declare class Niivue {
|
|
|
2192
2126
|
* @param level - (1-5) larger values for more preserved voxels
|
|
2193
2127
|
* @param volIndex - volume to dehaze
|
|
2194
2128
|
* @example niivue.removeHaze(3, 0);
|
|
2195
|
-
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html|live demo usage}
|
|
2129
|
+
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html | live demo usage}
|
|
2196
2130
|
*/
|
|
2197
2131
|
removeHaze(level?: number, volIndex?: number): void;
|
|
2198
2132
|
/**
|
|
@@ -2201,8 +2135,8 @@ declare class Niivue {
|
|
|
2201
2135
|
* @param isSaveDrawing - determines whether drawing or background image is saved
|
|
2202
2136
|
* @param volumeByIndex - determines layer to save (0 for background)
|
|
2203
2137
|
* @param volumeByIndex - determines layer to save (0 for background)
|
|
2204
|
-
* @example niivue.saveImage(
|
|
2205
|
-
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html|live demo usage}
|
|
2138
|
+
* @example niivue.saveImage({ filename: "myimage.nii.gz", isSaveDrawing: true });
|
|
2139
|
+
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html | live demo usage}
|
|
2206
2140
|
*/
|
|
2207
2141
|
saveImage(options?: SaveImageOptions): Uint8Array | boolean;
|
|
2208
2142
|
getMeshIndexByID(id: string | number): number;
|
|
@@ -2212,7 +2146,7 @@ declare class Niivue {
|
|
|
2212
2146
|
* @param key - attribute to change
|
|
2213
2147
|
* @param value - for attribute
|
|
2214
2148
|
* @example niivue.setMeshProperty(niivue.meshes[0].id, 'fiberLength', 42)
|
|
2215
|
-
* @see {@link https://niivue.github.io/niivue/features/meshes.html|live demo usage}
|
|
2149
|
+
* @see {@link https://niivue.github.io/niivue/features/meshes.html | live demo usage}
|
|
2216
2150
|
*/
|
|
2217
2151
|
setMeshProperty(id: number, key: keyof NVMesh, val: number): void;
|
|
2218
2152
|
/**
|
|
@@ -2230,7 +2164,7 @@ declare class Niivue {
|
|
|
2230
2164
|
* reverse triangle winding of mesh (swap front and back faces)
|
|
2231
2165
|
* @param id - identity of mesh to change
|
|
2232
2166
|
* @example niivue.reverseFaces(niivue.meshes[0].id)
|
|
2233
|
-
* @see {@link https://niivue.github.io/niivue/features/meshes.html|live demo usage}
|
|
2167
|
+
* @see {@link https://niivue.github.io/niivue/features/meshes.html | live demo usage}
|
|
2234
2168
|
*/
|
|
2235
2169
|
reverseFaces(mesh: number): void;
|
|
2236
2170
|
/**
|
|
@@ -2240,7 +2174,7 @@ declare class Niivue {
|
|
|
2240
2174
|
* @param key - attribute to change
|
|
2241
2175
|
* @param value - for attribute
|
|
2242
2176
|
* @example niivue.setMeshLayerProperty(niivue.meshes[0].id, 0, 'frame4D', 22)
|
|
2243
|
-
* @see {@link https://niivue.github.io/niivue/features/mesh.4D.html|live demo usage}
|
|
2177
|
+
* @see {@link https://niivue.github.io/niivue/features/mesh.4D.html | live demo usage}
|
|
2244
2178
|
*/
|
|
2245
2179
|
setMeshLayerProperty(mesh: number, layer: number, key: keyof NVMeshLayer, val: number): void;
|
|
2246
2180
|
/**
|
|
@@ -2252,7 +2186,7 @@ declare class Niivue {
|
|
|
2252
2186
|
/**
|
|
2253
2187
|
* set rotation of 3D render view
|
|
2254
2188
|
* @example niivue.setRenderAzimuthElevation(45, 15)
|
|
2255
|
-
* @see {@link https://niivue.github.io/niivue/features/mask.html|live demo usage}
|
|
2189
|
+
* @see {@link https://niivue.github.io/niivue/features/mask.html | live demo usage}
|
|
2256
2190
|
*/
|
|
2257
2191
|
setRenderAzimuthElevation(a: number, e: number): void;
|
|
2258
2192
|
/**
|
|
@@ -2280,7 +2214,7 @@ declare class Niivue {
|
|
|
2280
2214
|
* @example
|
|
2281
2215
|
* niivue = new Niivue()
|
|
2282
2216
|
* niivue.removeVolume(this.volumes[3])
|
|
2283
|
-
* @see {@link https://niivue.github.io/niivue/features/document.3d.html|live demo usage}
|
|
2217
|
+
* @see {@link https://niivue.github.io/niivue/features/document.3d.html | live demo usage}
|
|
2284
2218
|
*/
|
|
2285
2219
|
removeVolume(volume: NVImage): void;
|
|
2286
2220
|
/**
|
|
@@ -2294,7 +2228,7 @@ declare class Niivue {
|
|
|
2294
2228
|
* @example
|
|
2295
2229
|
* niivue = new Niivue()
|
|
2296
2230
|
* niivue.removeMesh(this.meshes[3])
|
|
2297
|
-
* @see {@link https://niivue.github.io/niivue/features/multiuser.meshes.html|live demo usage}
|
|
2231
|
+
* @see {@link https://niivue.github.io/niivue/features/multiuser.meshes.html | live demo usage}
|
|
2298
2232
|
*/
|
|
2299
2233
|
removeMesh(mesh: NVMesh): void;
|
|
2300
2234
|
/**
|
|
@@ -2354,7 +2288,7 @@ declare class Niivue {
|
|
|
2354
2288
|
* @example
|
|
2355
2289
|
* niivue = new Niivue()
|
|
2356
2290
|
* niivue.setClipPlane([42, 42])
|
|
2357
|
-
* @see {@link https://niivue.github.io/niivue/features/mask.html|live demo usage}
|
|
2291
|
+
* @see {@link https://niivue.github.io/niivue/features/mask.html | live demo usage}
|
|
2358
2292
|
*/
|
|
2359
2293
|
setClipPlane(depthAzimuthElevation: number[]): void;
|
|
2360
2294
|
/**
|
|
@@ -2363,13 +2297,13 @@ declare class Niivue {
|
|
|
2363
2297
|
* @example
|
|
2364
2298
|
* niivue = new Niivue()
|
|
2365
2299
|
* niivue.setCrosshairColor([0, 1, 0, 0.5]) // set crosshair to transparent green
|
|
2366
|
-
* @see {@link https://niivue.github.io/niivue/features/colormaps.html|live demo usage}
|
|
2300
|
+
* @see {@link https://niivue.github.io/niivue/features/colormaps.html | live demo usage}
|
|
2367
2301
|
*/
|
|
2368
2302
|
setCrosshairColor(color: number[]): void;
|
|
2369
2303
|
/**
|
|
2370
2304
|
* set thickness of crosshair
|
|
2371
2305
|
* @example niivue.crosshairWidth(2)
|
|
2372
|
-
* @see {@link https://niivue.github.io/niivue/features/colormaps.html|live demo usage}
|
|
2306
|
+
* @see {@link https://niivue.github.io/niivue/features/colormaps.html | live demo usage}
|
|
2373
2307
|
*/
|
|
2374
2308
|
setCrosshairWidth(crosshairWidth: number): void;
|
|
2375
2309
|
setDrawColormap(name: string): void;
|
|
@@ -2377,7 +2311,7 @@ declare class Niivue {
|
|
|
2377
2311
|
* does dragging over a 2D slice create a drawing?
|
|
2378
2312
|
* @param trueOrFalse - enabled (true) or not (false)
|
|
2379
2313
|
* @example niivue.setDrawingEnabled(true)
|
|
2380
|
-
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html|live demo usage}
|
|
2314
|
+
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html | live demo usage}
|
|
2381
2315
|
*/
|
|
2382
2316
|
setDrawingEnabled(trueOrFalse: boolean): void;
|
|
2383
2317
|
/**
|
|
@@ -2385,14 +2319,14 @@ declare class Niivue {
|
|
|
2385
2319
|
* @param penValue - sets the color of the pen
|
|
2386
2320
|
* @param isFilledPen - determines if dragging creates flood-filled shape
|
|
2387
2321
|
* @example niivue.setPenValue(1, true)
|
|
2388
|
-
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html|live demo usage}
|
|
2322
|
+
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html | live demo usage}
|
|
2389
2323
|
*/
|
|
2390
2324
|
setPenValue(penValue: number, isFilledPen?: boolean): void;
|
|
2391
2325
|
/**
|
|
2392
2326
|
* control whether drawing is transparent (0), opaque (1) or translucent (between 0 and 1).
|
|
2393
2327
|
* @param opacity - translucency of drawing
|
|
2394
2328
|
* @example niivue.setDrawOpacity(0.7)
|
|
2395
|
-
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html|live demo usage}
|
|
2329
|
+
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html | live demo usage}
|
|
2396
2330
|
*/
|
|
2397
2331
|
setDrawOpacity(opacity: number): void;
|
|
2398
2332
|
/**
|
|
@@ -2401,7 +2335,7 @@ declare class Niivue {
|
|
|
2401
2335
|
* @example
|
|
2402
2336
|
* niivue = new Niivue()
|
|
2403
2337
|
* niivue.setSelectionBoxColor([0, 1, 0, 0.5]) // set to transparent green
|
|
2404
|
-
* @see {@link https://niivue.github.io/niivue/features/colormaps.html|live demo usage}
|
|
2338
|
+
* @see {@link https://niivue.github.io/niivue/features/colormaps.html | live demo usage}
|
|
2405
2339
|
*/
|
|
2406
2340
|
setSelectionBoxColor(color: number[]): void;
|
|
2407
2341
|
sliceScroll2D(posChange: number, x: number, y: number, isDelta?: boolean): void;
|
|
@@ -2411,7 +2345,7 @@ declare class Niivue {
|
|
|
2411
2345
|
* @example
|
|
2412
2346
|
* niivue = new Niivue()
|
|
2413
2347
|
* niivue.setSliceType(Niivue.sliceTypeMultiplanar)
|
|
2414
|
-
* @see {@link https://niivue.github.io/niivue/features/basic.multiplanar.html|live demo usage}
|
|
2348
|
+
* @see {@link https://niivue.github.io/niivue/features/basic.multiplanar.html | live demo usage}
|
|
2415
2349
|
*/
|
|
2416
2350
|
setSliceType(st: SLICE_TYPE): this;
|
|
2417
2351
|
/**
|
|
@@ -2421,7 +2355,7 @@ declare class Niivue {
|
|
|
2421
2355
|
* @example
|
|
2422
2356
|
* niivue = new Niivue()
|
|
2423
2357
|
* niivue.setOpacity(0, 0.5) // make the first volume transparent
|
|
2424
|
-
* @see {@link https://niivue.github.io/niivue/features/atlas.html|live demo usage}
|
|
2358
|
+
* @see {@link https://niivue.github.io/niivue/features/atlas.html | live demo usage}
|
|
2425
2359
|
*/
|
|
2426
2360
|
setOpacity(volIdx: number, newOpacity: number): void;
|
|
2427
2361
|
/**
|
|
@@ -2429,7 +2363,7 @@ declare class Niivue {
|
|
|
2429
2363
|
* @param scale - the new scale value
|
|
2430
2364
|
* @example
|
|
2431
2365
|
* niivue.setScale(2) // zoom some
|
|
2432
|
-
* @see {@link https://niivue.github.io/niivue/features/shiny.volumes.html|live demo usage}
|
|
2366
|
+
* @see {@link https://niivue.github.io/niivue/features/shiny.volumes.html | live demo usage}
|
|
2433
2367
|
*/
|
|
2434
2368
|
setScale(scale: number): void;
|
|
2435
2369
|
/**
|
|
@@ -2437,7 +2371,7 @@ declare class Niivue {
|
|
|
2437
2371
|
* @param color - the new color. expects an array of RGBA values. values can range from 0 to 1
|
|
2438
2372
|
* @example
|
|
2439
2373
|
* niivue.setClipPlaneColor([1, 1, 1, 0.5]) // white, transparent
|
|
2440
|
-
* @see {@link https://niivue.github.io/niivue/features/clipplanes.html|live demo usage}
|
|
2374
|
+
* @see {@link https://niivue.github.io/niivue/features/clipplanes.html | live demo usage}
|
|
2441
2375
|
*/
|
|
2442
2376
|
setClipPlaneColor(color: number[]): void;
|
|
2443
2377
|
/**
|
|
@@ -2445,7 +2379,7 @@ declare class Niivue {
|
|
|
2445
2379
|
* @param gradientAmount - amount of matcap (0..1), default 0 (matte, surface normal does not influence color)
|
|
2446
2380
|
* @example
|
|
2447
2381
|
* niivue.setVolumeRenderIllumination(0.6);
|
|
2448
|
-
* @see {@link https://niivue.github.io/niivue/features/shiny.volumes.html|live demo usage}
|
|
2382
|
+
* @see {@link https://niivue.github.io/niivue/features/shiny.volumes.html | live demo usage}
|
|
2449
2383
|
*/
|
|
2450
2384
|
setVolumeRenderIllumination(gradientAmount?: number): Promise<void>;
|
|
2451
2385
|
overlayRGBA(volume: NVImage): Uint8ClampedArray;
|
|
@@ -2467,7 +2401,7 @@ declare class Niivue {
|
|
|
2467
2401
|
/**
|
|
2468
2402
|
* Loads an NVDocument
|
|
2469
2403
|
* @returns Niivue instance
|
|
2470
|
-
* @see {@link https://niivue.github.io/niivue/features/document.load.html|live demo usage}
|
|
2404
|
+
* @see {@link https://niivue.github.io/niivue/features/document.load.html | live demo usage}
|
|
2471
2405
|
*/
|
|
2472
2406
|
loadDocument(document: NVDocument): this;
|
|
2473
2407
|
/**
|
|
@@ -2476,8 +2410,8 @@ declare class Niivue {
|
|
|
2476
2410
|
* @param esm - bundled version of NiiVue
|
|
2477
2411
|
* @example
|
|
2478
2412
|
* const javascript = this.generateLoadDocumentJavaScript("gl1");
|
|
2479
|
-
* const html =
|
|
2480
|
-
|
|
2413
|
+
* const html = `<html><body><canvas id="gl1"></canvas><script type="module" async>
|
|
2414
|
+
${javascript}</script></body></html>`;
|
|
2481
2415
|
*/
|
|
2482
2416
|
generateLoadDocumentJavaScript(canvasId: string, esm: string): string;
|
|
2483
2417
|
/**
|
|
@@ -2486,8 +2420,8 @@ declare class Niivue {
|
|
|
2486
2420
|
* @param esm - bundled version of NiiVue
|
|
2487
2421
|
* @returns HTML with javascript of the current scene
|
|
2488
2422
|
* @example
|
|
2489
|
-
* const template =
|
|
2490
|
-
* %%javascript%%</script></body></html
|
|
2423
|
+
* const template = `<html><body><canvas id="gl1"></canvas><script type="module" async>
|
|
2424
|
+
* %%javascript%%</script></body></html>`;
|
|
2491
2425
|
* nv1.generateHTML("page.html", esm);
|
|
2492
2426
|
*/
|
|
2493
2427
|
generateHTML(canvasId: string | undefined, esm: string): string;
|
|
@@ -2507,7 +2441,7 @@ declare class Niivue {
|
|
|
2507
2441
|
* @param fileName - the name of the document storing the scene
|
|
2508
2442
|
* @example
|
|
2509
2443
|
* niivue.saveDocument("niivue.basic.nvd")
|
|
2510
|
-
* @see {@link https://niivue.github.io/niivue/features/document.3d.html|live demo usage}
|
|
2444
|
+
* @see {@link https://niivue.github.io/niivue/features/document.3d.html | live demo usage}
|
|
2511
2445
|
*/
|
|
2512
2446
|
saveDocument(fileName?: string): Promise<void>;
|
|
2513
2447
|
/**
|
|
@@ -2516,13 +2450,13 @@ declare class Niivue {
|
|
|
2516
2450
|
* @returns returns the Niivue instance
|
|
2517
2451
|
* @example
|
|
2518
2452
|
* niivue = new Niivue()
|
|
2519
|
-
* niivue.loadVolumes([
|
|
2520
|
-
* @see {@link https://niivue.github.io/niivue/features/mask.html|live demo usage}
|
|
2453
|
+
* niivue.loadVolumes([{url: 'someImage.nii.gz}, {url: 'anotherImage.nii.gz'}])
|
|
2454
|
+
* @see {@link https://niivue.github.io/niivue/features/mask.html | live demo usage}
|
|
2521
2455
|
*/
|
|
2522
2456
|
loadVolumes(volumeList: ImageFromUrlOptions[]): Promise<this>;
|
|
2523
2457
|
/**
|
|
2524
2458
|
* Add mesh and notify subscribers
|
|
2525
|
-
* @see {@link https://niivue.github.io/niivue/features/multiuser.meshes.html|live demo usage}
|
|
2459
|
+
* @see {@link https://niivue.github.io/niivue/features/multiuser.meshes.html | live demo usage}
|
|
2526
2460
|
*/
|
|
2527
2461
|
addMeshFromUrl(meshOptions: LoadFromUrlParams): Promise<NVMesh>;
|
|
2528
2462
|
/**
|
|
@@ -2531,27 +2465,27 @@ declare class Niivue {
|
|
|
2531
2465
|
* @returns Niivue instance
|
|
2532
2466
|
* @example
|
|
2533
2467
|
* niivue = new Niivue()
|
|
2534
|
-
* niivue.loadMeshes([
|
|
2535
|
-
* @see {@link https://niivue.github.io/niivue/features/meshes.html|live demo usage}
|
|
2468
|
+
* niivue.loadMeshes([{url: 'someMesh.gii'}])
|
|
2469
|
+
* @see {@link https://niivue.github.io/niivue/features/meshes.html | live demo usage}
|
|
2536
2470
|
*/
|
|
2537
2471
|
loadMeshes(meshList: LoadFromUrlParams[]): Promise<this>;
|
|
2538
2472
|
/**
|
|
2539
2473
|
* load a connectome specified by url
|
|
2540
2474
|
* @returns Niivue instance
|
|
2541
|
-
* @see {@link https://niivue.github.io/niivue/features/connectome.html|live demo usage}
|
|
2475
|
+
* @see {@link https://niivue.github.io/niivue/features/connectome.html | live demo usage}
|
|
2542
2476
|
*/
|
|
2543
2477
|
loadConnectomeFromUrl(url: string, headers?: {}): Promise<this>;
|
|
2544
2478
|
/**
|
|
2545
2479
|
* load a connectome specified by url
|
|
2546
2480
|
* @returns Niivue instance
|
|
2547
|
-
* @see {@link https://niivue.github.io/niivue/features/connectome.html|live demo usage}
|
|
2481
|
+
* @see {@link https://niivue.github.io/niivue/features/connectome.html | live demo usage}
|
|
2548
2482
|
*/
|
|
2549
2483
|
loadFreeSurferConnectomeFromUrl(url: string, headers?: {}): Promise<this>;
|
|
2550
2484
|
/**
|
|
2551
2485
|
* load a connectome specified by json
|
|
2552
2486
|
* @param connectome - freesurfer model
|
|
2553
2487
|
* @returns Niivue instance
|
|
2554
|
-
* @see {@link https://niivue.github.io/niivue/features/connectome.html|live demo usage}
|
|
2488
|
+
* @see {@link https://niivue.github.io/niivue/features/connectome.html | live demo usage}
|
|
2555
2489
|
*/
|
|
2556
2490
|
loadFreeSurferConnectome(json: FreeSurferConnectome): Promise<this>;
|
|
2557
2491
|
handleNodeAdded(event: {
|
|
@@ -2564,13 +2498,13 @@ declare class Niivue {
|
|
|
2564
2498
|
* load a connectome specified by json
|
|
2565
2499
|
* @param connectome - model
|
|
2566
2500
|
* @returns Niivue instance
|
|
2567
|
-
* @see {@link https://niivue.github.io/niivue/features/connectome.html|live demo usage}
|
|
2501
|
+
* @see {@link https://niivue.github.io/niivue/features/connectome.html | live demo usage}
|
|
2568
2502
|
*/
|
|
2569
2503
|
loadConnectome(json: Connectome | LegacyConnectome): this;
|
|
2570
2504
|
/**
|
|
2571
2505
|
* generate a blank canvas for the pen tool
|
|
2572
2506
|
* @example niivue.createEmptyDrawing()
|
|
2573
|
-
* @see {@link https://niivue.github.io/niivue/features/cactus.html|live demo usage}
|
|
2507
|
+
* @see {@link https://niivue.github.io/niivue/features/cactus.html | live demo usage}
|
|
2574
2508
|
*/
|
|
2575
2509
|
createEmptyDrawing(): void;
|
|
2576
2510
|
r16Tex(texID: WebGLTexture | null, activeID: number, dims: number[], img16: Int16Array): WebGLTexture;
|
|
@@ -2578,7 +2512,7 @@ declare class Niivue {
|
|
|
2578
2512
|
* dilate drawing so all voxels are colored.
|
|
2579
2513
|
* works on drawing with multiple colors
|
|
2580
2514
|
* @example niivue.drawGrowCut();
|
|
2581
|
-
* @see {@link https://niivue.github.io/niivue/features/draw2.html|live demo usage}
|
|
2515
|
+
* @see {@link https://niivue.github.io/niivue/features/draw2.html | live demo usage}
|
|
2582
2516
|
*/
|
|
2583
2517
|
drawGrowCut(): void;
|
|
2584
2518
|
drawPt(x: number, y: number, z: number, penValue: number): void;
|
|
@@ -2590,14 +2524,14 @@ declare class Niivue {
|
|
|
2590
2524
|
/**
|
|
2591
2525
|
* close drawing: make sure you have saved any changes before calling this!
|
|
2592
2526
|
* @example niivue.closeDrawing();
|
|
2593
|
-
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html|live demo usage}
|
|
2527
|
+
* @see {@link https://niivue.github.io/niivue/features/draw.ui.html | live demo usage}
|
|
2594
2528
|
*/
|
|
2595
2529
|
closeDrawing(): void;
|
|
2596
2530
|
/**
|
|
2597
2531
|
* copy drawing bitmap from CPU to GPU storage and redraw the screen
|
|
2598
2532
|
* @param isForceRedraw - refreshes scene immediately (default true)
|
|
2599
2533
|
* @example niivue.refreshDrawing();
|
|
2600
|
-
* @see {@link https://niivue.github.io/niivue/features/cactus.html|live demo usage}
|
|
2534
|
+
* @see {@link https://niivue.github.io/niivue/features/cactus.html | live demo usage}
|
|
2601
2535
|
*/
|
|
2602
2536
|
refreshDrawing(isForceRedraw?: boolean): void;
|
|
2603
2537
|
r8Tex(texID: WebGLTexture | null, activeID: number, dims: number[], isInit?: boolean): WebGLTexture | null;
|
|
@@ -2611,7 +2545,7 @@ declare class Niivue {
|
|
|
2611
2545
|
* @param name - name of matcap to load ("Shiny", "Cortex", "Cream")
|
|
2612
2546
|
* @example
|
|
2613
2547
|
* niivue.loadMatCapTexture("Cortex");
|
|
2614
|
-
* @see {@link https://niivue.github.io/niivue/features/shiny.volumes.html|live demo usage}
|
|
2548
|
+
* @see {@link https://niivue.github.io/niivue/features/shiny.volumes.html | live demo usage}
|
|
2615
2549
|
*/
|
|
2616
2550
|
loadMatCapTexture(bmpUrl: string): Promise<WebGLTexture | null>;
|
|
2617
2551
|
initFontMets(): void;
|
|
@@ -2620,7 +2554,7 @@ declare class Niivue {
|
|
|
2620
2554
|
* @param name - name of matcap to load ("Roboto", "Garamond", "Ubuntu")
|
|
2621
2555
|
* @example
|
|
2622
2556
|
* niivue.loadMatCapTexture("Cortex");
|
|
2623
|
-
* @see {@link https://niivue.github.io/niivue/features/selectfont.html|live demo usage}
|
|
2557
|
+
* @see {@link https://niivue.github.io/niivue/features/selectfont.html | live demo usage}
|
|
2624
2558
|
*/
|
|
2625
2559
|
loadFont(fontSheetUrl?: any, metricsUrl?: {
|
|
2626
2560
|
atlas: {
|
|
@@ -2671,7 +2605,7 @@ declare class Niivue {
|
|
|
2671
2605
|
* @param id - id of mesh to change
|
|
2672
2606
|
* @param meshShaderNameOrNumber - identify shader for usage
|
|
2673
2607
|
* @example niivue.setMeshShader('toon');
|
|
2674
|
-
* @see {@link https://niivue.github.io/niivue/features/meshes.html|live demo usage}
|
|
2608
|
+
* @see {@link https://niivue.github.io/niivue/features/meshes.html | live demo usage}
|
|
2675
2609
|
*/
|
|
2676
2610
|
setMeshShader(id: number, meshShaderNameOrNumber?: number): void;
|
|
2677
2611
|
/**
|
|
@@ -2690,7 +2624,7 @@ declare class Niivue {
|
|
|
2690
2624
|
* @param fragmentShaderText - custom fragment shader.
|
|
2691
2625
|
* @param ame - title for new shader.
|
|
2692
2626
|
* @returns index of the new shader (for setMeshShader)
|
|
2693
|
-
* @see {@link https://niivue.github.io/niivue/features/mesh.atlas.html|live demo usage}
|
|
2627
|
+
* @see {@link https://niivue.github.io/niivue/features/mesh.atlas.html | live demo usage}
|
|
2694
2628
|
*/
|
|
2695
2629
|
setCustomMeshShader(fragmentShaderText?: string, name?: string): number;
|
|
2696
2630
|
/**
|
|
@@ -2698,7 +2632,7 @@ declare class Niivue {
|
|
|
2698
2632
|
* @param sort - sort output alphabetically
|
|
2699
2633
|
* @returns list of available mesh shader names
|
|
2700
2634
|
* @example niivue.meshShaderNames();
|
|
2701
|
-
* @see {@link https://niivue.github.io/niivue/features/meshes.html|live demo usage}
|
|
2635
|
+
* @see {@link https://niivue.github.io/niivue/features/meshes.html | live demo usage}
|
|
2702
2636
|
*/
|
|
2703
2637
|
meshShaderNames(sort?: boolean): string[];
|
|
2704
2638
|
initRenderShader(shader: Shader, gradientAmount?: number): void;
|
|
@@ -2709,7 +2643,7 @@ declare class Niivue {
|
|
|
2709
2643
|
* @example
|
|
2710
2644
|
* niivue = new Niivue()
|
|
2711
2645
|
* niivue.updateGLVolume()
|
|
2712
|
-
* @see {@link https://niivue.github.io/niivue/features/colormaps.html|live demo usage}
|
|
2646
|
+
* @see {@link https://niivue.github.io/niivue/features/colormaps.html | live demo usage}
|
|
2713
2647
|
*/
|
|
2714
2648
|
updateGLVolume(): void;
|
|
2715
2649
|
/**
|
|
@@ -2718,7 +2652,7 @@ declare class Niivue {
|
|
|
2718
2652
|
* @param masks - are optional binary images to filter voxles
|
|
2719
2653
|
* @returns numeric values to describe image
|
|
2720
2654
|
* @example niivue.getDescriptives(0);
|
|
2721
|
-
* @see {@link https://niivue.github.io/niivue/features/draw2.html|live demo usage}
|
|
2655
|
+
* @see {@link https://niivue.github.io/niivue/features/draw2.html | live demo usage}
|
|
2722
2656
|
*/
|
|
2723
2657
|
getDescriptives(layer?: number, masks?: never[], drawingIsMask?: boolean): Descriptive;
|
|
2724
2658
|
refreshLayers(overlayItem: NVImage, layer: number): void;
|
|
@@ -2729,14 +2663,14 @@ declare class Niivue {
|
|
|
2729
2663
|
* @example
|
|
2730
2664
|
* niivue = new Niivue()
|
|
2731
2665
|
* colormaps = niivue.colormaps()
|
|
2732
|
-
* @see {@link https://niivue.github.io/niivue/features/colormaps.html|live demo usage}
|
|
2666
|
+
* @see {@link https://niivue.github.io/niivue/features/colormaps.html | live demo usage}
|
|
2733
2667
|
*/
|
|
2734
2668
|
colormaps(): string[];
|
|
2735
2669
|
/**
|
|
2736
2670
|
* create a new colormap
|
|
2737
2671
|
* @param key - name of new colormap
|
|
2738
2672
|
* @param colormap - properties (Red, Green, Blue, Alpha and Indices)
|
|
2739
|
-
* @see {@link https://niivue.github.io/niivue/features/colormaps.html|live demo usage}
|
|
2673
|
+
* @see {@link https://niivue.github.io/niivue/features/colormaps.html | live demo usage}
|
|
2740
2674
|
*/
|
|
2741
2675
|
addColormap(key: string, cmap: ColorMap): void;
|
|
2742
2676
|
/**
|
|
@@ -2745,13 +2679,37 @@ declare class Niivue {
|
|
|
2745
2679
|
* @param colormap - the name of the colormap to use
|
|
2746
2680
|
* @example
|
|
2747
2681
|
* niivue.setColormap(niivue.volumes[0].id,, 'red')
|
|
2748
|
-
* @see {@link https://niivue.github.io/niivue/features/colormaps.html|live demo usage}
|
|
2682
|
+
* @see {@link https://niivue.github.io/niivue/features/colormaps.html | live demo usage}
|
|
2749
2683
|
*/
|
|
2750
2684
|
setColormap(id: string, colormap: string): void;
|
|
2685
|
+
idx(A: number, B: number, C: number, DIM: Uint32Array): number;
|
|
2686
|
+
check_previous_slice(bw: Uint32Array, il: Uint32Array, r: number, c: number, sl: number, dim: Uint32Array, conn: number, tt: Uint32Array): number;
|
|
2687
|
+
do_initial_labelling(bw: Uint32Array, dim: Uint32Array, conn: number): [number, Uint32Array, Uint32Array];
|
|
2688
|
+
fill_tratab(tt: Uint32Array, nabo: Uint32Array, nr_set: number): void;
|
|
2689
|
+
translate_labels(il: Uint32Array, dim: Uint32Array, tt: Uint32Array, ttn: number): [number, Uint32Array];
|
|
2690
|
+
largest_original_cluster_labels(bw: Uint32Array, cl: number, ls: Uint32Array): [number, Uint32Array];
|
|
2691
|
+
bwlabel(img: Uint32Array, dim: Uint32Array, conn?: number, binarize?: boolean, onlyLargestClusterPerClass?: boolean): [number, Uint32Array];
|
|
2692
|
+
createConnectedLabelImage(id: string, conn?: number, binarize?: boolean, onlyLargestClusterPerClass?: boolean): Promise<NVImage>;
|
|
2693
|
+
scalecropUint8(img32: Float32Array, dst_min: number | undefined, dst_max: number | undefined, src_min: number, scale: number): Promise<Uint8Array>;
|
|
2694
|
+
scalecropFloat32(img32: Float32Array, dst_min: number | undefined, dst_max: number | undefined, src_min: number, scale: number): Promise<Float32Array>;
|
|
2695
|
+
getScale(volume: NVImage, dst_min?: number, dst_max?: number, f_low?: number, f_high?: number): [number, number];
|
|
2696
|
+
conformVox2Vox(inDims: number[], inAffine: number[], outDim?: number, outMM?: number, toRAS?: boolean): [mat4, mat4, mat4];
|
|
2697
|
+
createNiftiArray(dims?: number[], pixDims?: number[], affine?: number[], datatypeCode?: NiiDataType, img?: Uint8Array): Promise<Uint8Array>;
|
|
2698
|
+
niftiArray2NVImage(bytes?: Uint8Array): Promise<NVImage>;
|
|
2699
|
+
loadFromUrl(fnm: string): Promise<NVImage>;
|
|
2700
|
+
/**
|
|
2701
|
+
* FreeSurfer-style conform reslices any image to a 256x256x256 volume with 1mm voxels
|
|
2702
|
+
* @param volume - input volume to be re-oriented, intensity-scaled and resliced
|
|
2703
|
+
* @param toRAS - reslice to row, column slices to right-anterior-superior not left-inferior-anterior (default false).
|
|
2704
|
+
* @param isLinear - reslice with linear rather than nearest-neighbor interpolation (default true).
|
|
2705
|
+
* @param asFloat32 - use Float32 datatype rather than Uint8 (default false).
|
|
2706
|
+
* @see {@link https://niivue.github.io/niivue/features/torso.html | live demo usage}
|
|
2707
|
+
*/
|
|
2708
|
+
conform(volume: NVImage, toRAS?: boolean, isLinear?: boolean, asFloat32?: boolean): Promise<NVImage>;
|
|
2751
2709
|
/**
|
|
2752
2710
|
* darken crevices and brighten corners when 3D rendering drawings.
|
|
2753
2711
|
* @param amount - amount of ambient occlusion (default 0.4)
|
|
2754
|
-
* @see {@link https://niivue.github.io/niivue/features/torso.html|live demo usage}
|
|
2712
|
+
* @see {@link https://niivue.github.io/niivue/features/torso.html | live demo usage}
|
|
2755
2713
|
*/
|
|
2756
2714
|
setRenderDrawAmbientOcclusion(ao: number): void;
|
|
2757
2715
|
setColorMap(id: string, colormap: string): void;
|
|
@@ -2762,7 +2720,7 @@ declare class Niivue {
|
|
|
2762
2720
|
* @example
|
|
2763
2721
|
* niivue = new Niivue()
|
|
2764
2722
|
* niivue.setColormapNegative(niivue.volumes[1].id,"winter");
|
|
2765
|
-
* @see {@link https://niivue.github.io/niivue/features/mosaics2.html|live demo usage}
|
|
2723
|
+
* @see {@link https://niivue.github.io/niivue/features/mosaics2.html | live demo usage}
|
|
2766
2724
|
*/
|
|
2767
2725
|
setColormapNegative(id: string, colormapNegative: string): void;
|
|
2768
2726
|
/**
|
|
@@ -2771,15 +2729,15 @@ declare class Niivue {
|
|
|
2771
2729
|
* @param idModulation - the ID of the NVImage that controls bias (empty string to disable modulation)
|
|
2772
2730
|
* @param modulateAlpha - does the modulation influence alpha transparency (values greater than 1).
|
|
2773
2731
|
* @example niivue.setModulationImage(niivue.volumes[0].id, niivue.volumes[1].id);
|
|
2774
|
-
* @see {@link https://niivue.github.io/niivue/features/modulate.html|live demo scalar usage}
|
|
2775
|
-
* @see {@link https://niivue.github.io/niivue/features/modulateAfni.html|live demo usage}
|
|
2732
|
+
* @see {@link https://niivue.github.io/niivue/features/modulate.html | live demo scalar usage}
|
|
2733
|
+
* @see {@link https://niivue.github.io/niivue/features/modulateAfni.html | live demo usage}
|
|
2776
2734
|
*/
|
|
2777
2735
|
setModulationImage(idTarget: string, idModulation: string, modulateAlpha?: number): void;
|
|
2778
2736
|
/**
|
|
2779
2737
|
* adjust screen gamma. Low values emphasize shadows but can appear flat, high gamma hides shadow details.
|
|
2780
2738
|
* @param gamma - selects luminance, default is 1
|
|
2781
2739
|
* @example niivue.setGamma(1.0);
|
|
2782
|
-
* @see {@link https://niivue.github.io/niivue/features/colormaps.html|live demo usage}
|
|
2740
|
+
* @see {@link https://niivue.github.io/niivue/features/colormaps.html | live demo usage}
|
|
2783
2741
|
*/
|
|
2784
2742
|
setGamma(gamma?: number): void;
|
|
2785
2743
|
/** Load all volumes for image opened with `limitFrames4D`, the user can also click the `...` on a 4D timeline to load deferred volumes
|
|
@@ -2791,7 +2749,7 @@ declare class Niivue {
|
|
|
2791
2749
|
* @param id - the ID of the 4D NVImage
|
|
2792
2750
|
* @param frame4D - frame to display (indexed from zero)
|
|
2793
2751
|
* @example nv1.setFrame4D(nv1.volumes[0].id, 42);
|
|
2794
|
-
* @see {@link https://niivue.github.io/niivue/features/timeseries.html|live demo usage}
|
|
2752
|
+
* @see {@link https://niivue.github.io/niivue/features/timeseries.html | live demo usage}
|
|
2795
2753
|
*/
|
|
2796
2754
|
setFrame4D(id: string, frame4D: number): void;
|
|
2797
2755
|
/**
|
|
@@ -2799,7 +2757,7 @@ declare class Niivue {
|
|
|
2799
2757
|
* @param id - the ID of the 4D NVImage
|
|
2800
2758
|
* @returns currently selected volume (indexed from 0)
|
|
2801
2759
|
* @example nv1.getFrame4D(nv1.volumes[0].id);
|
|
2802
|
-
* @see {@link https://niivue.github.io/niivue/features/timeseries.html|live demo usage}
|
|
2760
|
+
* @see {@link https://niivue.github.io/niivue/features/timeseries.html | live demo usage}
|
|
2803
2761
|
*/
|
|
2804
2762
|
getFrame4D(id: string): number;
|
|
2805
2763
|
colormapFromKey(name: string): ColorMap;
|
|
@@ -2822,7 +2780,7 @@ declare class Niivue {
|
|
|
2822
2780
|
dragForSlicer3D(startXYendXY: number[]): void;
|
|
2823
2781
|
drawMeasurementTool(startXYendXY: number[]): void;
|
|
2824
2782
|
drawRect(leftTopWidthHeight: number[], lineColor?: number[]): void;
|
|
2825
|
-
drawCircle(leftTopWidthHeight: number[], circleColor?:
|
|
2783
|
+
drawCircle(leftTopWidthHeight: number[], circleColor?: Float32List, fillPercent?: number): void;
|
|
2826
2784
|
drawSelectionBox(leftTopWidthHeight: number[]): void;
|
|
2827
2785
|
effectiveCanvasHeight(): number;
|
|
2828
2786
|
effectiveCanvasWidth(): number;
|
|
@@ -2837,7 +2795,7 @@ declare class Niivue {
|
|
|
2837
2795
|
textHeight(scale: number, str: string): number;
|
|
2838
2796
|
drawChar(xy: number[], scale: number, char: number): number;
|
|
2839
2797
|
drawLoadingText(text: string): void;
|
|
2840
|
-
drawText(xy: number[], str: string, scale?: number, color?:
|
|
2798
|
+
drawText(xy: number[], str: string, scale?: number, color?: Float32List | null): void;
|
|
2841
2799
|
drawTextRight(xy: number[], str: string, scale?: number, color?: number[] | null): void;
|
|
2842
2800
|
drawTextLeft(xy: number[], str: string, scale?: number, color?: number[] | null): void;
|
|
2843
2801
|
drawTextRightBelow(xy: number[], str: string, scale?: number, color?: number[] | null): void;
|
|
@@ -2849,7 +2807,7 @@ declare class Niivue {
|
|
|
2849
2807
|
* select between nearest and linear interpolation for voxel based images
|
|
2850
2808
|
* @param isNearest - whether nearest neighbor interpolation is used, else linear interpolation
|
|
2851
2809
|
* @example niivue.setInterpolation(true);
|
|
2852
|
-
* @see {@link https://niivue.github.io/niivue/features/draw2.html|live demo usage}
|
|
2810
|
+
* @see {@link https://niivue.github.io/niivue/features/draw2.html | live demo usage}
|
|
2853
2811
|
*/
|
|
2854
2812
|
setInterpolation(isNearest: boolean): void;
|
|
2855
2813
|
calculateMvpMatrix2D(leftTopWidthHeight: number[], mn: vec3, mx: vec3, clipTolerance: number | undefined, clipDepth: number | undefined, azimuth: number | undefined, elevation: number | undefined, isRadiolgical: boolean): MvpMatrix2D;
|
|
@@ -2897,7 +2855,7 @@ declare class Niivue {
|
|
|
2897
2855
|
* @param y - translate posterior (-) or +anterior (+)
|
|
2898
2856
|
* @param z - translate inferior (-) or superior (+)
|
|
2899
2857
|
* @example niivue.moveCrosshairInVox(1, 0, 0)
|
|
2900
|
-
* @see {@link https://niivue.github.io/niivue/features/draw2.html|live demo usage}
|
|
2858
|
+
* @see {@link https://niivue.github.io/niivue/features/draw2.html | live demo usage}
|
|
2901
2859
|
*/
|
|
2902
2860
|
moveCrosshairInVox(x: number, y: number, z: number): void;
|
|
2903
2861
|
frac2mm(frac: vec3, volIdx?: number, isForceSliceMM?: boolean): vec4;
|
|
@@ -2915,7 +2873,7 @@ declare class Niivue {
|
|
|
2915
2873
|
* display a lightbox or montage view
|
|
2916
2874
|
* @param mosaicStr - specifies orientation (A,C,S) and location of slices.
|
|
2917
2875
|
* @example niivue.setSliceMosaicString("A -10 0 20");
|
|
2918
|
-
* @see {@link https://niivue.github.io/niivue/features/mosaics.html|live demo usage}
|
|
2876
|
+
* @see {@link https://niivue.github.io/niivue/features/mosaics.html | live demo usage}
|
|
2919
2877
|
*/
|
|
2920
2878
|
drawMosaic(mosaicStr: string): void;
|
|
2921
2879
|
drawSceneCore(): string | void;
|
|
@@ -2924,4 +2882,4 @@ declare class Niivue {
|
|
|
2924
2882
|
set gl(gl: WebGL2RenderingContext | null);
|
|
2925
2883
|
}
|
|
2926
2884
|
|
|
2927
|
-
export { type Connectome, type ConnectomeOptions, DEFAULT_OPTIONS, DRAG_MODE, type DocumentData, type ExportDocumentData, LabelLineTerminator, LabelTextAlignment, type LegacyConnectome, type LegacyNodes, MULTIPLANAR_TYPE, type NVConnectomeEdge, type NVConnectomeNode, NVController, NVDocument, NVImage, NVImageFromUrlOptions, NVLabel3D, NVLabel3DStyle, NVMesh, NVMeshFromUrlOptions, NVMeshLoaders, NVUtilities, type NiftiHeader, Niivue, type Point, SLICE_TYPE, type Volume, cmapper, ColorTables as colortables };
|
|
2885
|
+
export { type Connectome, type ConnectomeOptions, DEFAULT_OPTIONS, DRAG_MODE, type DocumentData, type DragReleaseParams, type ExportDocumentData, INITIAL_SCENE_DATA, LabelLineTerminator, LabelTextAlignment, type LegacyConnectome, type LegacyNodes, MULTIPLANAR_TYPE, type NVConfigOptions, type NVConnectomeEdge, type NVConnectomeNode, NVController, NVDocument, NVImage, NVImageFromUrlOptions, NVLabel3D, NVLabel3DStyle, NVMesh, NVMeshFromUrlOptions, NVMeshLoaders, NVUtilities, type NiftiHeader, Niivue, type Point, SLICE_TYPE, type Scene, type Volume, cmapper, ColorTables as colortables };
|