LT-408: New Lesion section heading is missing from the measurement table

This commit is contained in:
Leonardo Campos 2017-02-15 21:02:30 -02:00
parent 6b17deabcb
commit 7c37e2070a
3 changed files with 23 additions and 16 deletions

View File

@ -1,5 +1,6 @@
import { Template } from 'meteor/templating';
import { OHIF } from 'meteor/ohif:core';
import { Viewerbase } from 'meteor/ohif:viewerbase';
Template.measurementTableHeaderRow.helpers({
numberOfMeasurements() {
@ -47,6 +48,6 @@ Template.measurementTableHeaderRow.helpers({
Template.measurementTableHeaderRow.events({
'click .js-setTool'(event, instance) {
const { toolGroup } = instance.data;
toolManager.setActiveTool(toolGroup.childTools[0].cornerstoneToolType);
Viewerbase.toolManager.setActiveTool(toolGroup.childTools[0].cornerstoneToolType);
}
});

View File

@ -13,16 +13,13 @@
{{/each}}
{{#if config.newMeasurementTool}}
{{#let measurementType=(getNewMeasurementType config.newMeasurementTool)}}
{{#let newMeasure=(newMeasurements measurementType)}}
{{#let toolGroup=(getNewToolGroup config.newMeasurementTool)}}
{{#let newMeasure=(newMeasurements toolGroup)}}
{{#if newMeasure.length}}
{{#let collection=newMeasure}}
{{>measurementTableHeaderRow
measurementType=measurementType
measurements=collection
currentTimepointId=currentTimepointId
timepointApi=timepointApi
measurementApi=measurementApi}}
{{>measurementTableHeaderRow (clone this
toolGroup=toolGroup
measurementRows=collection)}}
{{#each entry in collection}}
{{>measurementTableRow (clone this rowItem=entry)}}

View File

@ -31,18 +31,27 @@ Template.measurementTableView.helpers({
return !!group.measurementRows.length;
},
getNewMeasurementType(tool) {
// TODO: Check Conformance criteria here.
// RECIST should be nonTargets, irRC should be targets
getNewToolGroup(tool) {
const configuration = OHIF.measurements.MeasurementApi.getConfiguration();
const trialCriteriaType = TrialCriteriaTypes.findOne({ selected: true });
const trialCriteriaTypeId = trialCriteriaType.id.toLowerCase();
const trialToolGroupMap = {
recist: 'nonTargets',
irrc: 'targets'
};
const toolGroupId = trialToolGroupMap[trialCriteriaTypeId];
const toolGroup = _.findWhere(configuration.measurementTools, { id: toolGroupId });
return {
id: tool.id,
name: tool.name,
cornerstoneToolType: 'nonTarget',
measurementTypeId: 'nonTargets'
childTools: toolGroup.childTools,
measurementTypeId: toolGroup.id
};
},
newMeasurements(measurementType) {
newMeasurements(toolGroup) {
const instance = Template.instance();
const measurementApi = instance.data.measurementApi;
const timepointApi = instance.data.timepointApi;
@ -62,7 +71,7 @@ Template.measurementTableView.helpers({
// Retrieve all the data for this Measurement type (e.g. 'targets')
// which was recorded at baseline.
const measurementTypeId = measurementType.measurementTypeId;
const measurementTypeId = toolGroup.measurementTypeId;
const atBaseline = measurementApi.fetch(measurementTypeId, {
timepointId: baseline.timepointId
});