feat(RT): add dicom RT support via volume viewports (#3310)

* feat: initial RT support

* make the segmentation service work with representation data

* feat: make segmentation service work with representations

* fix rtss vis

* fix: rt hydration

* fix the rendering of rt names

* fix imports

* refactor: Modify status and click handling for hydration of RTStructures

Modify status and click handling for hydration of RTStructures by renaming `onPillClick` to `onStatusClick` in `OHIFCornerstoneRTViewport.tsx` and `_getStatusComponent.tsx` files. Also, update initial segmentation configurations in `PanelSegmentation.tsx` and simplify configuration changes and values for segmentation service in `SegmentationService.ts`. Finally, remove console debug in `CornerstoneViewportService.ts`.

* wip for highlighting contours

* refactor rt displayset code

* review code update

* update cornerstone dependencies

* refactor: Update license year, version number, and minor code cleanup

This commit updates the license year in several files, updates the version number in package.json, and contains minor code cleanup in two files.

* add bulkdataURI retrieve for RT

* fix package version

* apply review comments

* apply review comments

* apply review comments

* feat(panels): refactor and streamline segmentation configuration and inputs

Rewrote state hooks and streamlined the configuration input for `PanelSegmentation` to be more verbose and reusable. Included several new input types, including the `InputRange` component which now shows a fixed floating value based on the step provided. The `SegmentationConfig` component now works with dynamic values controlled by `initialConfig`. These changes should improve function usability and make the code more maintainable going forward.

* fix various bugs

* fix contour delete by upgrade cs3d version

* feat(viewport, inputNumber, segmentationConfig, orthanc): Implement minimum and maximum values for input number components, and useBulkDataURI for Orthanc configuration. Compare measurement view planes with absolute viewport view planes in Cornerstone viewport.

* update yarn lock
This commit is contained in:
Alireza authored and GitHub committed 2023-04-26 12:21:08 -04:00
1 parent 69d8e6a191
commit 66863281c4
60 files changed
+2488 -678

No files matched your search

@@ -1,7 +1,16 @@
import guid from '../utils/guid.js';
import { Vector3 } from 'cornerstone-math';
const OBJECT = 'object';
type Attributes = Record<string, unknown>;
type Image = {
StudyInstanceUID?: string;
getData(): {
metadata: {
ImagePositionPatient: number[];
ImageOrientationPatient: number[];
};
};
};
/**
* This class defines an ImageSet object which will be used across the viewer. This object represents
@@ -10,8 +19,14 @@ const OBJECT = 'object';
* indiscriminately, but this should be changed).
*/
class ImageSet {
constructor(images) {
if (Array.isArray(images) !== true) {
images: Image[];
uid: string;
instances: Image[];
instance?: Image;
StudyInstanceUID?: string;
constructor(images: Image[]) {
if (!Array.isArray(images)) {
throw new Error('ImageSet expects an array of images');
}
@@ -36,41 +51,39 @@ class ImageSet {
this.StudyInstanceUID = this.instance?.StudyInstanceUID;
}
getUID() {
load: () => Promise<void>;
getUID(): string {
return this.uid;
}
setAttribute(attribute, value) {
setAttribute(attribute: string, value: unknown): void {
this[attribute] = value;
}
getAttribute(attribute) {
getAttribute(attribute: string): unknown {
return this[attribute];
}
setAttributes(attributes) {
if (typeof attributes === OBJECT && attributes !== null) {
const imageSet = this,
hasOwn = Object.prototype.hasOwnProperty;
for (let attribute in attributes) {
if (hasOwn.call(attributes, attribute)) {
imageSet[attribute] = attributes[attribute];
}
setAttributes(attributes: Attributes): void {
if (typeof attributes === 'object' && attributes !== null) {
for (const [attribute, value] of Object.entries(attributes)) {
this[attribute] = value;
}
}
}
getNumImages = () => this.images.length;
getNumImages = (): number => this.images.length;
getImage(index) {
getImage(index: number): Image {
return this.images[index];
}
sortBy(sortingCallback) {
sortBy(sortingCallback: (a: Image, b: Image) => number): Image[] {
return this.images.sort(sortingCallback);
}
sortByImagePositionPatient() {
sortByImagePositionPatient(): void {
const images = this.images;
const referenceImagePositionPatient = _getImagePositionPatient(images[0]);
@@ -94,7 +107,7 @@ class ImageSet {
)
);
const distanceImagePairs = images.map(function(image) {
const distanceImagePairs = images.map(function(image: Image) {
const ippVec = new Vector3(..._getImagePositionPatient(image));
const positionVector = refIppVec.clone().sub(ippVec);
const distance = positionVector.dot(scanAxisNormal);
@@ -41,6 +41,7 @@ export interface Extension {
getCommandsModule?: (p: ExtensionParams) => CommandsModule;
getViewportModule?: (p: ExtensionParams) => unknown;
getUtilityModule?: (p: ExtensionParams) => unknown;
getCustomizationModule?: (p: ExtensionParams) => unknown;
onModeEnter?: () => void;
onModeExit?: () => void;
}
+4
View File
@@ -0,0 +1,4 @@
/**
* RGB color type
*/
export type RGB = [number, number, number];
+1
View File
@@ -12,6 +12,7 @@ export * from './Command';
export * from './StudyMetadata';
export * from './PanelModule';
export * from './IPubSub';
export * from './Color';
/**
* Export the types used within the various services and managers, but