feat(layout): new layout selector with 3D volume rendering (#3923)

This commit is contained in:
Ibrahim authored and GitHub committed 2024-03-28 10:40:32 -04:00
1 parent 6f610b09e1
commit 617043fe0d
51 files changed
+829 -239

No files matched your search

@@ -420,6 +420,34 @@ export default class ToolbarService extends PubSubService {
return;
}
if (Array.isArray(evaluate)) {
const evaluators = evaluate.map(evaluatorName => {
const evaluateFunction = this._evaluateFunction[evaluatorName];
if (!evaluateFunction) {
throw new Error(
`Evaluate function not found for name: ${evaluatorName}, you can register an evaluate function with the getToolbarModule in your extensions`
);
}
return evaluateFunction;
});
props.evaluate = args => {
const results = evaluators.map(evaluator => evaluator(args));
const mergedResult = results.reduce((acc, result) => {
return {
...acc,
...result,
};
}, {});
return mergedResult;
};
return;
}
if (typeof evaluate === 'string') {
const evaluateFunction = this._evaluateFunction[evaluate];
@@ -429,7 +457,7 @@ export default class ToolbarService extends PubSubService {
}
throw new Error(
`Evaluate function not found for name: ${evaluate}, you can register an evaluate function with the getToolbarModule in your extensions`
`Evaluate function not found for name: ${evaluate}, you can register an evaluate function with the getToolbarModule in your extensions`
);
}
@@ -443,7 +471,7 @@ export default class ToolbarService extends PubSubService {
}
throw new Error(
`Evaluate function not found for name: ${name}, you can register an evaluate function with the getToolbarModule in your extensions`
`Evaluate function not found for name: ${name}, you can register an evaluate function with the getToolbarModule in your extensions`
);
}
};
@@ -1,6 +1,6 @@
import type { RunCommand } from '../../types/Command';
export type EvaluatePublic = string | EvaluateFunction;
export type EvaluatePublic = string | EvaluateFunction | string[];
export type EvaluateFunction = (props: Record<string, unknown>) => {
disabled: boolean;
@@ -304,6 +304,16 @@ export type Protocol = {
*/
minSeriesLoaded: number;
};
/*
* The icon to use for this protocol. This is used to display the protocol
* in the advanced layout selector.
*/
icon?: string;
/** Indicates if the protocol is a preset or not. Useful for setting presets for the layout selector */
isPreset?: true;
};
/** Used to dynamically generate protocols.