|
@@ -1,3 +1,4 @@
|
|
|
+import 'dart:math';
|
|
|
import 'dart:ui';
|
|
|
|
|
|
import 'package:fis_common/logger/logger.dart';
|
|
@@ -70,7 +71,7 @@ class URMRectCal extends Calculator<URMRect, double> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // URM 测量项 2
|
|
|
+ //✅ URM 测量项 2
|
|
|
Future<void> getSRRoiDensityResult(
|
|
|
URMApplication app, DPoint startPoint, DPoint endPoint) async {
|
|
|
String description = "URM\n Measuring";
|
|
@@ -79,17 +80,23 @@ class URMRectCal extends Calculator<URMRect, double> {
|
|
|
await app.getSRRoiVelResult(startPoint, endPoint);
|
|
|
if (result != null) {
|
|
|
print("URM Measure output: ${result.output} ");
|
|
|
- description = "${(result.output).toStringAsFixed(2)}mm/s";
|
|
|
+ final feature = ref.feature!;
|
|
|
+ for (var output in ref.meta.outputs) {
|
|
|
+ if (output.name == MeasureTerms.URMDenROI) {
|
|
|
+ feature.updateFloatValue(output, result.output, output.unit);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} catch (e) {
|
|
|
description = " ";
|
|
|
+ updateStringValue(description);
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
- updateStringValue(description);
|
|
|
ref.application.updateRenderReady.emit(this, null);
|
|
|
}
|
|
|
|
|
|
- // URM 测量项 3
|
|
|
+ //✅ URM 测量项 3 未验证需要组合测量项
|
|
|
Future<void> getSRRoiFractalDimResult(
|
|
|
URMApplication app, DPoint startPoint, DPoint endPoint) async {
|
|
|
String description = "URM\n Measuring";
|
|
@@ -98,17 +105,23 @@ class URMRectCal extends Calculator<URMRect, double> {
|
|
|
await app.getSRRoiFractalDimResult(startPoint, endPoint);
|
|
|
if (result != null) {
|
|
|
print("URM Measure output: ${result.output} ");
|
|
|
- description = "${(result.output).toStringAsFixed(2)}mm/s";
|
|
|
+ final feature = ref.feature!;
|
|
|
+ for (var output in ref.meta.outputs) {
|
|
|
+ if (output.name == MeasureTerms.URMDenFractalDim) {
|
|
|
+ feature.updateFloatValue(output, result.output, output.unit);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} catch (e) {
|
|
|
description = " ";
|
|
|
+ updateStringValue(description);
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
- updateStringValue(description);
|
|
|
ref.application.updateRenderReady.emit(this, null);
|
|
|
}
|
|
|
|
|
|
- // URM 测量项 7
|
|
|
+ //✅ URM 测量项 7 未验证需要组合测量项
|
|
|
Future<void> getSRRoiVelResult(
|
|
|
URMApplication app, DPoint startPoint, DPoint endPoint) async {
|
|
|
String description = "URM\n Measuring";
|
|
@@ -117,17 +130,23 @@ class URMRectCal extends Calculator<URMRect, double> {
|
|
|
await app.getSRRoiVelResult(startPoint, endPoint);
|
|
|
if (result != null) {
|
|
|
print("URM Measure output: ${result.output} ");
|
|
|
- description = "${(result.output).toStringAsFixed(2)}mm/s";
|
|
|
+ final feature = ref.feature!;
|
|
|
+ for (var output in ref.meta.outputs) {
|
|
|
+ if (output.name == MeasureTerms.SRRoiVel) {
|
|
|
+ feature.updateFloatValue(output, result.output, output.unit);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} catch (e) {
|
|
|
description = " ";
|
|
|
+ updateStringValue(description);
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
- updateStringValue(description);
|
|
|
ref.application.updateRenderReady.emit(this, null);
|
|
|
}
|
|
|
|
|
|
- // URM 测量项 9
|
|
|
+ //✅ URM 测量项 9
|
|
|
Future<void> getURMVelMeasureResult(
|
|
|
URMApplication app, DPoint startPoint, DPoint endPoint) async {
|
|
|
String description = "URM\n Measuring";
|
|
@@ -137,13 +156,35 @@ class URMRectCal extends Calculator<URMRect, double> {
|
|
|
if (result != null) {
|
|
|
// TODO 全部内容展示
|
|
|
print("URM Measure inMaxVel: ${result.inMaxVel} ");
|
|
|
- description = "${(result.inMaxVel).toStringAsFixed(2)}mm/s";
|
|
|
+ final feature = ref.feature!;
|
|
|
+ for (var output in ref.meta.outputs) {
|
|
|
+ if (output.name == MeasureTerms.URMVelMax) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, result.maxVel + app.urmMinVel, VidUsUnit.mms);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.URMVelMin) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, result.minVel + app.urmMinVel, VidUsUnit.mms);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.URMVelMean) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, result.meanVel + app.urmMinVel, VidUsUnit.mms);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.URMVelStd) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, sqrt(result.varianceVel), VidUsUnit.mms);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.Area) {
|
|
|
+ feature.updateFloatValue(output, result.roiArea, VidUsUnit.cm2);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} catch (e) {
|
|
|
description = " ";
|
|
|
+ updateStringValue(description);
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
- updateStringValue(description);
|
|
|
ref.application.updateRenderReady.emit(this, null);
|
|
|
}
|
|
|
}
|
|
@@ -285,7 +326,7 @@ class URMStraightLineCal extends Calculator<StraightLine, double> {
|
|
|
ref.application.updateRenderReady.emit(this, null);
|
|
|
}
|
|
|
|
|
|
- // URM 测量项 8
|
|
|
+ //✅ URM 测量项 8
|
|
|
Future<void> getURMDenMeasureResult(
|
|
|
URMApplication app, DPoint startPoint, DPoint endPoint) async {
|
|
|
String description = "URM\n Measuring";
|
|
@@ -295,34 +336,97 @@ class URMStraightLineCal extends Calculator<StraightLine, double> {
|
|
|
if (result != null) {
|
|
|
print(
|
|
|
"URM Measure inMaxDensity: ${result.inMaxDensity} inMeanDensity: ${result.inMeanDensity}");
|
|
|
- description = "${(result.inMaxDensity).toStringAsFixed(2)}mm/s ...";
|
|
|
+ // description = "${(result.inMaxDensity).toStringAsFixed(2)}mm/s ...";
|
|
|
+ final feature = ref.feature!;
|
|
|
+ for (var output in ref.meta.outputs) {
|
|
|
+ if (output.name == MeasureTerms.URMDenROI) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, result.roiDen * 100, VidUsUnit.percent);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.URMDenFractalDim) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, result.roiFractalDim, VidUsUnit.None);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.URMDenMax) {
|
|
|
+ feature.updateFloatValue(output, result.maxDensity, VidUsUnit.None);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.URMDenMin) {
|
|
|
+ feature.updateFloatValue(output, result.minDensity, VidUsUnit.None);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.URMDenMean) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, result.meanDensity, VidUsUnit.None);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.URMDenStd) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, sqrt(result.varianceDensity), VidUsUnit.None);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.Area) {
|
|
|
+ feature.updateFloatValue(output, result.roiArea, VidUsUnit.cm2);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} catch (e) {
|
|
|
description = " ";
|
|
|
+ updateStringValue(description);
|
|
|
return;
|
|
|
}
|
|
|
- updateStringValue(description);
|
|
|
ref.application.updateRenderReady.emit(this, null);
|
|
|
}
|
|
|
|
|
|
- // URM 测量项 10
|
|
|
+ //✅ URM 测量项 10
|
|
|
Future<void> getURMVessMeasureResult(URMApplication app, DPoint startPoint,
|
|
|
DPoint endPoint, double cmlength) async {
|
|
|
String description = "URM\n Measuring";
|
|
|
try {
|
|
|
// FIXME 修正为正确的返回值
|
|
|
- GetURMVelMeasureResult? result =
|
|
|
+ GetUrmVessMeasureResult? result =
|
|
|
await app.getURMVessMeasureResult(startPoint, endPoint, cmlength);
|
|
|
if (result != null) {
|
|
|
print(
|
|
|
- "URM Measure inMaxDensity: ${result.inMaxVel} inMeanDensity: ${result.inMaxVel}");
|
|
|
- description = "${(result.inMaxVel).toStringAsFixed(2)}mm/s ...";
|
|
|
+ "URM Measure inMaxDensity: ${result.maxVessDiameter} inMeanDensity: ${result.meanVessDistacne}");
|
|
|
+ final feature = ref.feature!;
|
|
|
+ for (var output in ref.meta.outputs) {
|
|
|
+ if (output.name == MeasureTerms.MaxVessDistance) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, result.maxVessDistance, VidUsUnit.mm);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.MinVessDistance) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, result.minVessDistance, VidUsUnit.mm);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.MeanVessDistacne) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, result.meanVessDistacne, VidUsUnit.mm);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.StdVessDistance) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, sqrt(result.varianceVessDistance), VidUsUnit.mm);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.MaxVessDiameter) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, result.maxVessDiameter, VidUsUnit.mm);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.MinVessDiameter) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, result.minVessDiameter, VidUsUnit.mm);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.MeanVessDiameter) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, result.meanVessDiameter, VidUsUnit.mm);
|
|
|
+ }
|
|
|
+ if (output.name == MeasureTerms.StdVessDiameter) {
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output, sqrt(result.varianceVessDiameter), VidUsUnit.mm);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} catch (e) {
|
|
|
description = " ";
|
|
|
+ updateStringValue(description);
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
- updateStringValue(description);
|
|
|
ref.application.updateRenderReady.emit(this, null);
|
|
|
}
|
|
|
|
|
@@ -370,7 +474,7 @@ class URMTraceCal extends Calculator<AreaItemAbstract, double> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // URM 测量项 4
|
|
|
+ //✅ URM 测量项 4
|
|
|
Future<void> getSRTraceVelResult(
|
|
|
URMApplication app, List<UrmPoint> points) async {
|
|
|
String description = "URM\n Measuring";
|
|
@@ -378,17 +482,23 @@ class URMTraceCal extends Calculator<AreaItemAbstract, double> {
|
|
|
GetSRTraceVelResult? result = await app.getSRTraceVelResult(points);
|
|
|
if (result != null) {
|
|
|
print("URM Measure output: ${result.output} ");
|
|
|
- description = "${(result.output).toStringAsFixed(2)}mm/s ...";
|
|
|
+ final feature = ref.feature!;
|
|
|
+ for (var output in ref.meta.outputs) {
|
|
|
+ if (output.name == MeasureTerms.URMDenROI) {
|
|
|
+ feature.updateFloatValue(output, result.output, output.unit);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} catch (e) {
|
|
|
description = " ";
|
|
|
+ updateStringValue(description);
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
- updateStringValue(description);
|
|
|
ref.application.updateRenderReady.emit(this, null);
|
|
|
}
|
|
|
|
|
|
- // URM 测量项 5
|
|
|
+ //✅ URM 测量项 5
|
|
|
Future<void> getSRTraceFractalDimResult(
|
|
|
URMApplication app, List<UrmPoint> points) async {
|
|
|
String description = "URM\n Measuring";
|
|
@@ -397,13 +507,19 @@ class URMTraceCal extends Calculator<AreaItemAbstract, double> {
|
|
|
await app.getSRTraceFractalDimResult(points);
|
|
|
if (result != null) {
|
|
|
print("URM Measure output: ${result.output} ");
|
|
|
- description = "${(result.output).toStringAsFixed(2)}mm/s ...";
|
|
|
+ final feature = ref.feature!;
|
|
|
+ for (var output in ref.meta.outputs) {
|
|
|
+ if (output.name == MeasureTerms.URMDenFractalDim) {
|
|
|
+ feature.updateFloatValue(output, result.output, output.unit);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} catch (e) {
|
|
|
description = " ";
|
|
|
+ updateStringValue(description);
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
- updateStringValue(description);
|
|
|
ref.application.updateRenderReady.emit(this, null);
|
|
|
}
|
|
|
|