feat(toolbar): new Toolbar to enable reactive state synchronization (#3983)
This commit is contained in:
1 parent
79d5c36bda
commit
566b25a544
155 files changed
+6311
-6577
No files matched your search
@@ -109,23 +109,6 @@ export default function PanelPetSUV({ servicesManager, commandsManager }) {
|
||||
throw new Error('No ptDisplaySet found');
|
||||
}
|
||||
|
||||
const toolGroupIds = toolGroupService.getToolGroupIds();
|
||||
|
||||
// Todo: we don't have a proper way to perform a toggle command and update the
|
||||
// state for the toolbar, so here, we manually toggle the toolbar
|
||||
|
||||
// Todo: Crosshairs have bugs for the camera reset currently, so we need to
|
||||
// force turn it off before we update the metadata
|
||||
toolGroupIds.forEach(toolGroupId => {
|
||||
commandsManager.runCommand('toggleCrosshairs', {
|
||||
toolGroupId,
|
||||
toggledState: false,
|
||||
});
|
||||
});
|
||||
|
||||
toolbarService.state.toggles['Crosshairs'] = false;
|
||||
toolbarService._broadcastEvent(toolbarService.EVENTS.TOOL_BAR_STATE_MODIFIED);
|
||||
|
||||
// metadata should be dcmjs naturalized
|
||||
DicomMetadataStore.updateMetadataForSeries(
|
||||
ptDisplaySet.StudyInstanceUID,
|
||||
@@ -135,6 +118,12 @@ export default function PanelPetSUV({ servicesManager, commandsManager }) {
|
||||
|
||||
// update the displaySets
|
||||
displaySetService.setDisplaySetMetadataInvalidated(ptDisplaySet.displaySetInstanceUID);
|
||||
|
||||
// Crosshair position depends on the metadata values such as the positioning interaction
|
||||
// between series, so when the metadata is updated, the crosshairs need to be reset.
|
||||
setTimeout(() => {
|
||||
commandsManager.runCommand('resetCrosshairs');
|
||||
}, 0);
|
||||
}
|
||||
return (
|
||||
<div className="invisible-scrollbar overflow-y-auto overflow-x-hidden">
|
||||
|
||||
@@ -530,83 +530,51 @@ const commandsModule = ({ servicesManager, commandsManager, extensionManager })
|
||||
const definitions = {
|
||||
setEndSliceForROIThresholdTool: {
|
||||
commandFn: actions.setEndSliceForROIThresholdTool,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
setStartSliceForROIThresholdTool: {
|
||||
commandFn: actions.setStartSliceForROIThresholdTool,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
getMatchingPTDisplaySet: {
|
||||
commandFn: actions.getMatchingPTDisplaySet,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
getPTMetadata: {
|
||||
commandFn: actions.getPTMetadata,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
createNewLabelmapFromPT: {
|
||||
commandFn: actions.createNewLabelmapFromPT,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
setSegmentationActiveForToolGroups: {
|
||||
commandFn: actions.setSegmentationActiveForToolGroups,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
thresholdSegmentationByRectangleROITool: {
|
||||
commandFn: actions.thresholdSegmentationByRectangleROITool,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
getTotalLesionGlycolysis: {
|
||||
commandFn: actions.getTotalLesionGlycolysis,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
calculateSuvPeak: {
|
||||
commandFn: actions.calculateSuvPeak,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
getLesionStats: {
|
||||
commandFn: actions.getLesionStats,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
calculateTMTV: {
|
||||
commandFn: actions.calculateTMTV,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
exportTMTVReportCSV: {
|
||||
commandFn: actions.exportTMTVReportCSV,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
createTMTVRTReport: {
|
||||
commandFn: actions.createTMTVRTReport,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
getSegmentationCSVReport: {
|
||||
commandFn: actions.getSegmentationCSVReport,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
exportRTReportForAnnotations: {
|
||||
commandFn: actions.exportRTReportForAnnotations,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
setFusionPTColormap: {
|
||||
commandFn: actions.setFusionPTColormap,
|
||||
storeContexts: [],
|
||||
options: {},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ const CORNERSTONE_3D_TOOLS_SOURCE_VERSION = '0.1';
|
||||
* @param {Object} configuration
|
||||
* @param {Object|Array} configuration.csToolsConfig
|
||||
*/
|
||||
export default function init({ servicesManager, extensionManager }) {
|
||||
export default function init({ servicesManager }) {
|
||||
const { measurementService, displaySetService, cornerstoneViewportService } =
|
||||
servicesManager.services;
|
||||
|
||||
@@ -38,6 +38,5 @@ export default function init({ servicesManager, extensionManager }) {
|
||||
RectangleROIStartEndThreshold.toAnnotation,
|
||||
RectangleROIStartEndThreshold.toMeasurement
|
||||
);
|
||||
|
||||
colormaps.forEach(registerColormap);
|
||||
}
|
||||
Reference in new issue
Block a user