Skip to content

Commit

Permalink
fix(voi): stack viewport should prioritize image metadata for windowl…
Browse files Browse the repository at this point in the history
…evel and not persist (#454)

* new voi setup

* set voi range locked

* fix tests

* fix the event firing

* fix coming back and forth bw voi lut functions

* fix build and tests

* rework the rendering pipelines

* fix window level number and number array def

* fix tests
  • Loading branch information
sedghi authored Mar 6, 2023
1 parent 703ce92 commit 420c812
Show file tree
Hide file tree
Showing 23 changed files with 531 additions and 459 deletions.
30 changes: 16 additions & 14 deletions common/reviews/api/core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2012,9 +2012,9 @@ type StackNewImageEventDetail = {
export class StackViewport extends Viewport implements IStackViewport {
constructor(props: ViewportInput);
// (undocumented)
addActor(actorEntry: ActorEntry): void;
addActor: (actorEntry: ActorEntry) => void;
// (undocumented)
addActors(actors: Array<ActorEntry>): void;
addActors: (actors: Array<ActorEntry>) => void;
// (undocumented)
calibrateSpacing(imageId: string): void;
// (undocumented)
Expand All @@ -2027,27 +2027,27 @@ export class StackViewport extends Viewport implements IStackViewport {
renderingEngineId: string;
};
// (undocumented)
getActor(actorUID: string): ActorEntry;
getActor: (actorUID: string) => ActorEntry;
// (undocumented)
getActors(): Array<ActorEntry>;
getActors: () => Array<ActorEntry>;
// (undocumented)
getCamera(): ICamera;
getCamera: () => ICamera;
// (undocumented)
getCurrentImageId: () => string;
// (undocumented)
getCurrentImageIdIndex: () => number;
// (undocumented)
getDefaultActor(): ActorEntry;
getDefaultActor: () => ActorEntry;
// (undocumented)
getFrameOfReferenceUID: () => string | undefined;
// (undocumented)
getImageData(): IImageData | CPUIImageData;
getImageData: () => IImageData | CPUIImageData;
// (undocumented)
getImageIds: () => Array<string>;
// (undocumented)
getProperties: () => StackViewportProperties;
// (undocumented)
getRenderer(): any;
getRenderer: () => any;
// (undocumented)
getRotation: () => number;
// (undocumented)
Expand All @@ -2059,9 +2059,9 @@ export class StackViewport extends Viewport implements IStackViewport {
// (undocumented)
modality: string;
// (undocumented)
removeAllActors(): void;
removeAllActors: () => void;
// (undocumented)
resetCamera(resetPan?: boolean, resetZoom?: boolean): boolean;
resetCamera: (resetPan?: boolean, resetZoom?: boolean) => boolean;
// (undocumented)
resetProperties(): void;
// (undocumented)
Expand All @@ -2071,19 +2071,21 @@ export class StackViewport extends Viewport implements IStackViewport {
// (undocumented)
scroll(delta: number, debounce?: boolean, loop?: boolean): void;
// (undocumented)
setActors(actors: Array<ActorEntry>): void;
setActors: (actors: Array<ActorEntry>) => void;
// (undocumented)
setCamera(cameraInterface: ICamera, storeAsInitialCamera?: boolean): void;
setCamera: (cameraInterface: ICamera, storeAsInitialCamera?: boolean) => void;
// (undocumented)
setColormap(colormap: CPUFallbackColormapData): void;
setColormap: (colormap: CPUFallbackColormapData) => void;
// (undocumented)
setImageIdIndex(imageIdIndex: number): Promise<string>;
// (undocumented)
setProperties({ voiRange, VOILUTFunction, invert, interpolationType, rotation, }?: StackViewportProperties, suppressEvents?: boolean): void;
// (undocumented)
setStack(imageIds: Array<string>, currentImageIdIndex?: number): Promise<string>;
// (undocumented)
unsetColormap(): void;
setUseCPURendering(value: boolean): void;
// (undocumented)
unsetColormap: () => void;
// (undocumented)
static get useCustomRenderingPipeline(): boolean;
// (undocumented)
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/RenderingEngine/BaseVolumeViewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import {
triggerEvent,
createSigmoidRGBTransferFunction,
getVoiFromSigmoidRGBTransferFunction,
createLinearRGBTransferFunction,
} from '../utilities';
import type { vtkSlabCamera as vtkSlabCameraType } from './vtkClasses/vtkSlabCamera';
import { VoiModifiedEventDetail } from '../types/EventTypes';
Expand Down Expand Up @@ -241,7 +240,7 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
// const cfun = createLinearRGBTransferFunction(voiRangeToUse);
// volumeActor.getProperty().setRGBTransferFunction(0, cfun);

// Moving from LINEAR to SIGMOID and back to LINEAR will not
// Todo: Moving from LINEAR to SIGMOID and back to LINEAR will not
// work until we implement it in a different way because the
// LINEAR transfer function is not recreated.
const { lower, upper } = voiRangeToUse;
Expand Down
Loading

0 comments on commit 420c812

Please sign in to comment.