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) {
const wlToolConfig = toolGroupService.getToolConfiguration(
toolGroupIds.Fusion,
toolNames.WindowLevel
const ellipticalToolConfig = toolGroupService.getToolConfiguration(
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,
toolGroupService.setToolConfiguration(
toolNames.WindowLevel,
windowLevelConfig
toolNames.EllipticalROI,
ellipticalROIConfig