From 93f9752527a18b7e76e198fcdd53b933c674deab Mon Sep 17 00:00:00 2001 From: Evren Ozkan Date: Fri, 20 Oct 2017 17:57:21 -0400 Subject: [PATCH] PWV-57 Display timepoints in the order of viewports which is set by the hanging protocol by reversing the timepoints array if the first timepoint does not match with the first viewport data --- .../ohif-measurements/client/lib/jumpToRowItem.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Packages/ohif-measurements/client/lib/jumpToRowItem.js b/Packages/ohif-measurements/client/lib/jumpToRowItem.js index 790da273b..a715a68c1 100644 --- a/Packages/ohif-measurements/client/lib/jumpToRowItem.js +++ b/Packages/ohif-measurements/client/lib/jumpToRowItem.js @@ -104,16 +104,15 @@ OHIF.measurements.jumpToRowItem = (rowItem, timepoints) => { const $viewports = $('.imageViewerViewport'); const numViewports = Math.max($viewports.length, 0); - /* - Two Timepoints, Two measurements, load Followup (FU and BA), display FU in left and BA in right - Two Timepoints, One measurement (BA), on 2x1 view: Display BA in right - Two Timepoints, One measurement (FU), on 2x1 view: Display FU in left - - Two Timepoints, Two measurements, load Baseline (FU and BA) on 1x1 view: Display whichever is clicked on? - One Timepoint, One measurement: Display clicked on in 1x1 - */ const numViewportsToUpdate = Math.min(numTimepoints, numViewports); + // Display timepoints in the order of viewports which is set by the hanging protocol + // Reverse the timepoint array if the first timepoint does not match with the first viewport data + const layoutManager = OHIF.viewerbase.layoutManager; + if (timepoints[0].studyInstanceUids.indexOf(layoutManager.viewportData[0].studyInstanceUid) < 0) { + timepoints.reverse(); + } + for (var i=0; i < numViewportsToUpdate; i++) { const timepoint = timepoints[i]; const timepointId = timepoint.timepointId;