Allowing W/L Presets customization
This commit is contained in:
1 parent
4d9300f6c4
commit
e6b5a21ae2
14 files changed
+303
-173
No files matched your search
@@ -1,6 +1,25 @@
|
||||
<template name="windowLevelPresetsForm">
|
||||
{{#form (extend this class='form-themed' api=instance.api)}}
|
||||
{{>inputText label='W/L Preset 1' key='WLPreset1'}}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Preset</th>
|
||||
<th>Name</th>
|
||||
<th>Window Level (WL)</th>
|
||||
<th>Window Width (WW)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each presetInputInformation in getPresetsInputInformationList}}
|
||||
{{#group base='baseTr' key=(concat @index)}}
|
||||
<td>{{sum @index 1}}</td>
|
||||
<td>{{>inputText key='id' value=presetInputInformation.id}}</td>
|
||||
<td>{{>inputText key='wc' value=(filterNaN presetInputInformation.wc) dataType='Number'}}</td>
|
||||
<td>{{>inputText key='ww' value=(filterNaN presetInputInformation.ww) dataType='Number'}}</td>
|
||||
{{/group}}
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="clearfix">
|
||||
{{#button class='btn btn-primary pull-right' action='save'}}Save{{/button}}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import { _ } from 'meteor/underscore';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
Template.windowLevelPresetsForm.onCreated(() => {
|
||||
const instance = Template.instance();
|
||||
const { wlPresets } = OHIF.viewerbase;
|
||||
|
||||
instance.api = {
|
||||
save() {
|
||||
const form = instance.$('form').first().data('component');
|
||||
const definitions = form.value();
|
||||
// TODO: return save method with promise
|
||||
wlPresets.store(definitions);
|
||||
},
|
||||
|
||||
resetDefaults() {
|
||||
@@ -17,9 +19,14 @@ Template.windowLevelPresetsForm.onCreated(() => {
|
||||
message: 'Are you sure you want to reset all the window level presets to their defaults?'
|
||||
};
|
||||
|
||||
return OHIF.ui.showDialog('dialogConfirm', dialogOptions).then(() => {
|
||||
// TODO: return reset method with promise
|
||||
});
|
||||
return OHIF.ui.showDialog('dialogConfirm', dialogOptions).then(() => wlPresets.resetDefaults());
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
Template.windowLevelPresetsForm.helpers({
|
||||
getPresetsInputInformationList() {
|
||||
OHIF.viewerbase.wlPresets.changeObserver.depend();
|
||||
return _.toArray(OHIF.viewer.wlPresets);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user