sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
5e5912ec989ccbf1cd7e1993e620294a7592ff5874e12223960928ccb2750f48
TypeScript
3,642
117
// Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { SerializedApiToken, SerializedUser, SerializedUserGrowthData, } from './server-response-types'; import { QualityRequirementAnnotationType } from './quality/server-response-types'; import { JobType } from './enums'; import { Camelized,...
ba55858300c5b1847f2692d09704a3e358c4cf9795343ab86683344d72df599b
TypeScript
3,675
129
/** * Camera controller helper functions for 3D camera control (azimuth, elevation, zoom, pan). * This module provides pure functions for camera-related calculations. * * Related to: 3D view rotation, 2D pan/zoom, camera state management */ /** * Normalize azimuth angle to 0-360 range. * @param azimuth - Azimut...
335a40a3bc1b9f33cc9998fd426c7740aca39aa02c1db756b9c052172571c429
TypeScript
3,724
118
import { Log } from './utilities/log' // Helper function to compile a shader export const compileShader = function ( gl: WebGL2RenderingContext, vert: string, frag: string ): WebGLProgram { const vs = gl.createShader(gl.VERTEX_SHADER) if (!vs) { throw new Error('Failed to create vertex shad...
b2bb2775bfd7dc269cd8ee315c5572710f9130e1febb374bf55148362f0cea5f
TypeScript
3,736
118
import { expect, test, describe, vi } from 'vitest' import { drawUndo } from '../../../src/drawing/undo' import { decodeRLE } from '../../../src/drawing/rle' vi.mock('../../../src/logger', () => ({ log: { debug: vi.fn() } })) vi.mock('../../../src/drawing/rle', () => ({ decodeRLE: vi.fn() })) describe('dra...
a7d46902353104d06e74d537b2241e433f7804f3e9769639ef0faf1d9db63228
TypeScript
3,742
102
// Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { Config } from '@react-awesome-query-builder/antd'; import asyncFetchUsers from 'components/resource-sorting-filtering/request-users'; export const config: Partial<Config> = { fields: { state: { label: 'State', ...
33116e4d2907e227bffdc8198db5bb3cfd663e9543e6d122bb226eac09e8b8c7
TypeScript
3,800
72
export { default as $itksnap } from './_itksnap.json' export { default as $slicer3d } from './_slicer3d.json' export { default as actc } from './actc.json' export { default as batlow } from './batlow.json' export { default as bcgwhw_dark } from './bcgwhw_dark.json' export { default as bcgwhw } from './bcgwhw.json' expo...
a14e0f4f859d24845a256a3a0d9f5f43b8bedeafcf7bcba21dbf8ff0814e264a
TypeScript
3,838
194
import { Actor } from "./actor"; import { TypeTaskType } from "./task"; import { Worker } from "./worker"; export type Job = { jobId: string; name: string; owner: string; language: string; driverEntry: string; state: string; timestamp: number; startTime: number; endTime: number; namespaceId: string...
aa84186db9154c9ed47caf5ca59a91c6081dca8a93fbdc0ecc130e7817221e43
TypeScript
3,916
123
import { describe, it, expect, beforeAll, afterAll } from 'vitest' import { runCLI, EXIT_CODES } from '../helpers/cli-runner.js' import fs from 'fs' import path from 'path' import os from 'os' describe('CLI Pipeline Tests (stdin/stdout)', () => { let tempDir: string beforeAll(() => { tempDir = fs.mkdtempSync(...
e798a61c7aef1434a7d42ced85fe21f3e41778fc4ce85c4ef6f8ceff125c1ec9
TypeScript
3,952
144
import { mat4 } from 'gl-matrix' /** * Represents an affine transformation in decomposed form. */ export interface AffineTransform { translation: [number, number, number] // X, Y, Z in mm rotation: [number, number, number] // Euler angles in degrees (X, Y, Z order) scale: [number, number, number] // Scal...
c5945575f1abd75158c22a35110feb1a88f38b18d3e5bea2d5bbcbf8716224a2
TypeScript
3,953
132
/** * Post-processing for brain segmentation: connected-component filtering. * * After inference, the label volume may contain small disconnected clusters * (skull fragments, meninges) outside the main brain region. This module * binarizes all nonzero labels, finds connected components of the binary mask, * keeps...
9177fb357f0847424b6e21244800d835e2bdd9658670bbd46374056c5afa3ff4
TypeScript
3,997
121
// Copyright (C) 2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { Config } from '@react-awesome-query-builder/antd'; import asyncFetchUsers from 'components/resource-sorting-filtering/request-users'; export const config: Partial<Config> = { fields: { ...
7ef6e45000687964ac90b592b855df28393a33c10bd17239ac6cbc1dcadea1d2
TypeScript
4,011
122
// Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { useDispatch, useSelector } from 'react-redux'; import { audioActions } from 'actions/audio-actions'; import { ActiveControl, CombinedState } from 'reducers'; import { registerComponentShortcuts } from 'actions/shortcuts-actions'; import ...
95a734a2ffbe4b56a3735b8622219064f4d7264375b80d3ee7220da5b12fe8b3
TypeScript
4,059
108
/** * TensorProcessing module * * Handles diffusion tensor and vector field processing. * This module contains functions for: * - Converting vector fields to RGBA representation * - Loading and processing V1 vector data with optional flips */ import type { NVImage } from './index' import { log } from '@/logger'...
04cbef812231e4ee0e13b1426e0ba82ef2dd0032c1bbd576173d412cb5203852
TypeScript
4,136
114
import { describe, it, expect, beforeAll, afterAll } from 'vitest' import { runCLI, EXIT_CODES } from '../helpers/cli-runner.js' import fs from 'fs' import path from 'path' import os from 'os' import { fileURLToPath } from 'url' const __dirname = path.dirname(fileURLToPath(import.meta.url)) describe('CLI view subcomm...
4e119ea8050eb45821494d6bd51cac5cfb89c51a671eb0e55f7cfa31a75c713f
TypeScript
4,201
132
/** * @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...
3301413b01843041ee1544c9ab08b07d8b547665815846f18f55bfeeaedeee73
TypeScript
4,276
32
export const orientCube = new Float32Array([ -1, -1, -1, 0.28, 0.28, 0.28, -1, -1, -1, 0.28, 0.28, 0.28, -1, 1, -1, 0.28, 0.28, 0.28, 1, -1, -1, 0.28, 0.28, 0.28, 1, 1, -1, 0.28, 0.28, 0.28, 1, 1, -1, 0.28, 0.28, 0.28, -1, -1, 1, 0.8, 0.8, 0.8, -1, -1, 1, 0.8, 0.8, 0.8, 1, -1, 1, 0.8, 0.8, 0.8, -1, 1, 1, 0.8, 0...
310efe8b4201cecdea008f572c73e9b7136c0b8509ac5a8fbf8b3606fbde550a
TypeScript
4,278
163
import { UIKRenderer } from "./uikrenderer.js" import { UIKFont } from "./assets/uikfont.js" import { LineTerminator, LineStyle, Vec2 } from "./types.js" import defaultFontPNG from "./fonts/Roboto-Regular.png" import defaultFontJSON from "./fonts/Roboto-Regular.json" assert { type: "json" } // Core UIKit exports exp...
6cb7472ffd3f9d97af384cbf23b9402b011060a8fdf185b84ad4ae9634e53aca
TypeScript
4,328
120
import { describe, it, expect } from 'vitest' import { runCLI, EXIT_CODES } from '../helpers/cli-runner.js' describe('CLI General Behavior', () => { describe('Help output', () => { it('should show general help with --help flag', async () => { const result = await runCLI(['--help']) expect(result.exi...
45de3ba0d6b174559aedb31885a8dbb3dd6859c13de6e6ebb72a67ba1cd3c19a
TypeScript
4,463
156
import React, { useCallback, useContext, useEffect, useState } from "react"; export type MainNavPage = { /** * This gets shown in the breadcrumbs. */ title: string; /** * This gets shown as the HTML document page title. If this is not set, the title field will be used automatically. */ pageTitle?: ...
6fdef031ffd967a75c69caf5e5b24553b506470e0cc356063da89aa19d6fc8f1
TypeScript
4,503
125
/** * @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...
84986fe572ec610eb997c18557428956cbc8be3a121b695d285951cd8fdf0402
TypeScript
4,505
128
// Copyright (C) 2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { Config } from '@react-awesome-query-builder/antd'; import asyncFetchUsers from 'components/resource-sorting-filtering/request-users'; export const config: Partial<Config> = { fields: { ...
2007212179a223867566c89828298c14668063e7be20c6acad825263fb3e449c
TypeScript
4,525
111
import { contextBridge, ipcRenderer, webFrame } from 'electron' import { electronAPI } from '@electron-toolkit/preload' import { join } from 'path' import type { CLIOptions, ResolvedInput } from '../common/cliTypes.js' const api = { ...electronAPI, startTabDrag: (fileName: string, jsonStr: string): void => { i...
3c528a1d2671f71a82932100afb7eeb80492f59074a518346b6bae9b1fc31c0e
TypeScript
4,527
172
import { describe, it, expect, beforeAll, afterAll } from 'vitest' import { runCLI, EXIT_CODES } from '../helpers/cli-runner.js' import fs from 'fs' import path from 'path' import os from 'os' import { fileURLToPath } from 'url' const __dirname = path.dirname(fileURLToPath(import.meta.url)) describe('CLI niimath subc...
d527b17770e6a33cdacdbbb885573710cd111ede2ec6703480f9ee70337e2b6a
TypeScript
4,561
143
/** * StreamingLoader module * * Handles streaming HTTP fetching and data loading: * - Streams and decompresses data from URLs * - Handles paired image formats (HEAD/BRIK, HDR/IMG) * - Manages chunked data assembly * * This module provides efficient streaming for large medical imaging files. */ import { uncom...
93c18d7ce20f14d2aededacae50e3f24400fb65144171763a19484b5471f0fea
TypeScript
4,613
167
/** * Label resolver utility for parsing label.json files and resolving * label names to numeric values. */ /** * A single label entry with value and name */ export interface LabelEntry { value: number name: string } /** * Label index for fast lookups by name or value */ export interface LabelIndex { /**...
049a7d2d100239cd7888c71a42fd132b6093d238dcf91eaa92a79c06018b9673
TypeScript
4,632
135
/** * Volume modulation functions for handling modulation textures in volume rendering. */ import { NVImage, NiiDataType } from '@/nvimage' import { Shader } from '@/shader' import { log } from '@/logger' /** * Parameters for modulation setup */ export interface ModulationParams { gl: WebGL2RenderingContext ...
992fe17533447b3e88bbfeeb10de9e6b9f170a7887ec78d9203a0d82c09f7c95
TypeScript
4,645
127
// src/ipcHandlers/registerAllIpcHandlers.ts import React from 'react' import { Niivue, NVImage, NVMesh } from '@niivue/niivue' import { registerLoadStandardHandler } from './loadStandard.js' import { registerLoadRecentFileHandler } from './loadRecentFiles.js' import { registerSliceTypeHandler, registerLabelManager...
5d255eb4e31c8b0b31cc270a0f753d966bccf3b74dd78ee9ed8ad3497a280038
TypeScript
4,769
119
import { NIFTI1 } from 'nifti-reader-js' import { log } from '@/logger' import type { NVImage } from '@/nvimage' import { NiiDataType } from '@/nvimage/utils' /** * Reads ECAT7 PET format image, modifying the provided NVImage header * and returning the raw image data buffer. * @param nvImage - The NVImage instance ...
6cdbfa6c465c57ade44d2803a59a0f289c95f67f3fed2f318c3d792469d99e9c
TypeScript
4,831
132
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 Clip Plane', () => { //...
a0be5881615e536438263381ddb71b4f3c89f10577874c1cfd006954bdbe255c
TypeScript
4,896
156
/** * @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...
514b956032c9bea4b61e75568dee530005082998e93f3ca27b82fc970f7747a9
TypeScript
4,937
151
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('niivue mouse down updates onLocationChange'...
e05d832a75dd920254c6826c0039b27148e182b8e47a1f099e0403a40f4ab231
TypeScript
5,015
102
import * as fs from 'fs' import * as path from 'path' import { test, expect } from '@playwright/test' import * as nifti from 'nifti-reader-js' import { Niivue } from '../../dist/index.js' import { httpServerAddress } from './helpers.js' import { TEST_OPTIONS } from './test.types.js' function getFilesizeInBytes(filenam...
abd96963dc9852020701199b9dd83250419cf545860d55089b9292e2718079c1
TypeScript
5,042
138
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('afni anat2temp', async ({ page }) => { ...
66aba343ba8a983d44a046ece2dc9274b199aba44ee7dd339b18abf4a9cab3e5
TypeScript
5,188
149
import path from 'path' import { app } from 'electron' import { spawn } from 'node:child_process' import fs from 'node:fs' import os from 'node:os' import type { DicomSeries, ConvertSeriesOptions } from '../../common/dcm2niixTypes.js' const isDev = !app.isPackaged function platformFolder(): 'darwin' | 'linux' | 'win3...
7c7a7716268d95b3e22f47be54ec50ba509e6fe74928ffd286f55caa14ac7ec3
TypeScript
5,196
163
/** * AffineProcessor module * * Handles affine matrix processing for NIfTI images: * - Validates pixel dimensions * - Calculates affine matrix from QForm quaternion parameters * - Repairs defective affine matrices * - Validates scale/intercept values * * The affine matrix defines the spatial transformation fr...
20b27fa4c4d06db04bda2abccc8b76e1d5204538204741144280931661adfa3e
TypeScript
5,258
181
import { app } from 'electron' import * as fs from 'fs' import * as path from 'path' import * as https from 'https' import * as http from 'http' import { readStdin } from './stdinReader.js' import { type ResolvedInput, STANDARD_IMAGES } from '../../common/cliTypes.js' const isDev = !app.isPackaged /** * Get the path...
8fd721a961647b268c64b13f38493d8f4a2d5a4292dea6b66fab75107e61f6ea
TypeScript
5,279
158
import { mat4, vec3 } from 'gl-matrix' import { NiivueObject3D } from '@/niivue-object3D' import { getExtents } from '@/nvimage/utils' import type { NVImage } from '@/nvimage' /** * Creates a NiivueObject3D representation for WebGL rendering from an NVImage. * @param nvImage - The NVImage instance * @param id - Uni...
2201a2b8f2c855cc7c566caa536fefa731629efd9b67527db80998f882396a77
TypeScript
5,349
158
import { NVImage } from '@niivue/niivue' /** * Defines the three possible slice orientations for viewing data * Each orientation corresponds to a different anatomical plane and dimension in the volume */ export enum SliceOrientation { AXIAL = 'axial', // Z axis, dims[3] SAGITTAL = 'sagittal', // X axis, dims[1]...
bc8a0df643a016850d630cd9cc1642c7dfafe1ce9dc4d3e54f0f67e18639af73
TypeScript
5,438
163
// Copyright (C) 2019-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { SerializedUser } from './server-response-types'; import { UserModifiableFields } from './server-request-types'; import PluginRegistry from './plugins'; import { fieldsToSnakeCase } from './comm...
06ead3b98dcf97cfc758699bd12c5e3129d6c8d2e30053ba36b4f183bb8fc62f
TypeScript
5,514
173
/** * @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...
32f4647fb5521fce735ea6b3de084e040ed6e8c8492e8a4aa28a7e167bcbb855
TypeScript
5,602
157
import { test, expect } from '@playwright/test' import { Niivue } from '../../dist/index.js' import { httpServerAddress } from './helpers.js' import { NiivueTestOptions, TEST_OPTIONS } from './test.types.js' test.beforeEach(async ({ page }) => { await page.goto(httpServerAddress) }) const defaultLayerOptions = { ...
5fd33d0ee1496a64380934aca0dd1b8558c05fb017cb3825ca555e679f394456
TypeScript
5,709
182
/** * @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...
cef7ccb8b3fb9345a755cfb1eb3cb78e67b4d96f180530cfba47a3090742bab8
TypeScript
5,806
183
import { app } from 'electron' import { spawn } from 'child_process' import { basename, extname, join, resolve } from 'path' import fs from 'fs' import os from 'os' // DEV flag const isDev = !app.isPackaged /** * Resolve the path to the bundled niimath binary for the current platform. */ export function getNiimathP...
92295c3d6e9f1d8a06c0413052182917da83b1f17728af95d4bc8402da1d666d
TypeScript
5,808
188
// Copyright (C) 2021-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { numberArrayToPoints, type Point } from './math-utils'; export interface IntelligentScissorsParams { shape: { shapeType: 'polygon' | 'polyline'; }; canvas: { shapeTy...
011ff37c212752ee7e18397603ed29f83ddfc6508bc9d89607b39a0e33daeac2
TypeScript
5,809
144
import type { NVImage, ImageFromUrlOptions } from '@/nvimage' import type { NVMesh, LoadFromUrlParams } from '@/nvmesh' import type { NVDocument, NVConfigOptions, CompletedMeasurement, CompletedAngle, SLICE_TYPE } from '@/nvdocument' import type { DragReleaseParams, UIData } from '@/types' /** * Type-safe event map f...
39b2464a5bf79a79d2fd506870e157bb01e2a4beee8cf7c443c94e03094e68c8
TypeScript
5,869
177
import React from 'react' import { Niivue, NVImage } from '@niivue/niivue' import { brainchopService } from '../services/brainchop/index.js' import type { SegmentationResult } from '../services/brainchop/types.js' const electron = window.electron export interface SegmentationHandlerProps { nv: Niivue setVolumes: ...
0e2ab9963a2e801524df057b81fe4982695f62f289d9e422dcd0fe5dd156dbb4
TypeScript
5,942
164
import { expect, test, describe } from 'vitest' import { decodeRLE, encodeRLE } from '../../../src/drawing/rle' describe('RLE (Run Length Encoding) functions', () => { describe('decodeRLE', () => { test('should decode a simple run', () => { // RLE format: negative header (-count+1) followed by value ...
57bb36d0d35096fb39241fa2bab47819d5aa79558cda192eb6d46ae109e8d3fc
TypeScript
5,968
177
import { Niivue } from '@niivue/niivue' import { sliceTypeMap } from '../../../common/sliceTypes.js' import { layouts } from '../../../common/layouts.js' import { orientationLabelMap } from '../../../common/orientationLabels.js' const electron = window.electron export const registerSliceTypeHandler = ( nv: Niivue, ...
e2ac017552d0e87d8647954d70aa1716bfa301dc6f4cabf56013ac94e804c0d4
TypeScript
6,075
138
import { NIFTI1 } from 'nifti-reader-js' import { log } from '@/logger' import type { NVImage } from '@/nvimage' import { NiiDataType } from '@/nvimage/utils' /** * Reads BrainVoyager V16 format image, modifying the provided NVImage header * and returning the raw image data buffer. * @param nvImage - The NVImage in...
45110da8b32cf30723ff51007143701876497c211aa4471089e38ab654b57ac7
TypeScript
6,198
178
/** * Connectome management functions for handling connectome loading and label operations. * This module provides pure functions for connectome data handling. */ import type { NVMesh } from '@/nvmesh' import { MeshType } from '@/nvmesh' import { NVConnectome, FreeSurferConnectome } from '@/nvconnectome' import typ...
134b9bc8b6835dd66c0f906f177a7f54b92110fd4ac42e54f51ff5b0db4277d1
TypeScript
6,218
175
import * as process from 'node:process' 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.skip...
b2ea38b90a567580a23156085d4a1e3519f398ee3e4dafa687e39979affedbce
TypeScript
6,267
163
import { NIFTI1 } from 'nifti-reader-js' import { mat3, vec3 } from 'gl-matrix' import { log } from '@/logger' import type { NVImage } from '@/nvimage' import { NiiDataType } from '@/nvimage/utils' import { NVUtilities } from '@/nvutilities' /** * Reads ITK MetaImage format (MHA/MHD), modifying the provided NVImage h...
5a9d92c88581efdf88316e257debc2dd8610f12c90ac60aac6422fbf9ce64b02
TypeScript
6,337
238
import { describe, it, expect, beforeAll, afterAll } from 'vitest' import { runCLI, EXIT_CODES } from '../helpers/cli-runner.js' import fs from 'fs' import path from 'path' import os from 'os' import { fileURLToPath } from 'url' const __dirname = path.dirname(fileURLToPath(import.meta.url)) describe('CLI extract subc...
58f1a2e7b3d7506e66200d80fe56286d4979f48acb5360b799f781a1b1cc3c0f
TypeScript
6,404
284
// Copyright (C) 2019-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier = MIT export enum ShareFileType { DIR = 'DIR', REG = 'REG', } export enum ChunkType { IMAGESET = 'imageset', VIDEO = 'video', } export enum TaskStatus { ANNOTATION = 'annotation', V...
6d551d265213b281366ac961e96847fe7178044fc2371627445a22f6cc453a20
TypeScript
6,426
294
import { vec3, vec4, mat4 } from 'gl-matrix' import { NVLabel3D } from '@/nvlabel' import { SLICE_TYPE, DRAG_MODE } from '@/nvdocument' export type NiftiHeader = { littleEndian: boolean dim_info: number dims: number[] pixDims: number[] intent_p1: number intent_p2: number intent_p3: number ...
43450b535f0a5f358617e4f868fffa428ce668299d566b534db6e9d69a9fa09f
TypeScript
6,501
187
// Copyright (C) 2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { ActionUnion, createAction, ThunkAction, ThunkDispatch, } from 'utils/redux'; import { getCore, Job, JobType } from 'cvat-core-wrapper'; import { JobsQuery } from 'reducers'; import { filterNull ...
b4bc46938e67b2cee79087d7c50e2167cb57d7f4735840b88f844d11a5d2f0ce
TypeScript
6,535
226
// Copyright (C) 2019-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { DrawData, MergeData, SplitData, GroupData, SelectData, JoinData, SliceData, MasksEditData, InteractionData as _InteractionData, InteractionResult as _InteractionResult, Canv...
569f51417f966ba84846ee7e8bbff286d1a9e8bbd673f589eac592a5215fa7a9
TypeScript
6,606
186
// @vitest-environment happy-dom // The package entry (../src) registers a window 'load' listener at import // time for the demo bootstrap, so a DOM environment is required to import it. import { UIKRenderer, UIKFont, UIKSlider, UIKColormapSelector, UIK_VERSION, checkUIKitCompatibility, MIN_TEXT_DEVICE_PX...
c36bd6593f655bc6715ad39f5eebdd4207a3afcfde1bd4643205827c010a680b
TypeScript
6,660
240
/** * Keyboard controller helper functions for keyboard event handling. * This module provides pure functions for keyboard interaction logic. * * Related to: Keyboard event handling, hotkey processing, clip plane cycling */ import { DRAG_MODE, SLICE_TYPE } from '../../nvdocument.js' /** * Clip plane preset valu...
be9ca1717d32f62637b4d68d1aec4933f2b195643c3b3dc4c69486f45a58d649
TypeScript
6,703
187
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('niivue setIsOrientationTextVisible', async ...
f2f20beee7e7a6afa99e1fe191361dc46f15df7800de4701a15027ba5057fb39
TypeScript
6,750
178
/** * CoordinateTransform Module * * Handles all coordinate system transformations for NVImage: * - Voxel ↔ Millimeter conversions * - Voxel ↔ Fractional texture coordinate conversions * - Fractional ↔ Millimeter conversions * * This module provides pure functions for transforming between different * coordinat...
cb8ae29855f34a350acec107cf11fe5cbcdbd24df8c5211da62c4edd372867e6
TypeScript
6,751
205
import { expect, test, vi, beforeAll } from 'vitest' import { Niivue, PEN_TYPE, SLICE_TYPE } from '../../src/niivue/index.js' // note the js extension import { calculateWindowingAdjustment } from '../../src/niivue/interaction/DragModeManager.js' import { vec4 } from 'gl-matrix' // Mock WebGL-dependent methods beforeAl...
7ce93eb7544a7e72eaeebb098abb710ca36e9264d4db5692736c37d3b5d86071
TypeScript
7,061
183
// Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { Attribute, ObjectState, ObjectType, ShapeType, } from 'cvat-core-wrapper'; import { isMacOS } from 'utils/platform-checker'; type MultiSelectModifier = 'shift' | 'ctrl' | 'alt' | 'meta'; type ModifierEvent = Pick<MouseEvent, 'shiftKe...
687d9f872abcfbbee0746a71afb3e63c17e9bfa192997ae1c716f85d7157cb69
TypeScript
7,087
239
// Copyright (C) 2022 Intel Corporation // // SPDX-License-Identifier: MIT import _ from 'lodash'; import { AnyAction } from 'redux'; import { JobsActionTypes } from 'actions/jobs-actions'; import { SelectionActionsTypes } from 'actions/selection-actions'; import { JobsState, SelectedResourceType } from '.'; const de...
caa463142a2f556f0e962e19588627b498157076d2c4a6b9408650a51c60dc55
TypeScript
7,162
184
import { NIFTI1 } from 'nifti-reader-js' import type { NVImage } from '@/nvimage' import { NiiDataType } from '@/nvimage/utils' import { NVUtilities } from '@/nvutilities' /** * Reads DSI Studio FIB format (fiber orientation data), modifying the provided * NVImage header and returning the raw image data buffer and V...
02a15bc4b09a314fb53946432f8719d6f1f5703b8fd97807a8aa0825f7e61bfc
TypeScript
7,167
192
import { test, expect } from '@playwright/test' import { Niivue } from '../../dist/index.js' import { httpServerAddress } from './helpers.js' import { TEST_OPTIONS } from './test.types.js' // Regression tests for https://github.com/niivue/niivue/pull/1565 // Single-panel 2D slice views should fill the entire canvas ra...
4b11d069856ed79c5d0dd19dafbbeac476cfd1cd617d870db2099bcf02cc3a02
TypeScript
7,375
207
/** * ImageDataProcessor module * * Handles low-level image data processing: * - Endian byte swapping for cross-platform compatibility * - Data type conversion from NIfTI format codes to TypeScript typed arrays * * This module contains pure functions for transforming raw image data * according to NIfTI header s...
0434f3f35da5ce9d87d2e8043d3ee0bb69c94b4c50eaccd993aaf814d0b0d90e
TypeScript
7,409
207
/** * @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...
b5527988a7720b2a87a0d4e1fa14a841e6240a16d78b2f2134c02a93e84f6fc5
TypeScript
7,484
231
import * as tf from '@tensorflow/tfjs' import type { NVImage } from '@niivue/niivue' import type { PreprocessingResult } from './types.js' /** * Image preprocessing for brain segmentation models * Handles volume harmonization, resampling, and intensity normalization */ export class ImagePreprocessor { private tar...
ee8d543c8ef2c765294e8243a4cb65af09622681473eb8a48c20f6f8b36d669e
TypeScript
7,505
274
/** * Wheel controller helper functions for mouse wheel/trackpad event handling. * This module provides pure functions for scroll wheel interaction logic. * * Related to: Mouse wheel scrolling, zooming, ROI resizing, segmentation threshold */ import { DRAG_MODE } from '../../nvdocument.js' /** * Parameters for ...
6fd08aa8706ba3b44f4a7f200d340e1b22fe4750690183d04ed228c33027c06c
TypeScript
7,627
255
/** * Drop handler utilities for drag-and-drop file loading. * * This module provides pure functions for handling drag-and-drop operations * including URL drops, file system entries, and paired file detection. * * Related modules: * - FileLoader.ts - File extension detection and format handling * - EventControl...
c5fc125c9ff44786b78e4dba2ba890c2530e9f7bc4aa4fb8f60fb50411093ad4
TypeScript
7,832
175
// Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { useLayoutEffect, useRef } from 'react'; import { VirtualItem, Virtualizer } from '@tanstack/react-virtual'; export type VirtualListKey = VirtualItem['key']; export interface VirtualListScrollTarget { key: VirtualListKey; align?:...
7521661e37adcbcee0de59271fb7e39c60c45618fbc42ff9fb01cf0af435ab59
TypeScript
7,854
252
import { NiftiHeader } from '@/types' /** Typed array types supported for voxel data */ export type TypedVoxelArray = Float32Array | Uint8Array | Int16Array | Float64Array | Uint16Array | Int32Array | Uint32Array /** * Options for creating a mask array */ export type MaskOptions = { /** Total number of voxels *...
79b1838654dc9767bb855fc8261631c9a20a10b56674fc37eb7819612e5c6574
TypeScript
7,921
290
import { useState } from "react"; import useSWR from "swr"; import { API_REFRESH_INTERVAL_MS } from "../../../common/constants"; import { getServeApplications } from "../../../service/serve"; import { ServeSystemActorStatus } from "../../../type/serve"; import { ServeDetails } from "../ServeSystemDetails"; const SERVE...
882a4651283fe0797a8fe28dfd2c6e188d097172ec725a52452678c300b9221a
TypeScript
8,158
222
import { NIFTI1 } from 'nifti-reader-js' import type { NVImage } from '@/nvimage' import { Zip } from '@/nvutilities' /** * Helper function to determine byte size per element from numpy dtype string. * @param dtype - NumPy dtype string (e.g., '<f4', '<i2', '|b1') * @returns Byte size of the data type */ function g...
320ff5992c8cee435acf55943da0189fca38e77da8e662203c4ca267f58ca028
TypeScript
8,345
217
/** * @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...
a5f6d555c276ef92da1b92642dba8562921bfede5240eb49be98f455527a0de2
TypeScript
8,381
271
/** * @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...
7c367e40a28ae1ce8002729a40a2b440970e494bc2d8c28f26fad6e5c36ab942
TypeScript
8,386
230
import * as fs from 'fs' import { test, expect } from '@playwright/test' import { Niivue } from '../../dist/index.js' import { httpServerAddress } from './helpers.js' import { NiivueTestOptions, NiivueTestOptionsFilePath, TEST_OPTIONS } from './test.types.js' test.beforeEach(async ({ page }) => { await page.goto(h...
69073ffd5652b399454ecbc5b4d5a8fdbdcde07d11452149d5bd0f57dc94612a
TypeScript
8,446
305
/** * Mesh management functions for handling mesh arrays and core mesh operations. * This module provides pure functions for mesh array manipulation. */ import type { NVMesh, NVMeshLayer } from '@/nvmesh' import type { ColorMap } from '@/colortables' import type { LegacyConnectome } from '@/types' import { log } fr...
c26ecd824f82751971bfacacbe26856969493e15ad3f10102d8d18f74db84303
TypeScript
8,453
203
/** * Volume texture management functions for handling GPU textures and texture operations. */ import { NVImage, NiiDataType, NiiIntentCode } from '@/nvimage' import { Shader } from '@/shader' import { log } from '@/logger' // Texture unit constants const TEXTURE9_ORIENT = 33993 /** * Prepare layer data by extrac...
c397557ed4f61c472bba8062d83269b8fe108c9adf2ba72fd0664f632e5b497d
TypeScript
8,589
292
/** * Volume management functions for handling volume arrays and core volume operations. * This module provides pure functions for volume array manipulation. * * Related modules: * - VolumeTexture.ts - Texture-related operations * - VolumeColormap.ts - Colormap operations * - VolumeModulation.ts - Modulation ope...
288fa2e50427026e7a655f0af6271fc4ed1c7965b9bb2ac2bbe9947f73366679
TypeScript
8,619
239
/** * @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...
4f4ed0428564a48947ef329cb81e65019858d47e3c649ba23b4ca69ca07ed443
TypeScript
8,628
296
// Copyright (C) 2020-2022 Intel Corporation // Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { PluginsActionTypes, PluginActions } from 'actions/plugins-actions'; import { PluginComponent, PluginsState } from '.'; const defaultState: PluginsState = { fetching: false, initialized...
5987ece224f99b1f78845cbcff8dd3600a85e720741999d6e33de3f7ea4d5a06
TypeScript
8,702
268
/** * @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...
01177b3c59457a48e28ab0e9e3b63331a68a7036a8a42ceacf2ea65cc14efcad
TypeScript
8,803
268
import { test, expect } from '@playwright/test' import { Niivue, Connectome, LegacyConnectome } 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('niivue load c...
ea47e298bcb064a6b9ccdac56b27f089f63fb900daaf67b5c91df3e09ad863a7
TypeScript
9,276
289
import * as cmaps from '@/cmaps' import { log } from '@/logger' export enum COLORMAP_TYPE { MIN_TO_MAX = 0, ZERO_TO_MAX_TRANSPARENT_BELOW_MIN = 1, ZERO_TO_MAX_TRANSLUCENT_BELOW_MIN = 2 } export type ColorMap = { R: number[] G: number[] B: number[] A: number[] I: number[] min?: num...
4ef2b22e3da6eeb65d409f91e725bc9ce72c7613b18d94bd550cd548c5c0b6b8
TypeScript
9,334
298
/** * Event controller helper functions for canvas interaction management. * This module provides pure functions for event handling and position calculations. * * Related to: Event registration, mouse position calculation, resize handling */ /** * Mouse position relative to an element */ export interface Relati...
c40ca1aa7a6a8f0e133de3b07e3ff56d8cef6770ec8982943721a4fdc78e83f1
TypeScript
9,337
294
/** * Clip plane manager helper functions for 3D clipping plane operations. * This module provides pure functions for clip plane calculations and management. * */ import { sph2cartDeg } from '../rendering/VolumeRenderer.js' /** * Default clip plane values when no clipping is active. * The depth value of 2 effec...
cdad843b669a79429ea0061615d4764965ba12da0bb7a1c6b4d44977389dd81a
TypeScript
9,524
239
import { UIKRenderer } from '../uikrenderer.js' import { UIKFont } from '../assets/uikfont.js' import { Vec4, Color } from '../types.js' export interface UIKViewModeSelectorOptions { bounds: Vec4 selectedMode: string modes: string[] font: UIKFont onModeChange: (mode: string) => void style?: { ...
b1e2aa5e47803bdd2d1489e9b4f47d481dfffd5a26766ee3843b50d6885a95e2
TypeScript
9,526
298
/** * Shape drawing tool pure functions for rectangle and ellipse drawing operations. * * This module provides pure functions for geometric shape drawing including * rectangles and ellipses (3D ellipsoids). * * Related modules: * - DrawingManager.ts - Drawing state management and undo/redo * - PenTool.ts - Pen ...
8d593ed5bd0f6631a6e3d1a2b3c20102abd292a45d4881d20ba30f555ef97a5e
TypeScript
9,592
276
import { test, expect } from '@playwright/test' import { Niivue, NVConfigOptions } from '../../dist/index.js' import { httpServerAddress } from './helpers.js' import { TEST_OPTIONS } from './test.types.js' type OptsChange = { property: keyof NVConfigOptions newValue: NVConfigOptions[keyof NVConfigOptions] ...
c9db1ce37a7d551e44fd251576b8535610f624a4439ef567a015f1b9d1c12f6b
TypeScript
9,683
280
/** * IntensityCalibration module * * Handles intensity calibration, windowing, and histogram analysis. * This module contains functions for: * - Calculating robust intensity range (2%..98% percentile) * - Converting between raw and calibrated intensity values */ import type { NVImage } from './index' import { ...
8cd2825d1b5243c38b4f42ddca70ac0d40e93b4ff47ab46965bb047ddaf6cfa6
TypeScript
9,698
324
/** * File loading and format detection utilities for Niivue. * This module provides pure functions for file extension handling, * format detection, custom loaders, and media URL management. */ import type { NVImage } from '@/nvimage' import type { NVMesh } from '@/nvmesh' import { log } from '@/logger' /** * DI...
ea66ddd1b49dba910647847dc85864e54be1d3f3b204014af03be3b914877b51
TypeScript
9,704
282
/** * @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...
2a73505328ae2657b0ca60f16e730384bc5ae5bd5451c1396465213dc8cdd728
TypeScript
9,740
326
import * as tf from '@tensorflow/tfjs' import { NVImage } from '@niivue/niivue' import { modelManager, ModelManager } from './ModelManager.js' import { inferenceEngine, InferenceEngine } from './InferenceEngine.js' import type { ModelInfo, SegmentationOptions, SegmentationResult, BrainchopServiceState } from '....
c2c704b39dc1b5691d4efb58c2fa83c57a9242e39b8c2dd6734688ced3f7ec5a
TypeScript
9,989
260
import { NIFTI1, NIFTIEXTENSION } from 'nifti-reader-js' import { mat4, vec3, vec4 } from 'gl-matrix' import { log } from '@/logger' import type { NVImage } from '@/nvimage' import { NiiDataType } from '@/nvimage/utils' import { NVUtilities } from '@/nvutilities' /** * Helper function to convert voxel location (row, ...
fbf495e669cf031701a355791352a6bf134d7954545dc067453fbd86161f3e08
TypeScript
10,261
291
// Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT import { AnalyticsEventsFilter, QualityConflictsFilter, QualityReportsFilter, QualitySettingsFilter, QualityRequirementsFilter, ConsensusSettingsFilter, ApiTokensFilter, } from './server-request-types'; import PluginRegistry from './plugin...
dc08841ce261092f77a7dcffc0e38ac6dd1b5fd0cea12f635d28723d77151110
TypeScript
10,312
382
import { JobProgressGroup, StateApiJobProgressByTaskName, StateApiNestedJobProgress, TaskProgress, } from "../../../type/job"; import { TypeTaskStatus, TypeTaskType } from "../../../type/task"; import { formatNestedJobProgressToJobProgressGroup, formatSummaryToTaskProgress, } from "./useJobProgress"; descr...
3e825b2f342d78bec4c5c8c6edc672a8959f7bb9d1e7c6f02b91ddc9bb7d55a2
TypeScript
10,384
339
import _ from "lodash"; import { useState } from "react"; import useSWR from "swr"; import { API_REFRESH_INTERVAL_MS } from "../../../common/constants"; import { sliceToPage } from "../../../common/util"; import { getStateApiJobProgressByLineage, getStateApiJobProgressByTaskName, } from "../../../service/job"; impo...
23c01cef5440e33f1142a58ef816295d9f4688b550845e2bbabf1b13d50ecd08
TypeScript
10,808
341
import { test, expect } from '@playwright/test' import { Niivue, LabelTextAlignment, LabelLineTerminator, LabelAnchorPoint } from '../../dist/index.js' import { httpServerAddress } from './helpers.js' import { TEST_OPTIONS } from './test.types.js' test.beforeEach(async ({ page }) => { // Uncomment for trouble shoo...