feat(grid): remove viewportIndex and only rely on viewportId (#3591)
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
This commit is contained in:
1 parent
5dafac7c92
commit
4c6ff873e8
83 files changed
+1309
-1123
No files matched your search
@@ -36,8 +36,8 @@ const commandsModule = ({
|
||||
const { getEnabledElement } = utilityModule.exports;
|
||||
|
||||
function _getActiveViewportsEnabledElement() {
|
||||
const { activeViewportIndex } = viewportGridService.getState();
|
||||
const { element } = getEnabledElement(activeViewportIndex) || {};
|
||||
const { activeViewportId } = viewportGridService.getState();
|
||||
const { element } = getEnabledElement(activeViewportId) || {};
|
||||
const enabledElement = cs.getEnabledElement(element);
|
||||
return enabledElement;
|
||||
}
|
||||
@@ -45,8 +45,8 @@ const commandsModule = ({
|
||||
function _getMatchedViewportsToolGroupIds() {
|
||||
const { viewportMatchDetails } = hangingProtocolService.getMatchDetails();
|
||||
const toolGroupIds = [];
|
||||
viewportMatchDetails.forEach((value, key) => {
|
||||
const { viewportOptions } = value;
|
||||
viewportMatchDetails.forEach(viewport => {
|
||||
const { viewportOptions } = viewport;
|
||||
const { toolGroupId } = viewportOptions;
|
||||
if (toolGroupIds.indexOf(toolGroupId) === -1) {
|
||||
toolGroupIds.push(toolGroupId);
|
||||
@@ -64,7 +64,7 @@ const commandsModule = ({
|
||||
// corrected PT vs the non-attenuation correct PT)
|
||||
|
||||
let ptDisplaySet = null;
|
||||
for (const [viewportIndex, viewportDetails] of viewportMatchDetails) {
|
||||
for (const [viewportId, viewportDetails] of viewportMatchDetails) {
|
||||
const { displaySetsInfo } = viewportDetails;
|
||||
const displaySets = displaySetsInfo.map(({ displaySetInstanceUID }) =>
|
||||
displaySetService.getDisplaySetByUID(displaySetInstanceUID)
|
||||
@@ -137,7 +137,6 @@ const commandsModule = ({
|
||||
|
||||
// Add Segmentation to all toolGroupIds in the viewer
|
||||
const toolGroupIds = _getMatchedViewportsToolGroupIds();
|
||||
|
||||
const representationType = LABELMAP;
|
||||
|
||||
for (const toolGroupId of toolGroupIds) {
|
||||
@@ -545,13 +544,8 @@ const commandsModule = ({
|
||||
|
||||
let viewports = [];
|
||||
fusionViewportIds.forEach(viewportId => {
|
||||
const viewportInfo = cornerstoneViewportService.getViewportInfo(
|
||||
viewportId
|
||||
);
|
||||
|
||||
const viewportIndex = viewportInfo.getViewportIndex();
|
||||
commandsManager.runCommand('setViewportColormap', {
|
||||
viewportIndex,
|
||||
viewportId,
|
||||
displaySetInstanceUID: ptDisplaySet.displaySetInstanceUID,
|
||||
colormap: {
|
||||
name: colormap,
|
||||
|
||||
@@ -114,6 +114,9 @@ const ptAXIAL = {
|
||||
id: 'ptFusionWLSync',
|
||||
source: true,
|
||||
target: false,
|
||||
options: {
|
||||
syncInvertState: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -155,6 +158,9 @@ const ptSAGITTAL = {
|
||||
id: 'ptFusionWLSync',
|
||||
source: true,
|
||||
target: false,
|
||||
options: {
|
||||
syncInvertState: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -196,6 +202,9 @@ const ptCORONAL = {
|
||||
id: 'ptFusionWLSync',
|
||||
source: true,
|
||||
target: false,
|
||||
options: {
|
||||
syncInvertState: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -246,6 +255,9 @@ const fusionAXIAL = {
|
||||
id: 'ptFusionWLSync',
|
||||
source: false,
|
||||
target: true,
|
||||
options: {
|
||||
syncInvertState: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -306,6 +318,9 @@ const fusionSAGITTAL = {
|
||||
id: 'ptFusionWLSync',
|
||||
source: false,
|
||||
target: true,
|
||||
options: {
|
||||
syncInvertState: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -366,6 +381,9 @@ const fusionCORONAL = {
|
||||
id: 'ptFusionWLSync',
|
||||
source: false,
|
||||
target: true,
|
||||
options: {
|
||||
syncInvertState: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -411,6 +429,9 @@ const mipSAGITTAL = {
|
||||
id: 'ptFusionWLSync',
|
||||
source: true,
|
||||
target: false,
|
||||
options: {
|
||||
syncInvertState: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
|
||||
Reference in new issue
Block a user