123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import 'package:fis_measure/interfaces/date_types/point.dart';
- import 'package:fis_measure/interfaces/date_types/skew_transform.dart';
- import 'package:fis_measure/interfaces/process/physical_coordinates/physical_coordinate.dart';
- import 'package:vid/us/vid_us_physical_coordinate.dart';
- import 'package:vid/us/vid_us_visual_area_type.dart';
- /// 二维线阵物理坐标系
- class LinearTissuePhysicalCoordinate implements ITissuePhysicalCoordinate {
- // ignore: non_constant_identifier_names
- static final DPoint C_INVALID_POINT = DPoint(double.nan, double.nan);
- late final double _depthStart;
- late final double _depthEnd;
- late final double _width;
- late final double _beamPosition;
- late final double _steer;
- late final DSkewTransform _logicalToPhysicalConvert;
- late final DSkewTransform _logicalToPhysicalConvertBack;
- LinearTissuePhysicalCoordinate(
- VidUsLinearTissuePhysicalCoordinate vidData,
- ) {
- _depthStart = vidData.depthStart;
- _depthEnd = vidData.depthEnd;
- _width = vidData.width;
- _beamPosition = vidData.beamPosition;
- _steer = vidData.steer;
- _logicalToPhysicalConvertBack = DSkewTransform(
- _steer,
- 0,
- 0,
- (_depthEnd - _depthStart) / 2,
- );
- _logicalToPhysicalConvert = _logicalToPhysicalConvertBack.inverse;
- }
- @override
- VidUsVisualAreaType get areaType => VidUsVisualAreaType.Tissue;
- @override
- double get depthEnd => _depthEnd;
- @override
- double get depthStart => _depthStart;
- @override
- double get width => _width;
- @override
- double get beamPosition => _beamPosition;
- /// 图像顺时针旋转的y轴旋转角度
- ///
- /// 单位:degrees
- double get steer => _steer;
- @override
- DPoint convert(DPoint pointInLogical) {
- return _logicalToPhysicalConvert.transform(pointInLogical);
- }
- @override
- DPoint convertBack(DPoint pointInPhysical) {
- return _logicalToPhysicalConvertBack.transform(pointInPhysical);
- }
- }
|