|
@@ -19,13 +19,13 @@ class VidUsPhysicalCoordinate {
|
|
|
late PhysicalCoordinateType _type;
|
|
|
|
|
|
Uint8List toBytes() {
|
|
|
- var writer = new VidUsDataWriter();
|
|
|
+ var writer = VidUsDataWriter();
|
|
|
writer.writeByte(_type.index);
|
|
|
return writer.data;
|
|
|
}
|
|
|
|
|
|
static VidUsPhysicalCoordinate fromBytes(Uint8List bytes) {
|
|
|
- var reader = new VidUsDataReader(bytes);
|
|
|
+ var reader = VidUsDataReader(bytes);
|
|
|
var type = PhysicalCoordinateType.values[reader.readByte()];
|
|
|
switch (type) {
|
|
|
case PhysicalCoordinateType.ConvexTissue:
|
|
@@ -45,7 +45,7 @@ class VidUsPhysicalCoordinate {
|
|
|
case PhysicalCoordinateType.PWV:
|
|
|
return VidUsPWVPhysicalCoordinate.fromBytes(bytes);
|
|
|
default:
|
|
|
- throw new Exception("Not supported CoordinateType $type");
|
|
|
+ throw Exception("Not supported CoordinateType $type");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -78,7 +78,7 @@ class VidUsTissuePhysicalCoordinate extends VidUsPhysicalCoordinate {
|
|
|
|
|
|
@override
|
|
|
Uint8List toBytes() {
|
|
|
- var writer = new VidUsDataWriter();
|
|
|
+ var writer = VidUsDataWriter();
|
|
|
var baseData = super.toBytes();
|
|
|
writer.writeBytes(baseData);
|
|
|
writer.writeDouble(_depthStart);
|
|
@@ -111,7 +111,7 @@ class VidUsTimeMotionPhysicalCoordinate extends VidUsPhysicalCoordinate {
|
|
|
|
|
|
@override
|
|
|
Uint8List toBytes() {
|
|
|
- var writer = new VidUsDataWriter();
|
|
|
+ var writer = VidUsDataWriter();
|
|
|
var baseData = super.toBytes();
|
|
|
writer.writeBytes(baseData);
|
|
|
writer.writeDouble(_min);
|
|
@@ -135,7 +135,7 @@ class VidUsConvexTissuePhysicalCoordinate
|
|
|
|
|
|
@override
|
|
|
Uint8List toBytes() {
|
|
|
- var writer = new VidUsDataWriter();
|
|
|
+ var writer = VidUsDataWriter();
|
|
|
var baseData = super.toBytes();
|
|
|
writer.writeBytes(baseData);
|
|
|
writer.writeDouble(_zeroRadius);
|
|
@@ -143,10 +143,10 @@ class VidUsConvexTissuePhysicalCoordinate
|
|
|
}
|
|
|
|
|
|
static VidUsPhysicalCoordinate fromBytes(Uint8List bytes) {
|
|
|
- var reader = new VidUsDataReader(bytes);
|
|
|
+ var reader = VidUsDataReader(bytes);
|
|
|
var type = PhysicalCoordinateType.values[reader.readByte()];
|
|
|
if (type != PhysicalCoordinateType.ConvexTissue) {
|
|
|
- throw new Exception(
|
|
|
+ throw Exception(
|
|
|
"Type not matched, target type:{$PhysicalCoordinateType.ConvexTissue)}, source type:{$type}");
|
|
|
}
|
|
|
var depthStart = reader.readDouble();
|
|
@@ -154,7 +154,7 @@ class VidUsConvexTissuePhysicalCoordinate
|
|
|
var width = reader.readDouble();
|
|
|
var beamPosition = reader.readDouble();
|
|
|
var zeroRadius = reader.readDouble();
|
|
|
- return new VidUsConvexTissuePhysicalCoordinate(
|
|
|
+ return VidUsConvexTissuePhysicalCoordinate(
|
|
|
depthEnd, depthStart, width, beamPosition, zeroRadius);
|
|
|
}
|
|
|
}
|
|
@@ -174,7 +174,7 @@ class VidUsLinearTissuePhysicalCoordinate
|
|
|
|
|
|
@override
|
|
|
Uint8List toBytes() {
|
|
|
- var writer = new VidUsDataWriter();
|
|
|
+ var writer = VidUsDataWriter();
|
|
|
var baseData = super.toBytes();
|
|
|
writer.writeBytes(baseData);
|
|
|
writer.writeDouble(_steer);
|
|
@@ -182,10 +182,10 @@ class VidUsLinearTissuePhysicalCoordinate
|
|
|
}
|
|
|
|
|
|
static VidUsPhysicalCoordinate fromBytes(Uint8List bytes) {
|
|
|
- var reader = new VidUsDataReader(bytes);
|
|
|
+ var reader = VidUsDataReader(bytes);
|
|
|
var type = PhysicalCoordinateType.values[reader.readByte()];
|
|
|
if (type != PhysicalCoordinateType.LinearTissue) {
|
|
|
- throw new Exception(
|
|
|
+ throw Exception(
|
|
|
"Type not matched, target type:{$PhysicalCoordinateType.LinearTissue}, source type:{$type}");
|
|
|
}
|
|
|
var depthStart = reader.readDouble();
|
|
@@ -193,7 +193,7 @@ class VidUsLinearTissuePhysicalCoordinate
|
|
|
var width = reader.readDouble();
|
|
|
var beamPosition = reader.readDouble();
|
|
|
var steer = reader.readDouble();
|
|
|
- return new VidUsLinearTissuePhysicalCoordinate(
|
|
|
+ return VidUsLinearTissuePhysicalCoordinate(
|
|
|
depthEnd, depthStart, width, beamPosition, steer);
|
|
|
}
|
|
|
}
|
|
@@ -222,7 +222,7 @@ class VidUsConvexTVTissuePhysicalCoordinate
|
|
|
}
|
|
|
|
|
|
Uint8List toBytes() {
|
|
|
- var writer = new VidUsDataWriter();
|
|
|
+ var writer = VidUsDataWriter();
|
|
|
var baseData = super.toBytes();
|
|
|
writer.writeBytes(baseData);
|
|
|
writer.writeDouble(_originalZeroRadius);
|
|
@@ -231,10 +231,10 @@ class VidUsConvexTVTissuePhysicalCoordinate
|
|
|
}
|
|
|
|
|
|
static VidUsPhysicalCoordinate fromBytes(Uint8List bytes) {
|
|
|
- var reader = new VidUsDataReader(bytes);
|
|
|
+ var reader = VidUsDataReader(bytes);
|
|
|
var type = PhysicalCoordinateType.values[reader.readByte()];
|
|
|
if (type != PhysicalCoordinateType.ConvexTVTissue) {
|
|
|
- throw new Exception(
|
|
|
+ throw Exception(
|
|
|
"Type not matched, target type:{$PhysicalCoordinateType.ConvexTVTissue}, source type:{$type}");
|
|
|
}
|
|
|
var depthStart = reader.readDouble();
|
|
@@ -244,7 +244,7 @@ class VidUsConvexTVTissuePhysicalCoordinate
|
|
|
var zeroRadius = reader.readDouble();
|
|
|
var originalZeroRadius = reader.readDouble();
|
|
|
var originalRocx = reader.readDouble();
|
|
|
- return new VidUsConvexTVTissuePhysicalCoordinate(depthEnd, depthStart,
|
|
|
+ return VidUsConvexTVTissuePhysicalCoordinate(depthEnd, depthStart,
|
|
|
width, beamPosition, zeroRadius, originalZeroRadius, originalRocx);
|
|
|
}
|
|
|
}
|
|
@@ -258,10 +258,10 @@ class VidUsLinearTVTissuePhysicalCoordinate
|
|
|
}
|
|
|
|
|
|
static VidUsPhysicalCoordinate fromBytes(Uint8List bytes) {
|
|
|
- var reader = new VidUsDataReader(bytes);
|
|
|
+ var reader = VidUsDataReader(bytes);
|
|
|
var type = PhysicalCoordinateType.values[reader.readByte()];
|
|
|
if (type != PhysicalCoordinateType.LinearTVTissue) {
|
|
|
- throw new Exception(
|
|
|
+ throw Exception(
|
|
|
"Type not matched, target type:{$PhysicalCoordinateType.LinearTVTissue}, source type:{$type}");
|
|
|
}
|
|
|
var depthStart = reader.readDouble();
|
|
@@ -269,7 +269,7 @@ class VidUsLinearTVTissuePhysicalCoordinate
|
|
|
var width = reader.readDouble();
|
|
|
var beamPosition = reader.readDouble();
|
|
|
var zeroRadius = reader.readDouble();
|
|
|
- return new VidUsLinearTVTissuePhysicalCoordinate(
|
|
|
+ return VidUsLinearTVTissuePhysicalCoordinate(
|
|
|
depthEnd, depthStart, width, beamPosition, zeroRadius);
|
|
|
}
|
|
|
}
|
|
@@ -288,7 +288,7 @@ class VidUsDopplerPhysicalCoordinate extends VidUsTimeMotionPhysicalCoordinate {
|
|
|
|
|
|
@override
|
|
|
Uint8List toBytes() {
|
|
|
- var writer = new VidUsDataWriter();
|
|
|
+ var writer = VidUsDataWriter();
|
|
|
var baseData = super.toBytes();
|
|
|
writer.writeBytes(baseData);
|
|
|
writer.writeDouble(_baseLine);
|
|
@@ -296,17 +296,17 @@ class VidUsDopplerPhysicalCoordinate extends VidUsTimeMotionPhysicalCoordinate {
|
|
|
}
|
|
|
|
|
|
static VidUsPhysicalCoordinate fromBytes(Uint8List bytes) {
|
|
|
- var reader = new VidUsDataReader(bytes);
|
|
|
+ var reader = VidUsDataReader(bytes);
|
|
|
var type = PhysicalCoordinateType.values[reader.readByte()];
|
|
|
if (type != PhysicalCoordinateType.Doppler) {
|
|
|
- throw new Exception(
|
|
|
+ throw Exception(
|
|
|
"Type not matched, target type:{$PhysicalCoordinateType.Doppler}, source type:{$type}");
|
|
|
}
|
|
|
var min = reader.readDouble();
|
|
|
var max = reader.readDouble();
|
|
|
var sweepSpeed = reader.readDouble();
|
|
|
var baseLine = reader.readDouble();
|
|
|
- return new VidUsDopplerPhysicalCoordinate(sweepSpeed, max, min, baseLine);
|
|
|
+ return VidUsDopplerPhysicalCoordinate(sweepSpeed, max, min, baseLine);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -329,7 +329,7 @@ class VidUsTissueTimeMotionPhysicalCoordinate
|
|
|
}
|
|
|
|
|
|
Uint8List toBytes() {
|
|
|
- var writer = new VidUsDataWriter();
|
|
|
+ var writer = VidUsDataWriter();
|
|
|
var baseData = super.toBytes();
|
|
|
writer.writeBytes(baseData);
|
|
|
writer.writeDouble(_depthStart);
|
|
@@ -338,10 +338,10 @@ class VidUsTissueTimeMotionPhysicalCoordinate
|
|
|
}
|
|
|
|
|
|
static VidUsPhysicalCoordinate fromBytes(Uint8List bytes) {
|
|
|
- var reader = new VidUsDataReader(bytes);
|
|
|
+ var reader = VidUsDataReader(bytes);
|
|
|
var type = PhysicalCoordinateType.values[reader.readByte()];
|
|
|
if (type != PhysicalCoordinateType.TissueTimeMotion) {
|
|
|
- throw new Exception(
|
|
|
+ throw Exception(
|
|
|
"Type not matched, target type:{$PhysicalCoordinateType.TissueTimeMotion}, source type:{$type}");
|
|
|
}
|
|
|
var min = reader.readDouble();
|
|
@@ -349,7 +349,7 @@ class VidUsTissueTimeMotionPhysicalCoordinate
|
|
|
var sweepSpeed = reader.readDouble();
|
|
|
var depthStart = reader.readDouble();
|
|
|
var depthEnd = reader.readDouble();
|
|
|
- return new VidUsTissueTimeMotionPhysicalCoordinate(
|
|
|
+ return VidUsTissueTimeMotionPhysicalCoordinate(
|
|
|
sweepSpeed, max, min, depthStart, depthEnd);
|
|
|
}
|
|
|
}
|
|
@@ -363,10 +363,10 @@ class VidUsMAMPhysicalCoordinate
|
|
|
}
|
|
|
|
|
|
static VidUsPhysicalCoordinate fromBytes(Uint8List bytes) {
|
|
|
- var reader = new VidUsDataReader(bytes);
|
|
|
+ var reader = VidUsDataReader(bytes);
|
|
|
var type = PhysicalCoordinateType.values[reader.readByte()];
|
|
|
if (type != PhysicalCoordinateType.MAM) {
|
|
|
- throw new Exception(
|
|
|
+ throw Exception(
|
|
|
"Type not matched, target type:{$PhysicalCoordinateType.MAM}, source type:{$type}");
|
|
|
}
|
|
|
|
|
@@ -375,7 +375,7 @@ class VidUsMAMPhysicalCoordinate
|
|
|
var sweepSpeed = reader.readDouble();
|
|
|
var depthStart = reader.readDouble();
|
|
|
var depthEnd = reader.readDouble();
|
|
|
- return new VidUsMAMPhysicalCoordinate(
|
|
|
+ return VidUsMAMPhysicalCoordinate(
|
|
|
sweepSpeed, max, min, depthStart, depthEnd);
|
|
|
}
|
|
|
}
|
|
@@ -389,10 +389,10 @@ class VidUsPWVPhysicalCoordinate
|
|
|
}
|
|
|
|
|
|
static VidUsPhysicalCoordinate fromBytes(Uint8List bytes) {
|
|
|
- var reader = new VidUsDataReader(bytes);
|
|
|
+ var reader = VidUsDataReader(bytes);
|
|
|
var type = PhysicalCoordinateType.values[reader.readByte()];
|
|
|
if (type != PhysicalCoordinateType.PWV) {
|
|
|
- throw new Exception(
|
|
|
+ throw Exception(
|
|
|
"Type not matched, target type:{$PhysicalCoordinateType.PWV}, source type:{$type}");
|
|
|
}
|
|
|
|
|
@@ -401,7 +401,7 @@ class VidUsPWVPhysicalCoordinate
|
|
|
var sweepSpeed = reader.readDouble();
|
|
|
var depthStart = reader.readDouble();
|
|
|
var depthEnd = reader.readDouble();
|
|
|
- return new VidUsPWVPhysicalCoordinate(
|
|
|
+ return VidUsPWVPhysicalCoordinate(
|
|
|
sweepSpeed, max, min, depthStart, depthEnd);
|
|
|
}
|
|
|
}
|