2022-07-27 16:39:04 +00:00
|
|
|
import { toolGroupIds } from '../initToolGroups';
|
|
|
|
|
|
2022-08-17 15:13:59 -04:00
|
|
|
export default function setFusionActiveVolume(
|
2022-07-27 16:39:04 +00:00
|
|
|
matches,
|
|
|
|
|
toolNames,
|
2023-02-10 16:46:09 -05:00
|
|
|
toolGroupService,
|
|
|
|
|
displaySetService
|
2022-07-27 16:39:04 +00:00
|
|
|
) {
|
|
|
|
|
const matchDetails = matches.get('ptDisplaySet');
|
|
|
|
|
|
|
|
|
|
if (!matchDetails) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const { SeriesInstanceUID } = matchDetails;
|
|
|
|
|
|
2023-09-01 16:19:39 -04:00
|
|
|
const displaySets = displaySetService.getDisplaySetsForSeries(SeriesInstanceUID);
|
2022-07-27 16:39:04 +00:00
|
|
|
|
|
|
|
|
if (!displaySets || displaySets.length === 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-10 16:46:09 -05:00
|
|
|
const wlToolConfig = toolGroupService.getToolConfiguration(
|
2022-08-17 15:13:59 -04:00
|
|
|
toolGroupIds.Fusion,
|
|
|
|
|
toolNames.WindowLevel
|
|
|
|
|
);
|
|
|
|
|
|
2023-02-10 16:46:09 -05:00
|
|
|
const ellipticalToolConfig = toolGroupService.getToolConfiguration(
|
2022-07-27 16:39:04 +00:00
|
|
|
toolGroupIds.Fusion,
|
|
|
|
|
toolNames.EllipticalROI
|
|
|
|
|
);
|
|
|
|
|
|
2022-12-05 09:53:59 -05:00
|
|
|
// Todo: this should not take into account the loader id
|
|
|
|
|
const volumeId = `cornerstoneStreamingImageVolume:${displaySets[0].displaySetInstanceUID}`;
|
|
|
|
|
|
2022-08-17 15:13:59 -04:00
|
|
|
const windowLevelConfig = {
|
|
|
|
|
...wlToolConfig,
|
2022-12-05 09:53:59 -05:00
|
|
|
volumeId,
|
2022-08-17 15:13:59 -04:00
|
|
|
};
|
|
|
|
|
|
2022-07-27 16:39:04 +00:00
|
|
|
const ellipticalROIConfig = {
|
2022-08-17 15:13:59 -04:00
|
|
|
...ellipticalToolConfig,
|
2022-12-05 09:53:59 -05:00
|
|
|
volumeId,
|
2022-07-27 16:39:04 +00:00
|
|
|
};
|
|
|
|
|
|
2023-02-10 16:46:09 -05:00
|
|
|
toolGroupService.setToolConfiguration(
|
2022-08-17 15:13:59 -04:00
|
|
|
toolGroupIds.Fusion,
|
|
|
|
|
toolNames.WindowLevel,
|
|
|
|
|
windowLevelConfig
|
|
|
|
|
);
|
|
|
|
|
|
2023-02-10 16:46:09 -05:00
|
|
|
toolGroupService.setToolConfiguration(
|
2022-07-27 16:39:04 +00:00
|
|
|
toolGroupIds.Fusion,
|
|
|
|
|
toolNames.EllipticalROI,
|
|
|
|
|
ellipticalROIConfig
|
|
|
|
|
);
|
|
|
|
|
}
|