404 lines
9.8 KiB
Dart
404 lines
9.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../../utils/tooltip_message.dart';
|
|
import '../table/table_header_custom.dart';
|
|
import '../table/table_row_custom.dart';
|
|
|
|
Widget buildAllGLCM(List<String?> data){
|
|
print("DATA IS ${data.length}");
|
|
|
|
if (data.length <= 1){
|
|
List<String?> myList = List.filled(24, null);
|
|
data = myList;
|
|
}
|
|
|
|
return ListView.separated(
|
|
shrinkWrap: true,
|
|
itemBuilder: (ctx, index) {
|
|
if (index == 0) {
|
|
return const TableHeaderCustom(
|
|
title1: 'Properties',
|
|
title2: '0\u00B0',
|
|
title3: '45\u00B0',
|
|
title4: '90\u00B0',
|
|
title5: '135\u00B0');
|
|
}
|
|
|
|
if (index == 1){
|
|
return TableRowCustom(
|
|
property: 'Contrast',
|
|
val1: data[0],
|
|
val2: data[1],
|
|
val3: data[2],
|
|
val4: data[3],
|
|
tooltipMessage: tooltipMessageContrast,
|
|
);
|
|
}
|
|
|
|
if (index == 2){
|
|
return TableRowCustom(
|
|
property: 'Energy',
|
|
val1: data[4],
|
|
val2: data[5],
|
|
val3: data[6],
|
|
val4: data[7],
|
|
tooltipMessage: tooltipMessageEnergy,
|
|
);
|
|
}
|
|
|
|
if (index == 3){
|
|
return TableRowCustom(
|
|
property: 'Homogeneity',
|
|
val1: data[8],
|
|
val2: data[9],
|
|
val3: data[10],
|
|
val4: data[11],
|
|
tooltipMessage: tooltipMessageHomogeneity,
|
|
);
|
|
}
|
|
|
|
if (index == 4){
|
|
return TableRowCustom(
|
|
property: 'Correlation',
|
|
val1: data[12],
|
|
val2: data[13],
|
|
val3: data[14],
|
|
val4: data[15],
|
|
tooltipMessage: tooltipCorrelation,
|
|
);
|
|
}
|
|
|
|
if (index == 5){
|
|
return TableRowCustom(
|
|
property: 'ASM',
|
|
val1: data[16],
|
|
val2: data[17],
|
|
val3: data[18],
|
|
val4: data[19],
|
|
tooltipMessage: tooltipCorrelation,
|
|
);
|
|
}
|
|
|
|
if (index == 6){
|
|
return TableRowCustom(
|
|
property: 'Dissimilarity',
|
|
val1: data[20],
|
|
val2: data[21],
|
|
val3: data[22],
|
|
val4: data[23],
|
|
tooltipMessage: tooltipDissimilarity,
|
|
);
|
|
}
|
|
|
|
return SizedBox();
|
|
},
|
|
separatorBuilder: (ctx, index) => const Divider(color: Colors.black87),
|
|
itemCount: 7);
|
|
}
|
|
|
|
Widget buildPcaBreastGLCM(List<String?> data){
|
|
|
|
print("DATA IS ${data.length}");
|
|
|
|
if (data.length <= 1){
|
|
List<String?> myList = List.filled(16, null);
|
|
data = myList;
|
|
}
|
|
|
|
return ListView.separated(
|
|
shrinkWrap: true,
|
|
itemBuilder: (ctx, index) {
|
|
if (index == 0) {
|
|
return const TableHeaderCustom(
|
|
title1: 'Properties',
|
|
title2: '0\u00B0',
|
|
title3: '45\u00B0',
|
|
title4: '90\u00B0',
|
|
title5: '135\u00B0');
|
|
}
|
|
|
|
if (index == 1){
|
|
return TableRowCustom(
|
|
property: 'Contrast',
|
|
val1: data[0],
|
|
val2: data[1],
|
|
val3: data[2],
|
|
val4: data[3],
|
|
tooltipMessage: tooltipMessageContrast,
|
|
);
|
|
}
|
|
|
|
if (index == 2){
|
|
return TableRowCustom(
|
|
property: 'Energy',
|
|
val1: data[4],
|
|
val2: "-",
|
|
val3: data[5],
|
|
val4: "-",
|
|
tooltipMessage: tooltipMessageEnergy,
|
|
);
|
|
}
|
|
|
|
if (index == 3){
|
|
return TableRowCustom(
|
|
property: 'Homogeneity',
|
|
val1: data[6],
|
|
val2: data[7],
|
|
val3: data[8],
|
|
val4: data[9],
|
|
tooltipMessage: tooltipMessageHomogeneity
|
|
);
|
|
}
|
|
|
|
if (index == 4){
|
|
return TableRowCustom(
|
|
property: 'Dissimilarity',
|
|
val1: data[10],
|
|
val2: data[11],
|
|
val3: data[12],
|
|
val4: data[13],
|
|
tooltipMessage: tooltipDissimilarity,
|
|
);
|
|
}
|
|
|
|
return SizedBox();
|
|
},
|
|
separatorBuilder: (ctx, index) => const Divider(color: Colors.black87),
|
|
itemCount: 5);
|
|
}
|
|
|
|
Widget buildPcaCervixGLCM(List<String?> data){
|
|
|
|
print("DATA IS ${data.length}");
|
|
|
|
if (data.length <= 1){
|
|
List<String?> myList = List.filled(12, null);
|
|
data = myList;
|
|
}
|
|
|
|
return ListView.separated(
|
|
shrinkWrap: true,
|
|
itemBuilder: (ctx, index) {
|
|
if (index == 0) {
|
|
return const TableHeaderCustom(
|
|
title1: 'Properties',
|
|
title2: '0\u00B0',
|
|
title3: '45\u00B0',
|
|
title4: '90\u00B0',
|
|
title5: '135\u00B0');
|
|
}
|
|
|
|
if (index == 1){
|
|
return TableRowCustom(
|
|
property: 'Energy',
|
|
val1: data[0],
|
|
val2: data[1],
|
|
val3: data[2],
|
|
val4: data[3],
|
|
tooltipMessage: tooltipMessageEnergy,
|
|
);
|
|
}
|
|
|
|
if (index == 2){
|
|
return TableRowCustom(
|
|
property: 'Homogeneity',
|
|
val1: data[4],
|
|
val2: data[5],
|
|
val3: data[6],
|
|
val4: data[7],
|
|
tooltipMessage: tooltipMessageHomogeneity,
|
|
);
|
|
}
|
|
|
|
if (index == 3){
|
|
return TableRowCustom(
|
|
property: 'Dissimilarity',
|
|
val1: data[8],
|
|
val2: data[9],
|
|
val3: data[10],
|
|
val4: data[11],
|
|
tooltipMessage: tooltipDissimilarity,
|
|
);
|
|
}
|
|
|
|
if (index == 4){
|
|
return const TableRowCustom(
|
|
ignoreEmptyProperties: true,
|
|
property: '',
|
|
val1: '',
|
|
val2: '',
|
|
val3: '',
|
|
val4: '',
|
|
tooltipMessage: tooltipMessageEnergy,
|
|
);
|
|
}
|
|
|
|
return SizedBox();
|
|
},
|
|
separatorBuilder: (ctx, index) => const Divider(color: Colors.black87),
|
|
itemCount: 5);
|
|
}
|
|
|
|
Widget buildRegressionBreastGLCM(List<String?> data){
|
|
|
|
print("DATA IS ${data.length}");
|
|
|
|
if (data.length <= 1){
|
|
List<String?> myList = List.filled(20, null);
|
|
data = myList;
|
|
}
|
|
|
|
|
|
return ListView.separated(
|
|
shrinkWrap: true,
|
|
itemBuilder: (ctx, index) {
|
|
if (index == 0) {
|
|
return const TableHeaderCustom(
|
|
title1: 'Properties',
|
|
title2: '0\u00B0',
|
|
title3: '45\u00B0',
|
|
title4: '90\u00B0',
|
|
title5: '135\u00B0');
|
|
}
|
|
|
|
if (index == 1){
|
|
return TableRowCustom(
|
|
property: 'Contrast',
|
|
val1: "-",
|
|
val2: data[0],
|
|
val3: data[1],
|
|
val4: data[2],
|
|
tooltipMessage: tooltipMessageContrast,
|
|
);
|
|
}
|
|
|
|
if (index == 2){
|
|
return TableRowCustom(
|
|
property: 'Energy',
|
|
val1: "-",
|
|
val2: "-",
|
|
val3: data[3],
|
|
val4: "-",
|
|
tooltipMessage: tooltipMessageEnergy,
|
|
);
|
|
}
|
|
|
|
if (index == 3){
|
|
return TableRowCustom(
|
|
property: 'Homogeneity',
|
|
val1: "-",
|
|
val2: "-",
|
|
val3: data[4],
|
|
val4: "-",
|
|
tooltipMessage: tooltipMessageHomogeneity,
|
|
);
|
|
}
|
|
|
|
if (index == 4){
|
|
return TableRowCustom(
|
|
property: 'Correlation',
|
|
val1: "-",
|
|
val2: data[5],
|
|
val3: "-",
|
|
val4: data[6],
|
|
tooltipMessage: tooltipCorrelation,
|
|
);
|
|
}
|
|
|
|
if (index == 5){
|
|
return TableRowCustom(
|
|
property: 'Dissimilarity',
|
|
val1: "-",
|
|
val2: data[7],
|
|
val3: data[8],
|
|
val4: "-",
|
|
tooltipMessage: tooltipDissimilarity,
|
|
);
|
|
}
|
|
|
|
return SizedBox();
|
|
},
|
|
separatorBuilder: (ctx, index) => const Divider(color: Colors.black87),
|
|
itemCount: 6);
|
|
}
|
|
|
|
Widget buildRegressionCervixGLCM(List<String?> data){
|
|
print("DATA IS ${data.length}");
|
|
|
|
if (data.length <= 1){
|
|
List<String?> myList = List.filled(20, null);
|
|
data = myList;
|
|
}
|
|
|
|
return ListView.separated(
|
|
shrinkWrap: true,
|
|
itemBuilder: (ctx, index) {
|
|
if (index == 0) {
|
|
return const TableHeaderCustom(
|
|
title1: 'Properties',
|
|
title2: '0\u00B0',
|
|
title3: '45\u00B0',
|
|
title4: '90\u00B0',
|
|
title5: '135\u00B0');
|
|
}
|
|
|
|
if (index == 1){
|
|
return TableRowCustom(
|
|
property: 'Contrast',
|
|
val1: data[0],
|
|
val2: data[1],
|
|
val3: "-",
|
|
val4: data[2],
|
|
tooltipMessage: tooltipMessageContrast,
|
|
);
|
|
}
|
|
|
|
if (index == 2){
|
|
return TableRowCustom(
|
|
property: 'Energy',
|
|
val1: data[3],
|
|
val2: data[4],
|
|
val3: "-",
|
|
val4: data[5],
|
|
tooltipMessage: tooltipMessageEnergy,
|
|
);
|
|
}
|
|
|
|
if (index == 3){
|
|
return TableRowCustom(
|
|
property: 'Correlation',
|
|
val1: data[6],
|
|
val2: data[7],
|
|
val3: data[8],
|
|
val4: data[9],
|
|
tooltipMessage: tooltipCorrelation,
|
|
);
|
|
}
|
|
|
|
if (index == 4){
|
|
return TableRowCustom(
|
|
property: 'ASM',
|
|
val1: data[10],
|
|
val2: data[11],
|
|
val3: data[12],
|
|
val4: "-",
|
|
tooltipMessage: tooltipCorrelation,
|
|
);
|
|
}
|
|
|
|
if (index == 5){
|
|
return TableRowCustom(
|
|
property: 'Dissimilarity',
|
|
val1: "-",
|
|
val2: data[13],
|
|
val3: "-",
|
|
val4: "-",
|
|
tooltipMessage: tooltipDissimilarity,
|
|
);
|
|
}
|
|
|
|
return SizedBox();
|
|
},
|
|
separatorBuilder: (ctx, index) => const Divider(color: Colors.black87),
|
|
itemCount: 6);
|
|
} |