LT-275: Retrieving timepoint associations properly from backend
This commit is contained in:
parent
2d291251e9
commit
60b72683d5
@ -63,7 +63,13 @@ Template.viewer.onCreated(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
instance.data.timepointApi = new OHIF.measurements.TimepointApi(instance.data.currentTimepointId);
|
instance.data.timepointApi = new OHIF.measurements.TimepointApi(instance.data.currentTimepointId);
|
||||||
const timepointsPromise = instance.data.timepointApi.retrieveTimepoints();
|
|
||||||
|
const patientId = instance.data.studies[0].patientId;
|
||||||
|
const filter = {
|
||||||
|
'patientId': patientId
|
||||||
|
};
|
||||||
|
|
||||||
|
const timepointsPromise = instance.data.timepointApi.retrieveTimepoints(filter);
|
||||||
timepointsPromise.then(() => {
|
timepointsPromise.then(() => {
|
||||||
const timepoints = instance.data.timepointApi.all();
|
const timepoints = instance.data.timepointApi.all();
|
||||||
|
|
||||||
@ -85,7 +91,7 @@ Template.viewer.onCreated(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
instance.data.measurementApi = new OHIF.measurements.MeasurementApi(instance.data.currentTimepointId);
|
instance.data.measurementApi = new OHIF.measurements.MeasurementApi(instance.data.currentTimepointId);
|
||||||
const measurementsPromise = instance.data.measurementApi.retrieveMeasurements();
|
const measurementsPromise = instance.data.measurementApi.retrieveMeasurements(filter);
|
||||||
measurementsPromise.then(() => {
|
measurementsPromise.then(() => {
|
||||||
Session.set('MeasurementsReady', true);
|
Session.set('MeasurementsReady', true);
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
@import "{design}/app"
|
@import "{design}/app"
|
||||||
|
|
||||||
$height = 25px
|
$height = 25px
|
||||||
$textColorButtonActive = #2D2D2D
|
|
||||||
|
|
||||||
.roundedButtonGroup
|
.roundedButtonGroup
|
||||||
|
|
||||||
@ -64,7 +63,7 @@ $textColorButtonActive = #2D2D2D
|
|||||||
&.active .roundedButton
|
&.active .roundedButton
|
||||||
theme('background-color', '$activeColor')
|
theme('background-color', '$activeColor')
|
||||||
theme('border-color', '$uiBorderColorActive')
|
theme('border-color', '$uiBorderColorActive')
|
||||||
color: $textColorButtonActive
|
theme('color', '$uiGrayDark')
|
||||||
|
|
||||||
&:hover .roundedButton
|
&:hover .roundedButton
|
||||||
&.active .roundedButton
|
&.active .roundedButton
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import { measurementTools } from './measurementTools';
|
import { measurementTools } from './measurementTools';
|
||||||
|
|
||||||
export const retrieveMeasurements = () => {
|
export const retrieveMeasurements = (filter) => {
|
||||||
console.log('retrieveMeasurements');
|
console.log('retrieveMeasurements');
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
Meteor.call('retrieveMeasurements', (error, response) => {
|
Meteor.call('retrieveMeasurements', filter, (error, response) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
reject(error);
|
reject(error);
|
||||||
} else {
|
} else {
|
||||||
@ -36,11 +36,11 @@ export const storeMeasurements = (measurementData) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const retrieveTimepoints = () => {
|
export const retrieveTimepoints = (filter) => {
|
||||||
console.log('retrieveTimepoints');
|
console.log('retrieveTimepoints');
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
Meteor.call('retrieveTimepoints', (error, response) => {
|
Meteor.call('retrieveTimepoints', filter, (error, response) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
reject(error);
|
reject(error);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -37,9 +37,9 @@ Meteor.methods({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
retrieveTimepoints() {
|
retrieveTimepoints(filter = {}) {
|
||||||
OHIF.log.info('Retrieving Timepoints from the Server');
|
OHIF.log.info('Retrieving Timepoints from the Server');
|
||||||
return Timepoints.find().fetch();
|
return Timepoints.find(filter).fetch();
|
||||||
},
|
},
|
||||||
|
|
||||||
storeMeasurements(measurementData) {
|
storeMeasurements(measurementData) {
|
||||||
@ -60,12 +60,13 @@ Meteor.methods({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
retrieveMeasurements() {
|
retrieveMeasurements(filter = {}) {
|
||||||
OHIF.log.info('Retrieving Measurements from the Server');
|
OHIF.log.info('Retrieving Measurements from the Server');
|
||||||
let measurementData = {};
|
let measurementData = {};
|
||||||
|
|
||||||
|
|
||||||
measurementTools.forEach(tool => {
|
measurementTools.forEach(tool => {
|
||||||
measurementData[tool.id] = MeasurementCollections[tool.id].find().fetch();
|
measurementData[tool.id] = MeasurementCollections[tool.id].find(filter).fetch();
|
||||||
});
|
});
|
||||||
|
|
||||||
return measurementData;
|
return measurementData;
|
||||||
|
|||||||
@ -33,6 +33,10 @@ Template.measurementTableTimepointCell.helpers({
|
|||||||
const measurementTools = config.measurementTools;
|
const measurementTools = config.measurementTools;
|
||||||
|
|
||||||
const tool = _.where(measurementTools, {id: rowItem.measurementTypeId})[0];
|
const tool = _.where(measurementTools, {id: rowItem.measurementTypeId})[0];
|
||||||
|
if (!tool) {
|
||||||
|
// TODO: Figure out what is going on here?
|
||||||
|
console.warn('Something went wrong?');
|
||||||
|
}
|
||||||
const displayFunction = tool.options.measurementTableOptions.displayFunction;
|
const displayFunction = tool.options.measurementTableOptions.displayFunction;
|
||||||
return displayFunction(data);
|
return displayFunction(data);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,9 +12,6 @@ Template.imageThumbnail.onRendered(() => {
|
|||||||
// Disable cornerstone for thumbnail element and remove its canvas
|
// Disable cornerstone for thumbnail element and remove its canvas
|
||||||
cornerstone.disable(element);
|
cornerstone.disable(element);
|
||||||
|
|
||||||
// Enable cornerstone for thumbnail element again creating a new canvas
|
|
||||||
cornerstone.enable(element);
|
|
||||||
|
|
||||||
// Get the image ID
|
// Get the image ID
|
||||||
const stack = instance.data.thumbnail.stack;
|
const stack = instance.data.thumbnail.stack;
|
||||||
const thumbnailIndex = instance.data.thumbnail.thumbnailIndex;
|
const thumbnailIndex = instance.data.thumbnail.thumbnailIndex;
|
||||||
@ -29,6 +26,9 @@ Template.imageThumbnail.onRendered(() => {
|
|||||||
|
|
||||||
// Define a handler for success on image load
|
// Define a handler for success on image load
|
||||||
const loadSuccess = image => {
|
const loadSuccess = image => {
|
||||||
|
// Enable cornerstone for thumbnail element again creating a new canvas
|
||||||
|
cornerstone.enable(element);
|
||||||
|
|
||||||
cornerstone.displayImage(element, image);
|
cornerstone.displayImage(element, image);
|
||||||
delete ThumbnailLoading[thumbnailIndex];
|
delete ThumbnailLoading[thumbnailIndex];
|
||||||
$loading.css('display', 'none');
|
$loading.css('display', 'none');
|
||||||
@ -52,7 +52,7 @@ Template.imageThumbnail.onRendered(() => {
|
|||||||
instance.data.currentStudy.dep.depend();
|
instance.data.currentStudy.dep.depend();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for the new data and reresh the image thumbnail
|
// Wait for the new data and refresh the image thumbnail
|
||||||
Tracker.afterFlush(() => {
|
Tracker.afterFlush(() => {
|
||||||
instance.refreshImage();
|
instance.refreshImage();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -13,14 +13,20 @@ Template.studySeriesQuickSwitch.onCreated(() => {
|
|||||||
// Gets the current viewport data
|
// Gets the current viewport data
|
||||||
const viewportIndex = instance.data.viewportIndex;
|
const viewportIndex = instance.data.viewportIndex;
|
||||||
const viewportData = instance.getViewportData(viewportIndex);
|
const viewportData = instance.getViewportData(viewportIndex);
|
||||||
if (!viewportData) {
|
|
||||||
return;
|
let study;
|
||||||
|
if (viewportData) {
|
||||||
|
// Finds the current study and return it
|
||||||
|
study = ViewerStudies.findOne({
|
||||||
|
studyInstanceUid: viewportData.studyInstanceUid
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
study = ViewerStudies.findOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finds the current study and return it
|
if (!study) {
|
||||||
const study = ViewerStudies.findOne({
|
return;
|
||||||
studyInstanceUid: viewportData.studyInstanceUid
|
}
|
||||||
});
|
|
||||||
|
|
||||||
// Change the current study to update the thumbnails
|
// Change the current study to update the thumbnails
|
||||||
instance.data.currentStudy.set(study);
|
instance.data.currentStudy.set(study);
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import { Template } from 'meteor/templating';
|
||||||
|
|
||||||
Template.studyTimepoint.onCreated(() => {
|
Template.studyTimepoint.onCreated(() => {
|
||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import { Template } from 'meteor/templating';
|
||||||
|
|
||||||
Template.studyTimepointBrowser.onCreated(() => {
|
Template.studyTimepointBrowser.onCreated(() => {
|
||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user