|
|
@@ -146,7 +146,7 @@
|
|
|
}
|
|
|
let isDicom = (this.media[this.currentMediaIndex].filename.indexOf('.dicom')!==-1);
|
|
|
if(isDicom &&
|
|
|
- (this.media[this.currentMediaIndex].metrics.pxwidth>=0 && this.media[this.currentMediaIndex].metrics.pxheight>=0)) {
|
|
|
+ (this.media[this.currentMediaIndex].metrics.pxwidth!=0 && this.media[this.currentMediaIndex].metrics.pxheight!=0)) {
|
|
|
$$('#measure-calibration').addClass('disabled');
|
|
|
}
|
|
|
else {
|
|
|
@@ -274,16 +274,7 @@
|
|
|
// DICOM
|
|
|
if(this.media[idx].filename.indexOf('.dicom')!==-1) {
|
|
|
//console.log('dicom', this.media[idx]);
|
|
|
- let hasCalibration = false;
|
|
|
- for(let m=0; m<this.media[idx].measure.length; ++m) {
|
|
|
- if(this.media[idx].measure[m].type=='calibration') {
|
|
|
- hasCalibration = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if(!hasCalibration) {
|
|
|
- this.addDicomCalibration(idx);
|
|
|
- }
|
|
|
+ this.addDicomCalibration(idx);
|
|
|
}
|
|
|
|
|
|
//
|
|
|
@@ -305,22 +296,31 @@
|
|
|
}
|
|
|
},
|
|
|
addDicomCalibration: function(idx) {
|
|
|
- this.media[idx].measure.push({
|
|
|
- ID: 0,
|
|
|
- type: 'calibration',
|
|
|
- computation: {
|
|
|
- distance: 20
|
|
|
- },
|
|
|
- fk_media: 0,
|
|
|
- fk_user: 0,
|
|
|
- points: [{
|
|
|
- x: this.media[idx].metrics.width-40,
|
|
|
- y: 50
|
|
|
- }, {
|
|
|
- x: this.media[idx].metrics.width-40,
|
|
|
- y: (50 + 20 / this.media[idx].metrics.pxheight)
|
|
|
- }]
|
|
|
- });
|
|
|
+ let hasCalibration = false;
|
|
|
+ for(let m=0; m<this.media[idx].measure.length; ++m) {
|
|
|
+ if(this.media[idx].measure[m].type=='calibration') {
|
|
|
+ hasCalibration = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!hasCalibration && this.media[idx].metrics.pxwith!=0 && this.media[idx].metrics.pxheight!=0) {
|
|
|
+ this.media[idx].measure.push({
|
|
|
+ ID: 0,
|
|
|
+ type: 'calibration',
|
|
|
+ computation: {
|
|
|
+ distance: 20
|
|
|
+ },
|
|
|
+ fk_media: 0,
|
|
|
+ fk_user: 0,
|
|
|
+ points: [{
|
|
|
+ x: this.media[idx].metrics.width-40,
|
|
|
+ y: 50
|
|
|
+ }, {
|
|
|
+ x: this.media[idx].metrics.width-40,
|
|
|
+ y: (50 + 20 / this.media[idx].metrics.pxheight)
|
|
|
+ }]
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
updateMeasureList: function() {
|
|
|
let txt = '';
|