sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
4dde6146bc547a33cae04ae484a9e60fa68410f0aa9b0dd17441ed4f896d9743
TypeScript
11,200
410
/** * Mouse controller helper functions for mouse event handling. * This module provides pure functions for mouse interaction logic. * * Related to: Mouse event handling, drag mode determination, position tracking */ import { vec4 } from 'gl-matrix' import { DRAG_MODE, MouseEventConfig } from '../../nvdocument.js...
43c1ad445e705d75e536b190b07e1125b3c8c2422685f41c2101fd7c7505f356
TypeScript
11,268
475
// Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { ChunkType, DimensionType, JobStage, JobState, JobType, MediaType, ProjectStatus, ShapeType, StorageLocation, LabelType, ShareFileType, Source, TaskMode, TaskStatus, CloudStorageCredentialsType, CloudStorageProviderType...
b4c37a412f7af7d8dc4644ce3c58e1510b351eb78fd9f7a831e0658a46624f23
TypeScript
11,344
329
import * as fs from 'fs' import * as path from 'path' import { test, expect } from '@playwright/test' import { DocumentData, Niivue, NVDocument } from '../../dist/index.js' import { httpServerAddress } from './helpers.js' import { TEST_OPTIONS } from './test.types.js' declare global { interface Window { nv...
cde7c480ef9030468e4dc5be6c08be0db6f3f3951a0b5381777558e0fd33ebd2
TypeScript
11,416
381
import { UIKRenderer } from '../uikrenderer' import { UIKFont } from '../assets/uikfont' import { Vec4, Color, Vec2 } from '../types' import { vec2, vec4 } from 'gl-matrix' /** * Button states for visual feedback */ export enum UIKButtonState { NORMAL = 'normal', HOVER = 'hover', ACTIVE = 'active', DISABLED ...
5249bd8a4210f41c0a9e8c0fc802fffa7e0497398dc12613341293c5fbde5f15
TypeScript
11,575
405
/** * Scene rendering helper functions for overall scene composition and rendering orchestration. * This module provides pure functions for scene-level rendering operations. * * Related to: Scene composition, MVP matrices, pivot calculations, viewport management */ import { mat4, vec3 } from 'gl-matrix' import { ...
0ec2fe04e65ff88ce2e3fec566bb19e3febaa0cd12e85346d0e3877150e0133e
TypeScript
11,603
355
/** * @license * Copyright 2026 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
f77b501937d0c72dba7c4ae504e673e5e8d44bc41f25624ee44a1ccd5d0bcfab
TypeScript
11,674
434
/** * Touch controller helper functions for touch event handling. * This module provides pure functions for touch interaction logic. * * Related to: Touch event handling, gesture detection, pinch-to-zoom */ import { vec4 } from 'gl-matrix' import { DRAG_MODE, TouchEventConfig } from '../../nvdocument.js' /** * ...
4cea746b9fe5221781f922ddd683778eb9e0533b3be885abd0d220d8ffa28991
TypeScript
11,884
681
let warnedUTCOffsetError = false; const getCurrentUTCOffset = (timeZone: string) => { try { const date = new Date(); const formatter = new Intl.DateTimeFormat("en-US", { timeZone, timeZoneName: "shortOffset", }); // Extract the GMT offset part from the formatted string const formatted...
18008c8bdf01322229d83f9b85a92b5f488bb79f044e9d8e67935728449950c8
TypeScript
11,894
318
import { NIFTI1 } from 'nifti-reader-js' import { mat3, mat4, vec3 } from 'gl-matrix' import { log } from '@/logger' import { NVUtilities } from '@/nvutilities' import type { NVImage } from '@/nvimage' import { NiiDataType } from '@/nvimage/utils' /** * Reads NRRD/NHDR format image, modifying the provided NVImage hea...
0b34a6722250c8c74dd23802518dbe6509213bbd7b3f205b41b7588cb2fd726b
TypeScript
12,009
356
/** * @license * Copyright 2026 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
f513a1730ed380beb4fbf7e5b2f2ace99c6f8833761aa32407a6e5c69efbf025
TypeScript
12,213
397
// Copyright (C) 2019-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { AnyAction } from 'redux'; import { TasksQuery } from 'reducers'; import { getCore, RQStatus, Storage, StorageLocation, Task, UpdateStatusData, Request, FramesMetaData, } from 'cvat-core-wra...
437ada65cefec18a0ffa86c28dcbfcde7859c97abd492e708843de34b7074809
TypeScript
12,220
316
// Copyright (C) 2020-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { ActionUnion, createAction, ThunkAction } from 'utils/redux'; import { RegisterData } from 'components/register-page/register-form'; import { ensureError } from 'utils/error-handling'; import { ...
37175abcc764e012a126a326cb64e1255d7d8b0a2131dcb987359cbe6a5aa4ce
TypeScript
12,366
377
import { loadFromFileHandler } from './loadFromFile.js' import { loadStandardHandler } from './loadStandard.js' import { openMeshFileDialog } from './openMeshFileDialog.js' import { saveCompressedNVDHandler, saveHTMLHandler } from './saveFile.js' import { runNiimath, startNiimathJob } from './runNiimath.js' import { ap...
7a119e25055907281d6fcfa3beeee36e377f84151375dc4a69a7503e0cf1d494
TypeScript
12,402
323
import { NIFTI1 } from 'nifti-reader-js' import { log } from '@/logger' import type { NVImage } from '@/nvimage' import { NiiDataType } from '@/nvimage/utils' import { NVUtilities } from '@/nvutilities' /** * Reads MRtrix MIF format image, modifying the provided NVImage header * and returning the raw image data buff...
2f29810238873df8a279500e31a1cd110910026297e4073436b5479ea4c18ba3
TypeScript
12,641
354
/** * ImageFactory Module * * Pure utility functions for loading and creating NVImage instances. * This module contains helper functions for: * - Fetching data from URLs and files * - Stream decompression and partial loading * - Format detection and filename parsing * - Data conversion utilities * * These fun...
9691814524a73d81a41b72778ceeca42949a19d5ecf41670709a0f8457a45e69
TypeScript
13,091
406
import { readFileSync } from 'fs' import { expect, test } from 'vitest' import { NVDocument, DocumentData, COLORMAP_TYPE } from '../../src/nvdocument' import NVSerializer from '../../src/nvserializer' // adjust path if needed // Keep the old legacy test fixture JSON handy (old tests commented out below) const nvd = JS...
b71d0ed2b02366948fbd551c4864c6f40f0de2ae62c9dbbecee929a85b248cb8
TypeScript
13,343
427
import { UIKAsset } from "./uikasset.js" /** * Minimum rendered em height, in *device* pixels, for crisp MSDF text. * * The bundled atlases bake `distanceRange: 2`, so once the em drops much * below ~20 device px the font shader's `screenPxRange` hits its 1.0 floor * and glyph curves staircase — there simply aren...
7f9360cf00971f6b6b8203358b081fe5afeea1838c9a03ce25a504f62e0e8903
TypeScript
13,636
450
/** * Slice rendering helper functions for 2D slice visualization. * This module provides pure functions for slice rendering operations. * * Related to: 2D slice rendering (axial, coronal, sagittal), mosaic views, crosshairs */ import { SLICE_TYPE } from '@/nvdocument' // WebGL texture unit constants const TEXTU...
78716fdc646ce46abff2470c7d1943e6ebb3f42be2b2ed7b1ada6bfac8cc500e
TypeScript
13,812
331
import { vec4 } from 'gl-matrix' import { log } from '@/logger' import { NiiDataType } from '@/nvimage/utils' import type { NVImage, TypedVoxelArray } from '@/nvimage' /** * Returns all voxel channel values at the specified coordinates. * For scalar images, this will return a single-value array [value]. * For multi...
5fd93d4aeceaad3c51917ea46dad1ea8a2cd05fb45d765bc580a96149c06f6c9
TypeScript
13,940
482
/** * Slice navigation helper functions for slice plane navigation and positioning. * This module provides pure functions for slice navigation logic. * * Related to: Slice scrolling, tile indexing, slice position tracking */ import { vec3, vec4 } from 'gl-matrix' import { SLICE_TYPE, DRAG_MODE } from '../../nvdoc...
f4c38ca445236bc738770e732529df72f511fa5183c699a59f22023c7b2d45de
TypeScript
14,079
521
/** * Mesh rendering helper functions for 3D mesh visualization. * This module provides pure functions for 3D mesh rendering operations. * * Related to: 3D mesh rendering, shader selection, fiber rendering, x-ray effects */ import { mat4, vec3 } from 'gl-matrix' import { NVMesh } from '@/nvmesh' import { Shader }...
228d49415fc9a05a78aec5a0a6ab050c7cb98767c993f6139dcedd0516d10000
TypeScript
14,206
317
import { NIFTI1, NIFTI2 } from 'nifti-reader-js' import { log } from '@/logger' import { NVUtilities } from '@/nvutilities' import { hdrToArrayBuffer, NiiDataType } from '@/nvimage/utils' import type { NVImage, TypedVoxelArray } from '@/nvimage' /** * Creates a NIFTI1 header object with basic properties. */ export fu...
57802c5a59d57c6bccb0d8352634b293ed079ee20e2e9189f3fc70d397a17139
TypeScript
14,240
394
import { NIFTI1, NIFTI2 } from 'nifti-reader-js' import { mat4 } from 'gl-matrix' import { log } from '@/logger' import { NVUtilities } from '@/nvutilities' import type { NVImage } from '@/nvimage' import { isPlatformLittleEndian, NiiDataType } from '@/nvimage/utils' /** * @internal * Read all occurrences of a metad...
4f3951106fbc6dc2898eb8a621e51bcd7af1834bb331b63a90cbc646f506f962
TypeScript
14,546
408
// src/utils/legacy-migrate.ts /** * Migration utility for older nvdocument shapes. * * Exports: * - migrateLegacyDocument(documentData) -> normalized DocumentData * - normalizeMeshForRehydrate(mesh) -> normalized mesh object suitable for rehydrateMeshes */ import { deserialize } from '@ungap/structured-clone'...
0636cdfa10d1e0c98a78901e9f18b62064ee37d630d8d84b8ce82db499acb49b
TypeScript
14,805
462
/** * Drawing management pure functions for handling drawing state, undo/redo, * and drawing bitmap operations. * * This module provides pure functions for drawing state management. * WebGL texture operations remain in the Niivue class. * * Related modules: * - @/drawing/undo.ts - Undo operation * - @/drawing/...
6b96cb23f8af9808f60d9b9d0c73e8c6fe1d299583f61ab04a7f0dd6b1e817a1
TypeScript
14,955
452
// Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { AnnotationActionTypes } from 'actions/annotation-actions'; import { AudioActions, AudioActionTypes } from 'actions/audio-actions'; import { BoundariesActionTypes } from 'actions/boundaries-actions'; import { AudioRegionsOrdering } from 'a...
cc12902e75366fc9b85438254205d0e6f91b78d85155ffde8046fd24ca90403b
TypeScript
15,126
505
import { UIKRenderer } from '../uikrenderer' import { UIKFont } from '../assets/uikfont' import { Vec4, Color } from '../types' /** * Configuration interface for UIKSlider component */ export interface UIKSliderConfig { /** Bounding rectangle [x, y, width, height] */ bounds: Vec4 /** Current value (0.0 to 1.0)...
fd23481ed3fa7be8cbb87611e088a84ca3fa0ba983a1ff3d58a4885daf03bd33
TypeScript
15,258
540
import { UIKRenderer } from '../uikrenderer' import { UIKFont } from '../assets/uikfont' import { Vec4, Color } from '../types' /** * Configuration interface for UIKPanel component */ export interface UIKPanelConfig { /** Bounding rectangle [x, y, width, height] */ bounds: Vec4 /** Panel title */ title?: str...
34ab22ccbe351c5f747ea1b8407071b6b7edc48071ba7ebbc78a718d668af4fe
TypeScript
15,271
350
import { UIKRenderer } from '../uikrenderer.js' import { UIKFont } from '../assets/uikfont.js' import { Vec4, Color } from '../types.js' /** Resolves a colormap name to its RGBA lookup table — a flat array of * `[r,g,b,a, r,g,b,a, …]` bytes (0–255), e.g. NiiVue's `nv.colormap(name)` * (256×4). Return null/undefined ...
8e57cbc1a53dc3c0d9ccb020d757eeaab23e5fbd7a44f90d3b9120530b55ce82
TypeScript
15,324
391
/** * ImageOrientation module * * Handles image orientation, RAS calculation, and reorientation. * This module contains functions for: * - Calculating RAS (Right-Anterior-Superior) orientation from NIfTI headers * - Computing oblique transformation matrices * - Detecting misalignment between voxel and world spac...
cc0723054acc4c7e933485177c271b9bb06ccb5185161f5c538cba435913a899
TypeScript
15,446
382
import { mat4, vec3, vec4 } from 'gl-matrix' type Geometry = { vertexBuffer: WebGLBuffer indexBuffer: WebGLBuffer indexCount: number vao: WebGLVertexArrayObject | null } /** * Represents a 3D object rendered with WebGL, including geometry, transformations, and rendering state. * Used internally by N...
10811bed5bdc01a7848d7aa608b574baa89040481ae620ffcd65b84b0ab42797
TypeScript
15,570
496
// Copyright (C) 2020-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { AnyAction } from 'redux'; import { AuthActionTypes } from 'actions/auth-actions'; import { SettingsActionTypes } from 'actions/settings-actions'; import { AnnotationActionTypes } from 'actions...
1ffe594b1c34473a115211bafd9e4da552fc521d78fe4796678403dda6af33a6
TypeScript
15,638
358
/** * WebGL utility functions for context initialization and texture management. * This module provides pure functions for WebGL operations that can be reused * throughout the library without class instantiation overhead. */ // Texture unit constants const TEXTURE3_FONT = 33987 const TEXTURE4_THUMBNAIL = 33988 con...
fcd280ecfa01eb1c1ce7c95463a59ea6150aedae14238603ba537cd7f25cb2c5
TypeScript
15,686
389
import { test, expect } from '@playwright/test' import { Niivue } from '../../dist/index.js' import { httpServerAddress } from './helpers.js' import { TEST_OPTIONS } from './test.types.js' test.beforeEach(async ({ page }) => { await page.goto(httpServerAddress) }) test.describe('NiiVue Drag Modes', () => { //...
5125a4a3ccfa2a95c9774b71cbd79c1f3fe0bb12ad4a8c2458d9d6f324fa06f2
TypeScript
15,718
523
// Copyright (C) 2020-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import _ from 'lodash'; import { AnyAction } from 'redux'; import { ThunkAction } from 'utils/redux'; import { GridColor, ColorBy, SettingsState, CombinedState, } from 'reducers'; import { Orien...
027f046d9c007317a3ff3da2952d72a1435e82de488af54ee5e1d88346ca4dbf
TypeScript
15,805
483
/** * @license * Copyright 2018 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
c7d3afa11822d2a56365652a0b075d832acfd062cb2520060d07d190e05dbb89
TypeScript
15,934
565
/** * DragModeManager module for managing drag interaction modes. * This module provides pure functions for drag mode management and drag-related calculations. * * Related to: Drag interactions, pan/zoom, windowing, angle measurement */ import { vec4 } from 'gl-matrix' import { DRAG_MODE } from '../../nvdocument....
552014d186c28719a77c6926d5ff2e1a0e9e78668ad3e09a2833b0f28394fcd5
TypeScript
16,093
488
import { app, shell, BrowserWindow, Menu, ipcMain } from 'electron' import { join } from 'path' import * as fs from 'fs' import { registerIpcHandlers } from './utils/ipcHandlers.js' import icon from '../../resources/icons/app_icon.png?asset' import { createMenu } from './utils/menu.js' import { getPlatformIcon } from '...
0a2d1a49c172b5af2216adc5e466418202c6ff4626fa742ce222a4d6f277bf14
TypeScript
16,311
548
/** * @license * Copyright 2017 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
78a680eb80f561a23cefeb6b61f13d87feb9491b45dae613104ec323afd04695
TypeScript
16,433
488
/** * @license * Copyright 2021 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
56cfdcf60e298699428cb0b33c09274b33689805c1a4b4ea5825085535acf4c7
TypeScript
17,209
454
import { vec3 } from 'gl-matrix' import { LUT } from '@/colortables' type Extents = { mxDx: number extentsMin: number | number[] extentsMax: number | number[] } /** * Utilities class for common mesh functions */ export class NVMeshUtilities { static getClusterBoundaryU8(u8: Uint8Array, faces: number...
f1774c79b4e539aadddba5f3891a05ff338fea1ec58f041267a42a7e278de67b
TypeScript
17,267
513
/** * @license * Copyright 2026 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
6bbcd19bdcceaf1467d2efd54f55b2c552284afa0c07fd7b21ff2cff107b16a1
TypeScript
17,357
497
import { UIKRenderer } from '../uikrenderer' import { UIKFont } from '../assets/uikfont' import { Vec4, Color } from '../types' /** * Configuration interface for UIKToggle component */ export interface UIKToggleConfig { /** Bounding rectangle [x, y, width, height] */ bounds: Vec4 /** Current toggle state */ ...
93e321859314b9c435dfedda4c4b78888bb598a777ba8e3a8dc05e51374afd15
TypeScript
17,364
454
import { vec3 } from 'gl-matrix' import { NVMesh, MeshType } from '@/nvmesh' import { NVUtilities } from '@/nvutilities' import { NiivueObject3D } from '@/niivue-object3D' import { NVMeshUtilities } from '@/nvmesh-utilities' import { cmapper } from '@/colortables' import { NVLabel3D, LabelTextAlignment, LabelLineTermin...
90727c2b64f67eb7f6d020a2388899cee98f2f3013f9bd69b2dae039a89a7798
TypeScript
17,673
523
/** * @license * Copyright 2016 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
d984987a090df3628a21639e3b6fd10c36a3a8c565c4cca561421b74f0ca86b9
TypeScript
18,040
521
import * as tf from '@tensorflow/tfjs' import type { InferenceOptions } from './types.js' /** * Inference engine following brainchop's reference implementation. * Key features: * - Crops volume to brain bounding box before inference (reduces tensor size) * - Runs layer-by-layer instead of model.predict() (allows i...
875e1575b60b1fb27597ac945052247a8c395c834b9119900f33aabcb8e34065
TypeScript
18,977
500
import { SLICE_TYPE } from '@/nvdocument' import { TypedVoxelArray } from '@/nvimage' interface DrawingDimensions { dimX: number dimY: number dimZ: number } interface InterpolationOptions { intensityWeight?: number binaryThreshold?: number intensitySigma?: number applySmoothingToSlices?: b...
0f99b05c9b2c8b4353a586e1f2696a996136e1a4398f768fc9ffa617e3455b73
TypeScript
19,098
595
/** * @license * Copyright 2017 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
b5d568505fc3e74d8b2c7e2b0a5db6259f186dea34b56b4d297ea7f092e5f500
TypeScript
19,155
627
/** * @license * Copyright 2020 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
5c54f8191f9d4e650ce604963b8acfa24a58f8dab4c87ef3aecd277a3be59bba
TypeScript
19,293
647
/** * Pen drawing tool pure functions for freehand drawing operations. * * This module provides pure functions for pen-based drawing including * single point drawing, line drawing, and filled polygon drawing. * * Related modules: * - DrawingManager.ts - Drawing state management and undo/redo * - ShapeTool.ts - ...
d116ba7a23e0fb11ddaac2fa922dbe087aae247441969a9b1263aff693dd91fa
TypeScript
19,951
517
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' import { Niivue } from '../../src/niivue' import { NiivueEvent } from '../../src/events' describe('Niivue EventTarget API', () => { let nv: Niivue beforeEach(() => { nv = new Niivue() }) afterEach(() => { // Clea...
b32b0f96f02632b53f838e515cfa7f9d2081cb557bd1951803c15809657ab17b
TypeScript
20,113
623
/** * Shader management functions for WebGL shader compilation, initialization, and lifecycle. * This module provides pure functions for shader operations without class instantiation overhead. */ import { Shader } from '@/shader' import { vertSliceMMShader, vertMeshShader, gradientOpacityLutCount, v...
9e7d3f7d2e617672bdbab7f9ef2ec283c36db78a31beeb9efc4d37194fe89786
TypeScript
20,269
490
// Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { ActionUnion, createAction, ThunkAction, ThunkDispatch, } from 'utils/redux'; import { AudioIntervalState, FramesMetaData, Job, Source, fetchAndAssembleAudio, } from 'cvat-core-wrapper'; import { ActiveControl } from 'reducers'; im...
d66c5c06eb728b80a8a103a3ceb1a6720e4e3584914a0165858aa2e8241161b8
TypeScript
20,556
554
// Copyright (C) 2019-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import PluginRegistry from './plugins'; import logger from './logger'; import { Event } from './event'; import ObjectState from './object-state'; import Statistics from './statistics'; import Comment fr...
f5ec3a39485f9d4f8b5fef36081a17fbac6f188e7c70dcd91a04ff10b0e31b04
TypeScript
20,593
590
/** * Volume layer rendering helper functions for breaking up complex refreshLayers() logic. * These pure functions handle specific aspects of volume layer rendering. */ import { mat4, vec3 } from 'gl-matrix' import { NVImage } from '@/nvimage' import { NiivueObject3D } from '@/niivue-object3D' import { toNiivueObj...
8a2536a796eae492fc95ea1ae5370c1f1bc7f5984e3a23acba3fdab932dcf982
TypeScript
20,865
554
/** * Volume rendering helper functions for 3D visualization. * This module provides pure functions for 3D volume rendering operations. * * Related to: 3D volume rendering (ray-casting, MIP, etc.), gradient textures, lighting */ import { mat3, mat4, vec3 } from 'gl-matrix' import { NiftiHeader } from '@/types' im...
87c9703f8d8c4ddeb4db9cb4417f6a716ff61697127a57a6341e070430dc0d19
TypeScript
21,463
679
/** * Brainchop Web Worker * * Runs TensorFlow.js inference off the main thread so the UI stays responsive. * The main thread sends volume data + model artifacts; this worker reconstructs * the model, runs the full inference pipeline, and returns label data. */ import * as tf from '@tensorflow/tfjs' import type ...
4842ce6d0b65a0eface23de362e89eabe8b4eebf814a023451482f827b01e5fd
TypeScript
21,964
616
import * as tf from '@tensorflow/tfjs' import '@tensorflow/tfjs-backend-wasm' import '@tensorflow/tfjs-backend-webgpu' import { setWasmPaths } from '@tensorflow/tfjs-backend-wasm' import type { ModelInfo, ModelCacheEntry } from './types.js' import modelsRegistry from './models/models.json' assert { type: 'json' } /** ...
6a1f607ec04b5e6eb9bd9fe2da56bc79de7a9612c0cebad2142b45b755c926ce
TypeScript
21,996
643
/** * @license * Copyright 2017 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
37d1c12cd459286642e65b38900eac7e18a6efb1afe2794a217efdf701e3eb39
TypeScript
22,299
677
import { vec3 } from 'gl-matrix' import { log } from '@/logger' import { NiftiHeader } from '@/types' import { LUT } from '@/colortables' export const isPlatformLittleEndian = (): boolean => { // inspired by https://github.com/rii-mango/Papaya const buffer = new ArrayBuffer(2) new DataView(buffer).setInt16...
6aafafdd57da7efae69fe83abdecacafca88ae4b675f989126c91297a1b5b61d
TypeScript
22,806
772
/** * UI element rendering helper functions for overlays, colorbars, text, shapes, rulers, and graphs. * This module provides pure functions for UI rendering calculations and state setup. * * Related to: colorbar, ruler, text rendering, shapes, graphs, orientation cube, labels */ import type { NVLabel3D } from '@...
905a8b30961dfac70c5b2718b6ce09d72af6bb425ae1115ada40a9aa124d4ce1
TypeScript
23,207
709
/** * Layout management helper functions for multiplanar layouts, tile arrangements, and canvas dimensions. * This module provides pure functions for layout-related calculations. * * Related to: Multiplanar layouts, custom layouts, bounds regions, field of view calculations */ import { mat4, vec3 } from 'gl-matri...
36612d1704c8a880441d5d9fed397ae77010af1560a108e7cff3471a317c17d6
TypeScript
23,216
544
/** * ZarrChunkClient - HTTP client for fetching zarr array data using zarrita.js. * * Handles pyramid discovery and chunk fetching for OME-ZARR and regular zarr stores. */ import * as zarr from 'zarrita' import type { TypedArray } from './ZarrChunkCache.js' export interface ZarrChunkClientConfig { /** Base U...
998308f373ad8dbd791ef7904f434edd8aadbe2dae144f5891276f9848b69987
TypeScript
23,497
749
/** * Flood fill tool pure functions for flood fill and click-to-segment operations. * * This module provides pure functions for region-based filling operations including * core flood fill algorithm, intensity-based segmentation, and click-to-segment functionality. * * Related modules: * - DrawingManager.ts - Dr...
6c7907359adacd2960f736ce590aae2179c2665e97043e9ab81016bf310092c0
TypeScript
23,883
700
import { vec3, vec4, mat4 } from 'gl-matrix' import { NVImage } from '@/nvimage' import { NVMesh } from '@/nvmesh' import { NiivueObject3D } from '@/niivue-object3D' import { SLICE_TYPE } from '@/nvdocument' import { swizzleVec3 } from '@/utils' import { NVUtilities } from '@/nvutilities' /** * Represents a 2D screen...
e6eac9332251447a5154516fdfa758aeda1c8390b508448228b307ce01c1fce4
TypeScript
24,719
642
// Copyright (C) 2020-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import _ from 'lodash'; import * as SVG from 'svg.js'; import consts from './consts'; import Crosshair from './crosshair'; import { stringifyPoints, translateToCanvas, RLEToImageData, imageDataT...
e1379999c50c58f6c55a45de74dadb622a09dfd0a14ca19dfda878b45f4d064b
TypeScript
25,030
825
/** * @license * Copyright 2017 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
161aeca26f8d91b17582fc4bc257fc1f8e989de68ed2c412e1597dc5f4be9510
TypeScript
25,217
627
// Copyright (C) 2019-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { omit } from 'lodash'; import config from './config'; import PluginRegistry from './plugins'; import { observe } from './capabilities'; import serverProxy from './server-proxy'; import lambdaMa...
b42889d392903659bf24054db6c09152615fe809db203d33d723842424f6f60a
TypeScript
25,405
609
// Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import * as SVG from 'svg.js'; import { stringifyPoints, translateToCanvas, translateFromCanvas, translateToSVG, findIntersection, imageDataToRLE, Segment, findClosestPointOnSegment, segmentsFromPoints, toReversed, } from './shared'; i...
54f6593beabb089dbbab8116ff80b1d1cde95cc46fdc145806dc34967cf47139
TypeScript
25,818
781
/** * @license * Copyright 2021 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
c9c9ba7b2c799cd016885e99484bd900a56e90fe0683ff7a25fd94d9b71f02b4
TypeScript
25,982
857
// nvdocument.ts (updated) // --- imports import { vec3, vec4 } from 'gl-matrix' import { NVSerializer } from '@/nvserializer' // adjust path if needed import { NVUtilities } from '@/nvutilities' import { ImageFromUrlOptions, NVIMAGE_TYPE, NVImage } from '@/nvimage' import { NVMesh } from '@/nvmesh' import { NVLabel3D...
a2306ee65479643b35e28ce2b890d6fa176020cf09beb3812044babc6e419925
TypeScript
27,465
852
/** * @license * Copyright 2016 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
b303b0a170429908ec9fdf8e43947bb93b3234104a714e6e23f9e46bba91c9a2
TypeScript
28,909
914
/** * @license * Copyright 2016 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
2762205ea21d7314adb5e768725f6defbcaa57b88178f1dd3e02f0f4a668c200
TypeScript
29,155
858
import { app, Menu, dialog, nativeImage, systemPreferences } from 'electron' import { sliceTypeMap } from '../../common/sliceTypes.js' // import { layouts } from '../../common/layouts.js' // import { orientationLabelMap } from '../../common/orientationLabels.js' import { dragModeMap } from '../../common/dragMode.js' im...
5a3f4c4c9bbaa98ff43c6a25ae7df8e5c7ebbe99a626a7af8b82fd7fa2e975c0
TypeScript
29,338
680
import arrayEqual from 'array-equal' import { mat4, vec3, vec4 } from 'gl-matrix' // TODO: TypedNumberArray also in nvmesh-types.ts type TypedNumberArray = Float64Array | Float32Array | Uint32Array | Uint16Array | Uint8Array | Int32Array | Int16Array | Int8Array /** * Namespace for utility functions * @ignore */ ...
01237f53497141708408d0b92cf8e29cb7abdadb2764d01eb89161eb32c03568
TypeScript
29,849
1,018
/** * @license * Copyright 2018 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
01c47bf09c906f76039c2548fab93446e4119c124eb3b67779e62738ab2216d4
TypeScript
30,391
1,023
/** * @license * Copyright 2016 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
70b9079eeb15bf28c8d459acc0874802500a9c81afc2724cc358674355dc13fb
TypeScript
33,279
904
import { mat4, vec2, vec4 } from "gl-matrix" import { UIKShader } from "./uikshader.js" import circleVert from "./shaders/vert/circle.vert.glsl" import circleFrag from "./shaders/frag/circle.frag.glsl" import lineVert from "./shaders/vert/line.vert.glsl" import rectVert from "./shaders/vert/rect.vert.glsl" import solid...
268f254d7cfe63245df7cbe5479b15cb534a0194b30ce3188798826aedca004a
TypeScript
33,290
809
// src/nvserializer.ts import { vec3 } from 'gl-matrix' import { NVUtilities } from '@/nvutilities' import { NVImage, NVIMAGE_TYPE } from '@/nvimage' import { NVMesh, MeshType } from '@/nvmesh' import { NVConnectome } from '@/nvconnectome' import { log } from '@/logger' import { NVDocument, DEFAULT_OPTIONS, DocumentDat...
64bca74b3ba8222fd33ea8c2ba678e02a22f775393cbfdd09453663e4d292925
TypeScript
33,660
1,159
/** * Image processing pure functions for thresholding, connected component * labeling, and other image operations. * * This module provides pure functions for image processing operations. * State management and WebGL operations remain in the Niivue class. * * @module ImageProcessing */ import { mat4, vec3, ve...
e8ef4affe34d66185bba2f64b3cca7b0e89c08ed93432f1facb66ab017125979
TypeScript
34,225
1,295
// Copyright (C) 2020-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { Canvas3d } from 'cvat-canvas3d/src/typescript/canvas3d'; import { Canvas, RectDrawingMethod, CuboidDrawingMethod, RenderData, CanvasHistorySource, } from 'cvat-canvas-wrapper'; import { Ori...
02c38a9876452ddbc2244e79f2c9d5226dc4c19d211d2e8cc697f434550492ef
TypeScript
34,391
931
/** * @license * Copyright 2024 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
9daf04cd7636e72faeb223cb88a8e17cb29ea673a82afcbb8d25da8f4583fd08
TypeScript
34,705
911
// Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { fabric } from 'fabric'; import debounce from 'lodash/debounce'; import { DrawData, MasksEditData, Geometry, Configuration, BrushTool, ColorBy, Position, } from './canvasModel'; import consts from './consts'; import { DrawHandler } fr...
fc6a3cff1e22837a6771acfbd02451fcf1fa61ce7ab533e973f524bb6897e5b2
TypeScript
40,220
1,344
/** * @license * Copyright 2024 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
5a6ac4c518433cfde7918e7c4cd49be27ca0ae219651a344adb97b36121d8ca5
TypeScript
40,242
1,178
/** * @license * Copyright 2016 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
befc220b44d7c59603f5a24603474db180ad61245e35ec359aecec8182e968a0
TypeScript
41,232
1,041
/** * NVZarrHelper - Simplified zarr chunk management for NVImage. * * Attaches to a host NVImage and manages chunked loading of OME-Zarr data. * No zoom, no prefetching - just pan and level switching. * All coordinates are in current-level pixel space. * * Spatial dimensions are kept in OME metadata order throu...
c70379797b0f3186d0b0872898d13f209ac1f9581f1b56ddc522ca27ad570c01
TypeScript
42,578
1,279
// Copyright (C) 2019-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import consts from './consts'; import { MasterImpl } from './master'; export interface Size { width: number; height: number; } export interface Image { renderWidth: number; renderHeigh...
2f3600348503aff3533337321b296a3b7d15697c6a89cfea0c51c2ed72eaefa5
TypeScript
46,476
1,351
// Copyright (C) 2020-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import _ from 'lodash'; import { AnyAction } from 'redux'; import { AnnotationActionTypes } from 'actions/annotation-actions'; import { JobsActionTypes } from 'actions/jobs-actions'; import { AuthAction...
238c992d7a40171a3d2d7dd77104a8bfc50919c307c2177b732cc1c1d9867b31
TypeScript
46,624
1,419
/** * @license * Copyright 2016 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
1bc9e66fc4e4e7e82289a9244e792ecf68db861aab98cbf275b884003bbad832
TypeScript
50,596
1,352
// Copyright (C) 2019-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { ChunkQuality } from 'cvat-data'; import { ChunkType, DimensionType, HistoryActions, JobStage, JobState, JobType, MediaType, StorageLocation, TaskMode, TaskStatus, } from './enums'; impo...
eaf349e6b74e81048b99ea09f53799a048a9d533ce2b66ee7e3a7b91e2f33973
TypeScript
51,689
1,495
/** * @license * Copyright 2016 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
0575fc01cbb18a9a1d7382c7fda331203bd0d339843688c1eb7935b341e2c1dc
TypeScript
53,950
1,399
import { NIFTI1, NIFTI2, NIFTIEXTENSION, readHeaderAsync } from 'nifti-reader-js' import { mat4, vec3, vec4 } from 'gl-matrix' import { v4 as uuidv4 } from '@lukeed/uuid' import { ColorMap, LUT } from '@/colortables' import { log } from '@/logger' import { ImageFromBase64, ImageFromFileOptions, ImageFromUrlOptions, Ima...
57ebe398a526452ed312a49d09b1986640cbea10809898a366c178ec3b67b72b
TypeScript
58,962
1,726
/** * @license * Copyright 2017-2019 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable l...
73ade4bf3084be8304d280f266e31d103c839e50e052afbb7f20b7d7d85da1b7
TypeScript
62,820
1,902
/** * @license * Copyright 2025 Google Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
82c4118064bb6d30735cc0d3844e606d42df52c26976996be2af00be2f0a73a3
TypeScript
67,804
1,551
// Copyright (C) 2019-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { omit } from 'lodash'; import config from './config'; import { ArgumentError } from './exceptions'; import { HistoryActions, JobStage, JobState, JobType, RQStatus, } from './enums'; impo...
3d4883e17f72f15b8f4ccf7cedd31dbc68e5f8b952488c88a10477d6bbd5fc22
TypeScript
78,903
1,941
// Copyright (C) 2019-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import _ from 'lodash'; import { shapeFactory, trackFactory, Track, Shape, Tag, MaskShape, BasicInjection, SkeletonShape, SkeletonTrack, PolygonShape, CuboidShape, RectangleShape, Polyli...
0780bd5e3f69538fdca573a97bbc22b62ff7cc398bb2eaf09feea5f8f3bfd285
TypeScript
80,487
2,326
// Copyright (C) 2020-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { AnyAction, Store } from 'redux'; import { ThunkAction, ThunkDispatch } from 'utils/redux'; import isAbleToChangeFrame from 'utils/is-able-to-change-frame'; import getHiddenZLayers from 'utils/g...
a9f0e3f0606276dd58d29e4307c5c5ebbaa1e342cfea0039a258ef8ebdafdc66
TypeScript
85,677
2,489
export const vertRenderShader = `#version 300 es #line 4 layout(location=0) in vec3 pos; layout(location=1) in vec3 texCoords; uniform mat4 mvpMtx; out vec3 vColor; void main(void) { gl_Position = mvpMtx * vec4(pos, 1.0); vColor = texCoords; }` const kDrawFunc = ` vec4 drawColor(float scalar, float drawOpacity) { ...
f4bd0f09e397de37c8b635c21981cf010f57e7b1f1ab12cab8a4c6bd7cd0018d
TypeScript
88,705
2,943
// Copyright (C) 2019-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import FormData from 'form-data'; import Axios, { AxiosError, AxiosHeaders, AxiosResponse } from 'axios'; import * as tus from 'tus-js-client'; import { ChunkQuality } from 'cvat-data'; import './axios...
f18e1612d58ea1a045a4da0df03d89f41839237aab35bdf956531f2d0f2bd787
TypeScript
88,911
2,084
import { vec3, vec4 } from 'gl-matrix' import { v4 as uuidv4 } from '@lukeed/uuid' import { log } from '@/logger' import { NiivueObject3D } from '@/niivue-object3D' import { ColorMap, LUT, cmapper, COLORMAP_TYPE } from '@/colortables' import { NVMeshUtilities } from '@/nvmesh-utilities' import { NVMeshLoaders } from '@...