123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683 |
- // import 'dart:math';
- // import 'dart:ui';
- // import 'package:fis_common/logger/logger.dart';
- // import 'package:fis_jsonrpc/rpc.dart';
- // import 'package:fis_measure/interfaces/date_types/point.dart';
- // import 'package:fis_measure/interfaces/process/calculators/values.dart';
- // import 'package:fis_measure/process/items/item.dart';
- // import 'package:fis_measure/process/primitives/area_abstract.dart';
- // import 'package:fis_measure/process/primitives/combos/urm_sr_roi_rect_combo.dart';
- // import 'package:fis_measure/process/primitives/location.dart';
- // import 'package:fis_measure/process/primitives/urm_measure/urm_rect_measure.dart';
- // // import 'package:fis_measure/process/primitives/urm_straightline.dart';
- // import 'package:fis_measure/process/workspace/urm/application.dart';
- // import 'calculator.dart';
- // class URMRectCal extends Calculator<URMRectMeasure, double> {
- // URMRectCal(
- // URMRectMeasure ref, {
- // required this.type,
- // }) : super(ref);
- // final String type;
- // @override
- // void calculate() {}
- // @override
- // Future<void> calculateAsync() async {
- // if (ref.feature == null) return;
- // Size urmResultSize = const Size(0, 0);
- // try {
- // if (ref.application is! URMApplication) {
- // return;
- // }
- // final URMApplication urmApplication = ref.application as URMApplication;
- // urmResultSize = Size(urmApplication.resultWidth.toDouble(),
- // urmApplication.resultHeight.toDouble());
- // final p1 = ref.feature!.startPoint;
- // final p2 = ref.feature!.endPoint;
- // //左上顶点
- // final leftTopPercent =
- // DPoint(p1.x < p2.x ? p1.x : p2.x, p1.y < p2.y ? p1.y : p2.y);
- // //右下顶点
- // final rightBottomPercent =
- // DPoint(p1.x > p2.x ? p1.x : p2.x, p1.y > p2.y ? p1.y : p2.y);
- // final startPoint = leftTopPercent.scale2Size(urmResultSize);
- // final endPoint = rightBottomPercent.scale2Size(urmResultSize);
- // String description = "URM\n Calculating...";
- // updateStringValue(description);
- // // switch (type) {
- // // case MeasureTypes.DensitySR:
- // // case MeasureTypes.SRRoiDensity:
- // // case MeasureTypes.Roi1:
- // // case MeasureTypes.Roi2:
- // // await getSRRoiDensityResult(urmApplication, startPoint, endPoint);
- // // break;
- // // case MeasureTypes.FractalDimSR:
- // // case MeasureTypes.SRROIFractalDim:
- // // await getSRRoiFractalDimResult(urmApplication, startPoint, endPoint);
- // // break;
- // // case MeasureTypes.SRRoiVel:
- // // await getSRRoiVelResult(urmApplication, startPoint, endPoint);
- // // break;
- // // case MeasureTypes.URMVelMeasure:
- // // await getURMVelMeasureResult(urmApplication, startPoint, endPoint);
- // // break;
- // // default:
- // // }
- // } catch (e) {
- // logger.e('URM Measure error: $e');
- // return;
- // }
- // }
- // // //✅ URM 测量项 2
- // // Future<void> getSRRoiDensityResult(
- // // URMApplication app, DPoint startPoint, DPoint endPoint) async {
- // // String description = "URM\n Measuring";
- // // try {
- // // GetSRRoiVelResult? result =
- // // await app.getSRRoiVelResult(startPoint, endPoint);
- // // if (result != null) {
- // // print("URM Measure output: ${result.output} ");
- // // final feature = ref.feature!;
- // // for (var output in ref.meta.outputs) {
- // // if ([MeasureTerms.URMDenROI, MeasureTerms.URMDenFractalDim]
- // // .contains(output.name)) {
- // // output.unit = VidUsUnit.percent;
- // // feature.updateFloatValue(output, result.output, output.unit);
- // // }
- // // }
- // // } else {
- // // throw Exception("URM Measure API error");
- // // }
- // // } catch (e) {
- // // description = " ";
- // // updateStringValue(description);
- // // return;
- // // }
- // // ref.application.updateRenderReady.emit(this, null);
- // // }
- // // //✅ URM 测量项 3 未验证需要组合测量项
- // // Future<void> getSRRoiFractalDimResult(
- // // URMApplication app, DPoint startPoint, DPoint endPoint) async {
- // // String description = "URM\n Measuring";
- // // try {
- // // GetSRRoiFractalDimResult? result =
- // // await app.getSRRoiFractalDimResult(startPoint, endPoint);
- // // if (result != null) {
- // // print("URM Measure output: ${result.output} ");
- // // final feature = ref.feature!;
- // // for (var output in ref.meta.outputs) {
- // // if (output.name == MeasureTerms.URMDenFractalDim) {
- // // output.unit = VidUsUnit.None;
- // // feature.updateFloatValue(output, result.output, output.unit);
- // // }
- // // }
- // // } else {
- // // throw Exception("URM Measure API error");
- // // }
- // // } catch (e) {
- // // description = " ";
- // // updateStringValue(description);
- // // return;
- // // }
- // // ref.application.updateRenderReady.emit(this, null);
- // // }
- // // //✅ URM 测量项 7 未验证需要组合测量项
- // // Future<void> getSRRoiVelResult(
- // // URMApplication app, DPoint startPoint, DPoint endPoint) async {
- // // String description = "URM\n Measuring";
- // // try {
- // // GetSRRoiVelResult? result =
- // // await app.getSRRoiVelResult(startPoint, endPoint);
- // // if (result != null) {
- // // print("URM Measure output: ${result.output} ");
- // // final feature = ref.feature!;
- // // for (var output in ref.meta.outputs) {
- // // if (output.name == MeasureTerms.SRRoiVel) {
- // // output.unit = VidUsUnit.percent;
- // // feature.updateFloatValue(output, result.output, output.unit);
- // // }
- // // }
- // // } else {
- // // throw Exception("URM Measure API error");
- // // }
- // // } catch (e) {
- // // description = " ";
- // // updateStringValue(description);
- // // return;
- // // }
- // // ref.application.updateRenderReady.emit(this, null);
- // // }
- // // //✅ URM 测量项 9
- // // Future<void> getURMVelMeasureResult(
- // // URMApplication app, DPoint startPoint, DPoint endPoint) async {
- // // String description = "URM\n Measuring";
- // // try {
- // // GetURMVelMeasureResult? result =
- // // await app.getURMVelMeasureResult(startPoint, endPoint);
- // // if (result != null) {
- // // // TODO 全部内容展示
- // // print("URM Measure inMaxVel: ${result.inMaxVel} ");
- // // final feature = ref.feature!;
- // // for (var output in ref.meta.outputs) {
- // // if (output.name == MeasureTerms.URMVelMax) {
- // // output.unit = VidUsUnit.mms;
- // // feature.updateFloatValue(
- // // output, result.maxVel + app.urmMinVel, VidUsUnit.mms);
- // // }
- // // if (output.name == MeasureTerms.URMVelMin) {
- // // output.unit = VidUsUnit.mms;
- // // feature.updateFloatValue(
- // // output, result.minVel + app.urmMinVel, VidUsUnit.mms);
- // // }
- // // if (output.name == MeasureTerms.URMVelMean) {
- // // output.unit = VidUsUnit.mms;
- // // feature.updateFloatValue(
- // // output, result.meanVel + app.urmMinVel, VidUsUnit.mms);
- // // }
- // // if (output.name == MeasureTerms.URMVelStd) {
- // // output.unit = VidUsUnit.mms;
- // // feature.updateFloatValue(
- // // output, sqrt(result.varianceVel), VidUsUnit.mms);
- // // }
- // // if (output.name == MeasureTerms.Area) {
- // // output.unit = VidUsUnit.cm2;
- // // feature.updateFloatValue(output, result.roiArea, VidUsUnit.cm2);
- // // }
- // // }
- // // } else {
- // // throw Exception("URM Measure API error");
- // // }
- // // } catch (e) {
- // // description = " ";
- // // updateStringValue(description);
- // // return;
- // // }
- // // ref.application.updateRenderReady.emit(this, null);
- // // }
- // }
- // class URMLocationCal extends Calculator<Location, double> {
- // URMLocationCal(Location ref) : super(ref);
- // @override
- // void calculate() {}
- // @override
- // Future<void> calculateAsync() async {
- // if (ref.feature == null) return;
- // Size urmResultSize = const Size(0, 0);
- // try {
- // if (ref.application is! URMApplication) {
- // return;
- // }
- // final URMApplication urmApplication = ref.application as URMApplication;
- // urmResultSize = Size(urmApplication.resultWidth.toDouble(),
- // urmApplication.resultHeight.toDouble());
- // // urmResultWidth = urmApplication.resultWidth;
- // // urmResultHeight = urmApplication.resultHeight;
- // final point = ref.feature!.point.clone();
- // final startPoint = point.scale2Size(urmResultSize);
- // print("URM Measure startPoint: $startPoint");
- // // await getSRLoactionVelResult(urmApplication, startPoint);
- // return;
- // } catch (e) {
- // logger.e('URM Measure error: $e');
- // return;
- // }
- // }
- // // ✅ URM 测量项 6
- // // Future<void> getSRLoactionVelResult(
- // // URMApplication app, DPoint startPoint) async {
- // // String description = "URM\n Measuring";
- // // try {
- // // GetSRLoactionVelResult? result =
- // // await app.getSRLoactionVelResult(startPoint);
- // // if (result != null) {
- // // print("URM Measure output: ${result.output}");
- // // final feature = ref.feature!;
- // // for (var output in ref.meta.outputs) {
- // // if (output.name == MeasureTerms.SRVel) {
- // // output.unit = VidUsUnit.mms;
- // // feature.updateFloatValue(output, result.output, output.unit);
- // // }
- // // }
- // // } else {
- // // throw Exception("URM Measure API error");
- // // }
- // // } catch (e) {
- // // description = " ";
- // // updateStringValue(description);
- // // return;
- // // }
- // // ref.application.updateRenderReady.emit(this, null);
- // // }
- // }
- // /// 自动弯曲度测量
- // // class URMAutoLineLineCal extends Calculator<StraightLine, double> {
- // // URMAutoLineLineCal(
- // // StraightLine ref, {
- // // required this.type,
- // // }) : super(ref);
- // // final String type;
- // // @override
- // // void calculate() {}
- // // @override
- // // Future<void> calculateAsync() async {
- // // try {
- // // if (ref.feature == null) return;
- // // if (ref.application is! URMApplication) return;
- // // Size urmResultSize = const Size(0, 0);
- // // final URMApplication urmApplication = ref.application as URMApplication;
- // // urmResultSize = Size(urmApplication.resultWidth.toDouble(),
- // // urmApplication.resultHeight.toDouble());
- // // final p1 = ref.feature!.startPoint;
- // // final p2 = ref.feature!.endPoint;
- // // // final startPoint = leftTopPercent.scale2Size(urmResultSize);
- // // // final endPoint = rightBottomPercent.scale2Size(urmResultSize);
- // // // final startPoint = DPoint(0.478335, 0.315384);
- // // // final endPoint = DPoint(0.538395, 0.526373);
- // // switch (type) {
- // // case MeasureTypes.SRCurvature:
- // // await getSRCurvatureResult(urmApplication, p1, p2);
- // // break;
- // // // case MeasureTypes.URMDensityMeasure:
- // // // await getURMDenMeasureResult(urmApplication, startPoint, endPoint);
- // // // break;
- // // // case MeasureTypes.URMVesselMeasure:
- // // // final feature = ref.feature!;
- // // // final viewport = feature.hostVisualArea!.viewport!;
- // // // final p1 = feature.startPoint;
- // // // final p2 = feature.endPoint;
- // // // final pp1 = viewport.convert(p1);
- // // // final pp2 = viewport.convert(p2);
- // // // final cmlength = (pp2 - pp1).length.abs();
- // // // await getURMVessMeasureResult(
- // // // urmApplication, startPoint, endPoint, cmlength);
- // // // break;
- // // default:
- // // }
- // // } catch (e) {
- // // logger.e('URM Measure error: $e');
- // // return;
- // // }
- // // }
- // // // // ✅ URM 测量项 1
- // // Future<void> getSRCurvatureResult(
- // // URMApplication app, DPoint startPoint, DPoint endPoint) async {
- // // String description = "URM\n Measuring";
- // // try {
- // // URMMeasureProcessResult? result = await app.getURMMeasureResult(
- // // urmMeasureType: URMMeasureType.URMCurvature,
- // // rOIType: URMROIType.placeHolder_0,
- // // srcDPoints: [
- // // UrmPoint(x: startPoint.x, y: startPoint.y),
- // // UrmPoint(x: endPoint.x, y: endPoint.y)
- // // ],
- // // );
- // // if (result != null) {
- // // print(
- // // "URM Measure curvature: ${result} nums: ${result.resultDPoints?.length}");
- // // // TODO 将返回的视图百分比区域的点集转换为全图百分比点集,然会然后绘制
- // // final feature = ref.feature!;
- // // if (feature is! StraightCurvatureFeature) return;
- // // feature.autoLinePoints = urmPointsToDPoints(result.resultDPoints);
- // // /// TODO 只转数据类型还不够,需要将 视图区域百分比坐标转为全图百分比坐标
- // // for (var output in ref.meta.outputs) {
- // // if (output.name == MeasureTerms.SRCurvature) {
- // // output.unit = VidUsUnit.None;
- // // feature.updateFloatValue(output, result.resultData, output.unit);
- // // }
- // // }
- // // } else {
- // // throw Exception("URM Measure API error");
- // // }
- // // } catch (e) {
- // // description = " ";
- // // updateStringValue(description);
- // // return;
- // // }
- // // ref.application.updateRenderReady.emit(this, null);
- // // }
- // // // //✅ URM 测量项 8
- // // // Future<void> getURMDenMeasureResult(
- // // // URMApplication app, DPoint startPoint, DPoint endPoint) async {
- // // // String description = "URM\n Measuring";
- // // // try {
- // // // GetURMDenMeasureResult? result =
- // // // await app.getURMDenMeasureResult(startPoint, endPoint);
- // // // if (result != null) {
- // // // print(
- // // // "URM Measure inMaxDensity: ${result.inMaxDensity} inMeanDensity: ${result.inMeanDensity}");
- // // // // description = "${(result.inMaxDensity).toStringAsFixed(2)}mm/s ...";
- // // // final feature = ref.feature!;
- // // // for (var output in ref.meta.outputs) {
- // // // if (output.name == MeasureTerms.URMDenROI) {
- // // // output.unit = VidUsUnit.percent;
- // // // feature.updateFloatValue(
- // // // output, result.roiDen * 100, VidUsUnit.percent);
- // // // }
- // // // if (output.name == MeasureTerms.URMDenFractalDim) {
- // // // output.unit = VidUsUnit.None;
- // // // feature.updateFloatValue(
- // // // output, result.roiFractalDim, VidUsUnit.None);
- // // // }
- // // // if (output.name == MeasureTerms.URMDenMax) {
- // // // output.unit = VidUsUnit.None;
- // // // feature.updateFloatValue(output, result.maxDensity, VidUsUnit.None);
- // // // }
- // // // if (output.name == MeasureTerms.URMDenMin) {
- // // // output.unit = VidUsUnit.None;
- // // // feature.updateFloatValue(output, result.minDensity, VidUsUnit.None);
- // // // }
- // // // if (output.name == MeasureTerms.URMDenMean) {
- // // // output.unit = VidUsUnit.None;
- // // // feature.updateFloatValue(
- // // // output, result.meanDensity, VidUsUnit.None);
- // // // }
- // // // if (output.name == MeasureTerms.URMDenStd) {
- // // // output.unit = VidUsUnit.None;
- // // // feature.updateFloatValue(
- // // // output, sqrt(result.varianceDensity), VidUsUnit.None);
- // // // }
- // // // if (output.name == MeasureTerms.Area) {
- // // // output.unit = VidUsUnit.cm2;
- // // // feature.updateFloatValue(output, result.roiArea, VidUsUnit.cm2);
- // // // }
- // // // }
- // // // } else {
- // // // throw Exception("URM Measure API error");
- // // // }
- // // // } catch (e) {
- // // // description = " ";
- // // // updateStringValue(description);
- // // // return;
- // // // }
- // // // ref.application.updateRenderReady.emit(this, null);
- // // // }
- // // // //✅ URM 测量项 10
- // // // Future<void> getURMVessMeasureResult(URMApplication app, DPoint startPoint,
- // // // DPoint endPoint, double cmlength) async {
- // // // String description = "URM\n Measuring";
- // // // try {
- // // // GetUrmVessMeasureResult? result =
- // // // await app.getURMVessMeasureResult(startPoint, endPoint, cmlength);
- // // // if (result != null) {
- // // // app.onUpdateChart?.call(
- // // // URMChartParams(
- // // // cmlength: cmlength,
- // // // minPointIndex: result.minPos,
- // // // maxPointIndex: result.maxPos,
- // // // points: convertPoints(result.outputPoints),
- // // // ),
- // // // );
- // // // print(
- // // // "URM Measure inMaxDensity: ${result.maxVessDiameter} inMeanDensity: ${result.meanVessDistacne}");
- // // // final feature = ref.feature!;
- // // // for (var output in ref.meta.outputs) {
- // // // if (output.name == MeasureTerms.MaxVessDistance) {
- // // // output.unit = VidUsUnit.mm;
- // // // feature.updateFloatValue(
- // // // output, result.maxVessDistance, VidUsUnit.mm);
- // // // }
- // // // if (output.name == MeasureTerms.MinVessDistance) {
- // // // output.unit = VidUsUnit.mm;
- // // // feature.updateFloatValue(
- // // // output, result.minVessDistance, VidUsUnit.mm);
- // // // }
- // // // if (output.name == MeasureTerms.MeanVessDistacne) {
- // // // output.unit = VidUsUnit.mm;
- // // // feature.updateFloatValue(
- // // // output, result.meanVessDistacne, VidUsUnit.mm);
- // // // }
- // // // if (output.name == MeasureTerms.StdVessDistance) {
- // // // output.unit = VidUsUnit.mm;
- // // // feature.updateFloatValue(
- // // // output, sqrt(result.varianceVessDistance), VidUsUnit.mm);
- // // // }
- // // // if (output.name == MeasureTerms.MaxVessDiameter) {
- // // // output.unit = VidUsUnit.mm;
- // // // feature.updateFloatValue(
- // // // output, result.maxVessDiameter, VidUsUnit.mm);
- // // // }
- // // // if (output.name == MeasureTerms.MinVessDiameter) {
- // // // output.unit = VidUsUnit.mm;
- // // // feature.updateFloatValue(
- // // // output, result.minVessDiameter, VidUsUnit.mm);
- // // // }
- // // // if (output.name == MeasureTerms.MeanVessDiameter) {
- // // // output.unit = VidUsUnit.mm;
- // // // feature.updateFloatValue(
- // // // output, result.meanVessDiameter, VidUsUnit.mm);
- // // // }
- // // // if (output.name == MeasureTerms.StdVessDiameter) {
- // // // output.unit = VidUsUnit.mm;
- // // // feature.updateFloatValue(
- // // // output, sqrt(result.varianceVessDiameter), VidUsUnit.mm);
- // // // }
- // // // }
- // // // } else {
- // // // throw Exception("URM Measure API error");
- // // // }
- // // // } catch (e) {
- // // // description = " ";
- // // // updateStringValue(description);
- // // // return;
- // // // }
- // // // ref.application.updateRenderReady.emit(this, null);
- // // // }
- // // List<DPoint> urmPointsToDPoints(List<UrmPoint>? points) {
- // // if (points == null) return [];
- // // List<DPoint> urmPoints = [];
- // // for (var point in points) {
- // // urmPoints.add(DPoint(point.x, point.y));
- // // }
- // // return urmPoints;
- // // }
- // // //
- // // }
- // class URMTraceCal extends Calculator<AreaItemAbstract, double> {
- // URMTraceCal(
- // AreaItemAbstract ref, {
- // required this.type,
- // }) : super(ref);
- // final String type;
- // @override
- // void calculate() {}
- // @override
- // Future<void> calculateAsync() async {
- // if (ref.feature == null) return;
- // final feature = ref.feature!;
- // try {
- // if (ref.application is! URMApplication) {
- // return;
- // }
- // Size urmResultSize = const Size(0, 0);
- // final URMApplication urmApplication = ref.application as URMApplication;
- // urmResultSize = Size(urmApplication.resultWidth.toDouble(),
- // urmApplication.resultHeight.toDouble());
- // final List<DPoint> points =
- // feature.innerPoints.map((e) => e.scale2Size(urmResultSize)).toList();
- // // switch (type) {
- // // case MeasureTypes.SRTraceDensity:
- // // await getSRTraceVelResult(urmApplication, convertPoints(points));
- // // break;
- // // case MeasureTypes.SRTraceFractalDim:
- // // await getSRTraceFractalDimResult(
- // // urmApplication, convertPoints(points));
- // // break;
- // // default:
- // // }
- // } catch (e) {
- // logger.e('URM Measure error: $e');
- // return;
- // }
- // }
- // // //✅ URM 测量项 4
- // // Future<void> getSRTraceVelResult(
- // // URMApplication app, List<UrmPoint> points) async {
- // // String description = "URM\n Measuring";
- // // try {
- // // GetSRTraceVelResult? result = await app.getSRTraceVelResult(points);
- // // if (result != null) {
- // // print("URM Measure output: ${result.output} ");
- // // final feature = ref.feature!;
- // // for (var output in ref.meta.outputs) {
- // // if (output.name == MeasureTerms.URMDenROI) {
- // // output.unit = VidUsUnit.percent;
- // // feature.updateFloatValue(output, result.output, output.unit);
- // // }
- // // }
- // // } else {
- // // throw Exception("URM Measure API error");
- // // }
- // // } catch (e) {
- // // description = " ";
- // // updateStringValue(description);
- // // return;
- // // }
- // // ref.application.updateRenderReady.emit(this, null);
- // // }
- // // //✅ URM 测量项 5
- // // Future<void> getSRTraceFractalDimResult(
- // // URMApplication app, List<UrmPoint> points) async {
- // // String description = "URM\n Measuring";
- // // try {
- // // GetSRTraceFractalDimResult? result =
- // // await app.getSRTraceFractalDimResult(points);
- // // if (result != null) {
- // // print("URM Measure output: ${result.output} ");
- // // final feature = ref.feature!;
- // // for (var output in ref.meta.outputs) {
- // // if (output.name == MeasureTerms.URMDenFractalDim) {
- // // output.unit = VidUsUnit.None;
- // // feature.updateFloatValue(output, result.output, output.unit);
- // // }
- // // }
- // // } else {
- // // throw Exception("URM Measure API error");
- // // }
- // // } catch (e) {
- // // description = " ";
- // // updateStringValue(description);
- // // return;
- // // }
- // // ref.application.updateRenderReady.emit(this, null);
- // // }
- // List<UrmPoint> convertPoints(List<DPoint> points) {
- // List<UrmPoint> urmPoints = [];
- // for (var point in points) {
- // urmPoints.add(UrmPoint(x: point.x, y: point.y));
- // }
- // return urmPoints;
- // }
- // }
- // // class URMVelCal extends Calculator<URMVelAbstract, double> {
- // // URMVelCal(URMVelAbstract ref) : super(ref);
- // // @override
- // // void calculate() {
- // // if (ref.feature == null) return;
- // // final a1 = _pickChildValue(ref.child1);
- // // final a2 = _pickChildValue(ref.child2);
- // // final a3 = _pickChildValue(ref.child2);
- // // final feature = ref.feature!;
- // // final viewport = feature.hostVisualArea!.viewport!;
- // // // if (a1 != null && a2 != null) {
- // // // final value = GeneralFormulas.countStenosis(
- // // // a1,
- // // // a2,
- // // // );
- // // // updateFloatValue(value);
- // // // }
- // // }
- // // double? _pickChildValue(MeasureItem item) {
- // // if (item.calculator == null) return null;
- // // ValueBase? value;
- // // if (item.measuredFeatures.isNotEmpty) {
- // // value = item.measuredFeatures.first.value;
- // // } else if (item.feature != null) {
- // // value = item.feature!.value;
- // // }
- // // if (value != null && value is FloatValue) {
- // // return (value).value ?? 0;
- // // }
- // // return null;
- // // }
- // // }
- // class URMSrDensityCal extends Calculator<URMTwoSRRoiRectAbstract, double> {
- // URMSrDensityCal(URMTwoSRRoiRectAbstract ref) : super(ref);
- // @override
- // void calculate() {
- // if (ref.feature == null) return;
- // final a1 = _pickChildValue(ref.child1);
- // final a2 = _pickChildValue(ref.child2);
- // final a3 = _pickChildValue(ref.child2);
- // final feature = ref.feature!;
- // final viewport = feature.hostVisualArea!.viewport!;
- // // if (a1 != null && a2 != null) {
- // // final value = GeneralFormulas.countStenosis(
- // // a1,
- // // a2,
- // // );
- // // updateFloatValue(value);
- // // }
- // }
- // double? _pickChildValue(MeasureItem item) {
- // if (item.calculator == null) return null;
- // ValueBase? value;
- // if (item.measuredFeatures.isNotEmpty) {
- // value = item.measuredFeatures.first.value;
- // } else if (item.feature != null) {
- // value = item.feature!.value;
- // }
- // if (value != null && value is FloatValue) {
- // return (value).value ?? 0;
- // }
- // return null;
- // }
- // }
|