123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- enum DiagnosisOrganEnum {
- Null,
- placeHolder_1,
- Breast,
- Abdomen,
- Liver,
- Cholecyst,
- Kidney,
- Spleen,
- CarotidArtery,
- Thyroid,
- Neck,
- }
- class AIDiagnosisRect {
- int right;
- int bottom;
- int left;
- int top;
- int width;
- int height;
- AIDiagnosisRect({
- this.right = 0,
- this.bottom = 0,
- this.left = 0,
- this.top = 0,
- this.width = 0,
- this.height = 0,
- });
- factory AIDiagnosisRect.fromJson(Map<String, dynamic> map) {
- return AIDiagnosisRect(
- right: map['Right'],
- bottom: map['Bottom'],
- left: map['Left'],
- top: map['Top'],
- width: map['Width'],
- height: map['Height'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = <String, dynamic>{};
- map['Right'] = right;
- map['Bottom'] = bottom;
- map['Left'] = left;
- map['Top'] = top;
- map['Width'] = width;
- map['Height'] = height;
- return map;
- }
- }
- class AIDiagnosisPoint2D {
- int x;
- int y;
- AIDiagnosisPoint2D({
- this.x = 0,
- this.y = 0,
- });
- factory AIDiagnosisPoint2D.fromJson(Map<String, dynamic> map) {
- return AIDiagnosisPoint2D(
- x: map['X'],
- y: map['Y'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = <String, dynamic>{};
- map['X'] = x;
- map['Y'] = y;
- return map;
- }
- }
- enum DiagnosisDescriptionEnum {
- Shape,
- Orientation,
- EchoPattern,
- LesionBoundary,
- Margin,
- Calcification,
- LesionSize,
- }
- class AIDiagnosisDescription {
- DiagnosisDescriptionEnum type;
- String? value;
- AIDiagnosisDescription({
- this.type = DiagnosisDescriptionEnum.Shape,
- this.value,
- });
- factory AIDiagnosisDescription.fromJson(Map<String, dynamic> map) {
- return AIDiagnosisDescription(
- type: DiagnosisDescriptionEnum.values
- .firstWhere((e) => e.index == map['Type']),
- value: map['Value'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = <String, dynamic>{};
- map['Type'] = type.index;
- if (value != null) map['Value'] = value;
- return map;
- }
- }
- class AIDetectedObject {
- int label;
- double confidence;
- AIDiagnosisRect? boundingBox;
- List<AIDiagnosisPoint2D>? contours;
- List<AIDiagnosisDescription>? descriptions;
- AIDetectedObject({
- this.label = 0,
- this.confidence = 0,
- this.boundingBox,
- this.contours,
- this.descriptions,
- });
- factory AIDetectedObject.fromJson(Map<String, dynamic> map) {
- return AIDetectedObject(
- label: map['Label'],
- confidence: map['Confidence'],
- boundingBox: map['BoundingBox'] != null
- ? AIDiagnosisRect.fromJson(map['BoundingBox'])
- : null,
- contours: map['Contours'] != null
- ? (map['Contours'] as List)
- .map(
- (e) => AIDiagnosisPoint2D.fromJson(e as Map<String, dynamic>))
- .toList()
- : null,
- descriptions: map['Descriptions'] != null
- ? (map['Descriptions'] as List)
- .map((e) =>
- AIDiagnosisDescription.fromJson(e as Map<String, dynamic>))
- .toList()
- : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = <String, dynamic>{};
- map['Label'] = label;
- map['Confidence'] = confidence;
- if (boundingBox != null) map['BoundingBox'] = boundingBox;
- if (contours != null) map['Contours'] = contours;
- if (descriptions != null) map['Descriptions'] = descriptions;
- return map;
- }
- }
- class AIDiagnosisResultPerOrgan {
- DiagnosisOrganEnum organ;
- AIDiagnosisRect? organBoundBox;
- List<AIDiagnosisPoint2D>? organContours;
- List<AIDiagnosisDescription>? organDescriptions;
- List<AIDetectedObject>? detectedObjects;
- AIDiagnosisResultPerOrgan({
- this.organ = DiagnosisOrganEnum.Null,
- this.organBoundBox,
- this.organContours,
- this.organDescriptions,
- this.detectedObjects,
- });
- factory AIDiagnosisResultPerOrgan.fromJson(Map<String, dynamic> map) {
- return AIDiagnosisResultPerOrgan(
- organ:
- DiagnosisOrganEnum.values.firstWhere((e) => e.index == map['Organ']),
- organBoundBox: map['OrganBoundBox'] != null
- ? AIDiagnosisRect.fromJson(map['OrganBoundBox'])
- : null,
- organContours: map['OrganContours'] != null
- ? (map['OrganContours'] as List)
- .map(
- (e) => AIDiagnosisPoint2D.fromJson(e as Map<String, dynamic>))
- .toList()
- : null,
- organDescriptions: map['OrganDescriptions'] != null
- ? (map['OrganDescriptions'] as List)
- .map((e) =>
- AIDiagnosisDescription.fromJson(e as Map<String, dynamic>))
- .toList()
- : null,
- detectedObjects: map['DetectedObjects'] != null
- ? (map['DetectedObjects'] as List)
- .map((e) => AIDetectedObject.fromJson(e as Map<String, dynamic>))
- .toList()
- : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = <String, dynamic>{};
- map['Organ'] = organ.index;
- if (organBoundBox != null) map['OrganBoundBox'] = organBoundBox;
- if (organContours != null) map['OrganContours'] = organContours;
- if (organDescriptions != null) map['OrganDescriptions'] = organDescriptions;
- if (detectedObjects != null) map['DetectedObjects'] = detectedObjects;
- return map;
- }
- }
- class AIDiagnosisPerImageDTO {
- int index;
- double priorityScore;
- List<AIDiagnosisResultPerOrgan>? diagResultsForEachOrgan;
- AIDiagnosisPerImageDTO({
- this.index = 0,
- this.priorityScore = 0,
- this.diagResultsForEachOrgan,
- });
- factory AIDiagnosisPerImageDTO.fromJson(Map<String, dynamic> map) {
- return AIDiagnosisPerImageDTO(
- index: map['Index'],
- priorityScore: map['PriorityScore'],
- diagResultsForEachOrgan: map['DiagResultsForEachOrgan'] != null
- ? (map['DiagResultsForEachOrgan'] as List)
- .map((e) =>
- AIDiagnosisResultPerOrgan.fromJson(e as Map<String, dynamic>))
- .toList()
- : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = <String, dynamic>{};
- map['Index'] = index;
- map['PriorityScore'] = priorityScore;
- if (diagResultsForEachOrgan != null) {
- map['DiagResultsForEachOrgan'] = diagResultsForEachOrgan;
- }
- return map;
- }
- }
|