* fix: Rename services to lower camel case, hp, measure * fix: Rename DisplaySetService instances to displaySetService * fix: Rename CornerstoneViewportService to lower camel case * fix: Added lower case segmentationService rename * rename other services (#3166) * rename uiDialogService * rename toolGroupService * rename uiNotificationService * rename viewportGridService * rename syncGroupService * rename CornerstoneCacheService * Fix a syntax error in hotkeys * Fix a couple of rename issues that were missed --------- Co-authored-by: Alireza <ar.sedghi@gmail.com>
60 lines
1.2 KiB
JavaScript
60 lines
1.2 KiB
JavaScript
import { toolGroupIds } from '../initToolGroups';
|
|
|
|
export default function setFusionActiveVolume(
|
|
matches,
|
|
toolNames,
|
|
toolGroupService,
|
|
displaySetService
|
|
) {
|
|
const matchDetails = matches.get('ptDisplaySet');
|
|
|
|
if (!matchDetails) {
|
|
return;
|
|
}
|
|
|
|
const { SeriesInstanceUID } = matchDetails;
|
|
|
|
const displaySets = displaySetService.getDisplaySetsForSeries(
|
|
SeriesInstanceUID
|
|
);
|
|
|
|
if (!displaySets || displaySets.length === 0) {
|
|
return;
|
|
}
|
|
|
|
const wlToolConfig = toolGroupService.getToolConfiguration(
|
|
toolGroupIds.Fusion,
|
|
toolNames.WindowLevel
|
|
);
|
|
|
|
const ellipticalToolConfig = toolGroupService.getToolConfiguration(
|
|
toolGroupIds.Fusion,
|
|
toolNames.EllipticalROI
|
|
);
|
|
|
|
// Todo: this should not take into account the loader id
|
|
const volumeId = `cornerstoneStreamingImageVolume:${displaySets[0].displaySetInstanceUID}`;
|
|
|
|
const windowLevelConfig = {
|
|
...wlToolConfig,
|
|
volumeId,
|
|
};
|
|
|
|
const ellipticalROIConfig = {
|
|
...ellipticalToolConfig,
|
|
volumeId,
|
|
};
|
|
|
|
toolGroupService.setToolConfiguration(
|
|
toolGroupIds.Fusion,
|
|
toolNames.WindowLevel,
|
|
windowLevelConfig
|
|
);
|
|
|
|
toolGroupService.setToolConfiguration(
|
|
toolGroupIds.Fusion,
|
|
toolNames.EllipticalROI,
|
|
ellipticalROIConfig
|
|
);
|
|
}
|