Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: history labelmap #1642

Open
wants to merge 59 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
c8c1dbf
Add dynamic sphere
wayfarer3130 Feb 27, 2024
d5dc6f7
fix: Performance issues on threshold sphere
wayfarer3130 Feb 27, 2024
3c17ab5
performance
wayfarer3130 Feb 27, 2024
dcda79b
feat: Create segmentation voxel manager in initial create of volume
wayfarer3130 Feb 28, 2024
967a90f
Faster fill for fixing features
wayfarer3130 Feb 28, 2024
4f0adb5
performance: Fix the performance of island removal
wayfarer3130 Feb 29, 2024
7b8622e
Merge remote-tracking branch 'origin/main' into feat/thresholdSphere
wayfarer3130 Feb 29, 2024
dde2f9f
fix restore of mixed islands
wayfarer3130 Feb 29, 2024
bb6bb3c
fix external island removal on non-acquisition
wayfarer3130 Feb 29, 2024
3171776
Performance and planar filling improvements
wayfarer3130 Mar 1, 2024
cabb532
Fix flood fill not being planar
wayfarer3130 Mar 1, 2024
bb5a536
Merge remote-tracking branch 'origin/main' into feat/thresholdSphere
wayfarer3130 Mar 6, 2024
d73fb5b
Remove invalid points in shape
wayfarer3130 Mar 6, 2024
14a57ba
Merge remote-tracking branch 'origin/main' into feat/thresholdSphere
wayfarer3130 Mar 7, 2024
d964693
feat: Add a labelmap statistics calculator (#2)
wayfarer3130 Mar 7, 2024
63c63dd
Merge remote-tracking branch 'origin/main' into feat/thresholdSphere
wayfarer3130 Mar 7, 2024
f9ca571
PR - comments added
wayfarer3130 Mar 8, 2024
633de82
Initial history memo api commit
wayfarer3130 Mar 11, 2024
c30cc91
feat(memo):Add functional zoom/pan undo/redo functionality
wayfarer3130 Mar 11, 2024
2d7f54d
PR review comments
wayfarer3130 Mar 12, 2024
8cad6d9
PR fixes - mostly cleanup
wayfarer3130 Mar 12, 2024
2f63718
Improvements to threshold out of plane
wayfarer3130 Mar 12, 2024
865a51c
test: Add better helper method for adding tools dropdown.
wayfarer3130 Mar 13, 2024
d9bfd45
PR fixes
wayfarer3130 Mar 13, 2024
9f9df1c
Add stack annotation example
wayfarer3130 Mar 13, 2024
553a819
Merge remote-tracking branch 'origin/feat/thresholdSphere' into feat/…
wayfarer3130 Mar 13, 2024
8867cf5
Add labelmap tools as well
wayfarer3130 Mar 13, 2024
d066eb0
Merge remote-tracking branch 'cs3d/test/helper-for-tools' into feat/h…
wayfarer3130 Mar 13, 2024
1029fe8
Add contour tools import as well.
wayfarer3130 Mar 14, 2024
62efd56
feat: Add undo for Length tool, plus example for undo
wayfarer3130 Mar 14, 2024
5f54f39
fix segmentation display
wayfarer3130 Mar 14, 2024
e33fedb
feat: dynamic threshold sphere
wayfarer3130 Mar 14, 2024
2448347
feat: History api for undo/redo (#5)
wayfarer3130 Mar 14, 2024
528481a
feat(labelmap): itk interpolation (#4)
wayfarer3130 Mar 14, 2024
4a5f11c
Merge remote-tracking branch 'origin/main' into feat/history-labelmap
wayfarer3130 Mar 14, 2024
1a7bb02
Merge fixes
wayfarer3130 Mar 14, 2024
d314ffe
Fix colour of interpolation
wayfarer3130 Mar 14, 2024
921195a
feat: Add labelmap history
wayfarer3130 Mar 15, 2024
1c13f9b
Add delete for testing
wayfarer3130 Mar 15, 2024
074ebd8
PR review comment fixes
wayfarer3130 Mar 15, 2024
bb7a2d4
Merge remote-tracking branch 'origin/main' into test/helper-for-tools
wayfarer3130 Mar 22, 2024
48faede
Merge remote-tracking branch 'cs3d/test/helper-for-tools' into feat/h…
wayfarer3130 Mar 22, 2024
7cc1cb0
Merge remote-tracking branch 'cs3d/main'
wayfarer3130 Mar 22, 2024
f27e61d
Merge remote-tracking branch 'origin/main' into feat/history-labelmap
wayfarer3130 Mar 22, 2024
e3b246e
Fix delete/undelete for annotations
wayfarer3130 Mar 22, 2024
6fa7c9f
feat: Add undo to all the tools
wayfarer3130 Mar 22, 2024
7eed562
fix: Bugs with history memo for eraser and key image tool
wayfarer3130 Mar 25, 2024
7293c12
Fix undo issues on closed contours
wayfarer3130 Mar 25, 2024
26eb76f
Fix contour undo/redo deleting hte contour fails to restore it
wayfarer3130 Mar 25, 2024
eb97463
api-check
wayfarer3130 Mar 25, 2024
608f120
First set of changes to fix labelmap memo
wayfarer3130 Mar 26, 2024
b1a56c5
feat: Add a common labelmap base tool that can create labelmap memos
wayfarer3130 Mar 26, 2024
ef140f9
Fix labelmap history
wayfarer3130 Mar 26, 2024
00b9d57
Fix the circle/sphere scissors undo to use the new design
wayfarer3130 Mar 26, 2024
66fccca
api-check
wayfarer3130 Mar 26, 2024
b00f97a
feat: Complete the labelmap history memo
wayfarer3130 Mar 27, 2024
25fc217
Merge remote-tracking branch 'cs3d/main'
wayfarer3130 Mar 27, 2024
a740262
Merge remote-tracking branch 'origin/main' into feat/history-labelmap
wayfarer3130 Mar 27, 2024
be126aa
PR review comments
wayfarer3130 Mar 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 141 additions & 5 deletions common/reviews/api/core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,9 @@ function decimate(list: Array<unknown>, interleave: number, offset?: number): nu
// @public (undocumented)
const deepMerge: (target?: {}, source?: {}, optionsArgument?: any) => any;

// @public (undocumented)
const DefaultHistoryMemo: HistoryMemo;

// @public (undocumented)
type DisplayArea = {
imageArea?: [number, number];
Expand Down Expand Up @@ -767,7 +770,8 @@ declare namespace Enums {
ViewportStatus,
VideoEnums,
MetadataModules,
ImageQualityStatus
ImageQualityStatus,
VoxelManagerEnum
}
}
export { Enums }
Expand Down Expand Up @@ -1096,6 +1100,30 @@ export function getWebWorkerManager(): any;
// @public (undocumented)
function hasNaNValues(input: number[] | number): boolean;

// @public (undocumented)
class HistoryMemo {
constructor(label?: string, size?: number);
// (undocumented)
readonly label: any;
// (undocumented)
push(item: Memo | Memoable): Memo;
// (undocumented)
redo(items?: number): void;
// (undocumented)
get size(): any;
// (undocumented)
undo(items?: number): void;
}

declare namespace HistoryMemo_2 {
export {
Memo,
Memoable,
HistoryMemo,
DefaultHistoryMemo
}
}

// @public (undocumented)
interface ICache {
// (undocumented)
Expand Down Expand Up @@ -1872,6 +1900,8 @@ export class ImageVolume implements IImageVolume {
// (undocumented)
readonly volumeId: string;
// (undocumented)
voxelManager?: VoxelManager<number> | VoxelManager<RGB>;
// (undocumented)
vtkOpenGLTexture: any;
}

Expand Down Expand Up @@ -1899,6 +1929,8 @@ interface ImageVolumeProps extends VolumeProps {
imageIds: Array<string>;
// (undocumented)
referencedImageIds?: Array<string>;
// (undocumented)
voxelManager?: VoxelManager<number> | VoxelManager<Point3>;
}

// @public (undocumented)
Expand Down Expand Up @@ -2401,6 +2433,17 @@ function makeVolumeMetadata(imageIds: Array<string>): Metadata;
// @public (undocumented)
type Mat3 = [number, number, number, number, number, number, number, number, number] | Float32Array;

// @public (undocumented)
type Memo = {
restoreMemo: (undo?: boolean) => void;
commitMemo?: () => boolean;
};

// @public (undocumented)
type Memoable = {
createMemo: () => Memo;
};

// @public (undocumented)
type Metadata = {
BitsAllocated: number;
Expand Down Expand Up @@ -2517,7 +2560,7 @@ function performCacheOptimizationForVolume(volume: any): void;
type PixelDataTypedArray = Float32Array | Int16Array | Uint16Array | Uint8Array | Int8Array | Uint8ClampedArray;

// @public (undocumented)
type PixelDataTypedArrayString = 'Float32Array' | 'Int16Array' | 'Uint16Array' | 'Uint8Array' | 'Int8Array' | 'Uint8ClampedArray';
type PixelDataTypedArrayString = 'Float32Array' | 'Int16Array' | 'Uint16Array' | 'Uint8Array' | 'Int8Array' | 'Uint8ClampedArray' | 'none';

declare namespace planar {
export {
Expand Down Expand Up @@ -2556,7 +2599,7 @@ class PointsManager<T> {
// (undocumented)
static create2(initialSize?: number): PointsManager<Point2>;
// (undocumented)
static create3(initialSize?: number): PointsManager<Point3>;
static create3(initialSize?: number, points?: Point3[]): PointsManager<Point3>;
// (undocumented)
data: Float32Array;
// (undocumented)
Expand All @@ -2574,6 +2617,8 @@ class PointsManager<T> {
// (undocumented)
getPointArray(index: number): T;
// (undocumented)
getTypedArray(): Float32Array;
// (undocumented)
protected grow(additionalSize?: number, growSize?: number): void;
// (undocumented)
growSize: number;
Expand Down Expand Up @@ -2845,6 +2890,77 @@ export interface RetrieveStage {
// @public (undocumented)
type RGB = [number, number, number];

// @public (undocumented)
class RLEVoxelMap<T> {
constructor(width: number, height: number, depth?: number);
// (undocumented)
clear(): void;
// (undocumented)
static copyMap<T>(destination: RLEVoxelMap<T>, source: RLEVoxelMap<T>): void;
// (undocumented)
defaultValue: T;
// (undocumented)
delete(index: number): void;
// (undocumented)
protected depth: number;
// (undocumented)
fillFrom(getter: (i: number, j: number, k: number) => T, boundsIJK: BoundsIJK): void;
// (undocumented)
findAdjacents(item: [RLERun<T>, number, number, Point3[]?], { diagonals, planar, singlePlane }: {
diagonals?: boolean;
planar?: boolean;
singlePlane?: boolean;
}): any[];
// (undocumented)
protected findIndex(row: RLERun<T>[], i: number): number;
// (undocumented)
floodFill(i: number, j: number, k: number, value: T, options?: {
planar?: boolean;
diagonals?: boolean;
singlePlane?: boolean;
}): number;
// (undocumented)
forEach(callback: any, options?: {
rowModified?: boolean;
}): void;
// (undocumented)
forEachRow(callback: any): void;
// (undocumented)
get: (index: number) => T;
// (undocumented)
getPixelData(k?: number, pixelData?: PixelDataTypedArray): PixelDataTypedArray;
// (undocumented)
protected getRLE(i: number, j: number, k?: number): RLERun<T>;
// (undocumented)
getRun: (j: number, k: number) => RLERun<T>[];
// (undocumented)
has(index: number): boolean;
// (undocumented)
protected height: number;
// (undocumented)
protected jMultiple: number;
// (undocumented)
keys(): number[];
// (undocumented)
protected kMultiple: number;
// (undocumented)
normalizer: PlaneNormalizer;
// (undocumented)
protected numComps: number;
// (undocumented)
pixelDataConstructor: Uint8ArrayConstructor;
// (undocumented)
protected rows: Map<number, RLERun<T>[]>;
// (undocumented)
set: (index: number, value: T) => void;
// (undocumented)
toIJK(index: number): Point3;
// (undocumented)
toIndex([i, j, k]: Point3): number;
// (undocumented)
protected width: number;
}

// @public (undocumented)
function roundNumber(value: string | number | (string | number)[], precision?: number): string;

Expand Down Expand Up @@ -3259,6 +3375,10 @@ declare namespace Types {
IImage,
IImageData,
IImageCalibration,
Memo,
HistoryMemo,
VoxelManager,
RLEVoxelMap,
CPUIImageData,
CPUImageData,
EventTypes,
Expand Down Expand Up @@ -3426,9 +3546,11 @@ declare namespace utilities {
isValidVolume,
metadataProvider_2 as genericMetadataProvider,
isVideoTransferSyntax,
HistoryMemo_2 as HistoryMemo,
generateVolumePropsFromImageIds,
getBufferConfiguration,
VoxelManager,
generateVolumePropsFromImageIds,
RLEVoxelMap,
convertStackToVolumeViewport,
convertVolumeToStackViewport,
cacheUtils,
Expand Down Expand Up @@ -4106,7 +4228,7 @@ class VoxelManager<T> {
// (undocumented)
boundsIJK: BoundsIJK;
// (undocumented)
clear(): void;
clear(clearScalar?: boolean): void;
// (undocumented)
static createHistoryVoxelManager<T>(sourceVoxelManager: VoxelManager<T>): VoxelManager<T>;
// (undocumented)
Expand All @@ -4118,6 +4240,8 @@ class VoxelManager<T> {
// (undocumented)
static createRGBVolumeVoxelManager(dimensions: Point3, scalarData: any, numComponents: any): VoxelManager<RGB>;
// (undocumented)
static createRLEHistoryVoxelManager<T>(sourceVoxelManager: VoxelManager<T>): VoxelManager<T>;
// (undocumented)
static createRLEVoxelManager<T>(dimensions: Point3): VoxelManager<T>;
// (undocumented)
static createVolumeVoxelManager(dimensions: Point3, scalarData: any, numComponents?: number): VoxelManager<number> | VoxelManager<RGB>;
Expand Down Expand Up @@ -4150,12 +4274,16 @@ class VoxelManager<T> {
// (undocumented)
map: Map<number, T> | RLEVoxelMap<T>;
// (undocumented)
mapForEach(callback: any, options?: any): void;
// (undocumented)
modifiedSlices: Set<number>;
// (undocumented)
numComps: number;
// (undocumented)
points: Set<number>;
// (undocumented)
rleForEach(callback: any, options?: any): void;
// (undocumented)
scalarData: PixelDataTypedArray;
// (undocumented)
_set: (index: number, v: T) => boolean | void;
Expand All @@ -4175,6 +4303,14 @@ class VoxelManager<T> {
width: number;
}

// @public (undocumented)
enum VoxelManagerEnum {
// (undocumented)
RLE = "RLE",
// (undocumented)
Volume = "Volume"
}

declare namespace windowLevel {
export {
toWindowLevel,
Expand Down
Loading