Skip to content

Commit

Permalink
feat: automatic segmentation using onnx to run local AI algorithms (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
wayfarer3130 authored Dec 3, 2024
1 parent f2996db commit 5b5856f
Show file tree
Hide file tree
Showing 40 changed files with 2,857 additions and 587 deletions.
5 changes: 5 additions & 0 deletions addOns/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# External Dependencies

This module contains optional and external dependencies for including in OHIF, such as the DICOM Microscopy Viewer component.


# External Components

This directory contains various external components. These can be fetched in various ways such as NPM dependencies or by fetching files externally.
Binary file modified bun.lockb
Binary file not shown.
184 changes: 184 additions & 0 deletions common/reviews/api/ai.api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
## API Report File for "@cornerstonejs/ai"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts

import type ColorTransferFunction from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction';
import { Corners } from '@kitware/vtk.js/Interaction/Widgets/OrientationMarkerWidget/Constants';
import type { IColorMapPreset } from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps';
import type { mat3 } from 'gl-matrix';
import { mat4 } from 'gl-matrix';
import { PixelDataTypedArray as PixelDataTypedArray_2 } from 'packages/core/dist/esm/types';
import type { Range as Range_2 } from '@kitware/vtk.js/types';
import { vec3 } from 'gl-matrix';
import type vtkActor from '@kitware/vtk.js/Rendering/Core/Actor';
import vtkAnnotatedCubeActor from '@kitware/vtk.js/Rendering/Core/AnnotatedCubeActor';
import type { vtkCamera } from '@kitware/vtk.js/Rendering/Core/Camera';
import { vtkColorTransferFunction } from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction';
import { vtkImageData } from '@kitware/vtk.js/Common/DataModel/ImageData';
import type vtkImageSlice from '@kitware/vtk.js/Rendering/Core/ImageSlice';
import type { vtkObject } from '@kitware/vtk.js/interfaces';
import type vtkOpenGLTexture from '@kitware/vtk.js/Rendering/OpenGL/Texture';
import type vtkPiecewiseFunction from '@kitware/vtk.js/Common/DataModel/PiecewiseFunction';
import vtkPlane from '@kitware/vtk.js/Common/DataModel/Plane';
import type vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData';
import type vtkRenderer from '@kitware/vtk.js/Rendering/Core/Renderer';
import type vtkVolume from '@kitware/vtk.js/Rendering/Core/Volume';

// @public (undocumented)
export class ONNXSegmentationController {
constructor(options?: {
listeners: any;
getPromptAnnotations: any;
promptAnnotationTypes: any;
models: any;
modelName: any;
previewToolType: string;
});
// (undocumented)
protected annotationModifiedListener: (_event?: any) => void;
// (undocumented)
protected annotationsNeedUpdating: boolean;
// (undocumented)
protected boxRadius: number;
// (undocumented)
cacheImageEncodings(current?: any, offset?: number, length?: number): any;
// (undocumented)
canvas: HTMLCanvasElement;
// (undocumented)
canvasMask: HTMLCanvasElement;
// (undocumented)
clear(viewport: any): void;
// (undocumented)
createLabelmap(mask: any, canvasPosition: any, _points: any, _labels: any): void;
// (undocumented)
protected currentImage: any;
// (undocumented)
decode(points: any, labels: any, useSession?: any): Promise<void>;
// (undocumented)
protected desiredImage: {
imageId: any;
sampleImageId: any;
imageIndex: number;
decoder: any;
encoder: any;
};
// (undocumented)
disconnectViewport(viewport: any): void;
// (undocumented)
protected excludeTool: string;
// (undocumented)
fetchAndCacheModel(url: any, name: any): Promise<ArrayBuffer>;
// (undocumented)
getConfig(modelName?: string): any;
// (undocumented)
getDirectoryForImageId(session: any, imageId: any): Promise<any>;
// (undocumented)
getFileNameForImageId(imageId: any, extension: any): any;
// (undocumented)
protected getPromptAnnotations: (viewport?: any) => cornerstoneTools.Types.Annotations;
// (undocumented)
protected handleImage({ imageId, sampleImageId }: {
imageId: any;
sampleImageId: any;
}, imageSession: any): Promise<void>;
// (undocumented)
protected imageEncodings: Map<any, any>;
// (undocumented)
protected imageImageData: any;
// (undocumented)
initModel(): Promise<unknown>;
// (undocumented)
initViewport(viewport: any): void;
// (undocumented)
interpolateScroll(viewport?: any, dir?: number): Promise<void>;
// (undocumented)
protected isGpuInUse: boolean;
// (undocumented)
protected load(): Promise<void>;
// (undocumented)
loadModels(models: any, imageSession?: any): Promise<void>;
// (undocumented)
loadStorageImageEncoding(session: any, imageId: any, index?: any): Promise<any>;
// (undocumented)
protected log(logger: Loggers, ...args: any[]): void;
// (undocumented)
mapAnnotationPoint(worldPoint: any): number[];
// (undocumented)
static MarkerExclude: string;
// (undocumented)
static MarkerInclude: string;
// (undocumented)
protected maskImageData: any;
// (undocumented)
maxHeight: number;
// (undocumented)
maxWidth: number;
// (undocumented)
modelHeight: number;
// (undocumented)
static MODELS: {
sam_l: ({
name: string;
url: string;
size: number;
key: string;
feedType: string;
} | {
name: string;
url: string;
size: number;
key: string;
feedType?: undefined;
})[];
sam_h: ({
name: string;
url: string;
size: number;
key: string;
feedType: string;
} | {
name: string;
url: string;
size: number;
key: string;
feedType?: undefined;
})[];
};
// (undocumented)
modelWidth: number;
// (undocumented)
protected previewToolType: string;
// (undocumented)
protected promptAnnotationTypes: string[];
// (undocumented)
restoreImageEncoding(session: any, imageId: any): Promise<any>;
// (undocumented)
protected runDecode(): Promise<void>;
// (undocumented)
protected sharedImageEncoding: any;
// (undocumented)
storeImageEncoding(session: any, imageId: any, data: any): Promise<void>;
// (undocumented)
protected tool: any;
// (undocumented)
tryLoad(options?: {
resetImage: boolean;
}): void;
// (undocumented)
updateAnnotations(): void;
// (undocumented)
protected viewport: any;
// (undocumented)
static viewportOptions: {
displayArea: Types.DisplayArea;
background: Types.Point3;
};
// (undocumented)
protected viewportRenderedListener: (_event: any) => void;
}

// (No @packageDocumentation comment for this package)

```
2 changes: 1 addition & 1 deletion common/reviews/api/core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4751,7 +4751,7 @@ export class VolumeViewport extends BaseVolumeViewport {
// (undocumented)
getCurrentImageId: () => string | undefined;
// (undocumented)
getCurrentImageIdIndex: (volumeId?: string) => number;
getCurrentImageIdIndex: (volumeId?: string, useSlabThickness?: boolean) => number;
// (undocumented)
getCurrentSlicePixelData(): PixelDataTypedArray;
// (undocumented)
Expand Down
Loading

0 comments on commit 5b5856f

Please sign in to comment.