sgtlib 3.3.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- StructuralGT/__init__.py +31 -0
- StructuralGT/apps/__init__.py +0 -0
- StructuralGT/apps/cli_main.py +258 -0
- StructuralGT/apps/gui_main.py +69 -0
- StructuralGT/apps/gui_mcw/__init__.py +0 -0
- StructuralGT/apps/gui_mcw/checkbox_model.py +91 -0
- StructuralGT/apps/gui_mcw/controller.py +1073 -0
- StructuralGT/apps/gui_mcw/image_provider.py +74 -0
- StructuralGT/apps/gui_mcw/imagegrid_model.py +75 -0
- StructuralGT/apps/gui_mcw/qthread_worker.py +102 -0
- StructuralGT/apps/gui_mcw/table_model.py +79 -0
- StructuralGT/apps/gui_mcw/tree_model.py +154 -0
- StructuralGT/apps/sgt_qml/CenterMainContent.qml +19 -0
- StructuralGT/apps/sgt_qml/LeftContent.qml +48 -0
- StructuralGT/apps/sgt_qml/MainWindow.qml +762 -0
- StructuralGT/apps/sgt_qml/RightLoggingPanel.qml +125 -0
- StructuralGT/apps/sgt_qml/assets/icons/.DS_Store +0 -0
- StructuralGT/apps/sgt_qml/assets/icons/back_icon.png +0 -0
- StructuralGT/apps/sgt_qml/assets/icons/brightness_icon.png +0 -0
- StructuralGT/apps/sgt_qml/assets/icons/cancel_icon.png +0 -0
- StructuralGT/apps/sgt_qml/assets/icons/crop_icon.png +0 -0
- StructuralGT/apps/sgt_qml/assets/icons/edit_icon.png +0 -0
- StructuralGT/apps/sgt_qml/assets/icons/graph_icon.png +0 -0
- StructuralGT/apps/sgt_qml/assets/icons/hide_panel.png +0 -0
- StructuralGT/apps/sgt_qml/assets/icons/next_icon.png +0 -0
- StructuralGT/apps/sgt_qml/assets/icons/notify_icon.png +0 -0
- StructuralGT/apps/sgt_qml/assets/icons/rescale_icon.png +0 -0
- StructuralGT/apps/sgt_qml/assets/icons/show_panel.png +0 -0
- StructuralGT/apps/sgt_qml/assets/icons/square_icon.png +0 -0
- StructuralGT/apps/sgt_qml/assets/icons/undo_icon.png +0 -0
- StructuralGT/apps/sgt_qml/components/ImageFilters.qml +82 -0
- StructuralGT/apps/sgt_qml/components/ImageProperties.qml +112 -0
- StructuralGT/apps/sgt_qml/components/ProjectNav.qml +127 -0
- StructuralGT/apps/sgt_qml/widgets/BinaryFilterWidget.qml +151 -0
- StructuralGT/apps/sgt_qml/widgets/BrightnessControlWidget.qml +103 -0
- StructuralGT/apps/sgt_qml/widgets/CreateProjectWidget.qml +112 -0
- StructuralGT/apps/sgt_qml/widgets/GTWidget.qml +94 -0
- StructuralGT/apps/sgt_qml/widgets/GraphComputeWidget.qml +77 -0
- StructuralGT/apps/sgt_qml/widgets/GraphExtractWidget.qml +175 -0
- StructuralGT/apps/sgt_qml/widgets/GraphPropertyWidget.qml +77 -0
- StructuralGT/apps/sgt_qml/widgets/ImageFilterWidget.qml +137 -0
- StructuralGT/apps/sgt_qml/widgets/ImagePropertyWidget.qml +78 -0
- StructuralGT/apps/sgt_qml/widgets/ImageViewWidget.qml +585 -0
- StructuralGT/apps/sgt_qml/widgets/MenuBarWidget.qml +137 -0
- StructuralGT/apps/sgt_qml/widgets/MicroscopyPropertyWidget.qml +80 -0
- StructuralGT/apps/sgt_qml/widgets/ProjectWidget.qml +141 -0
- StructuralGT/apps/sgt_qml/widgets/RescaleControlWidget.qml +83 -0
- StructuralGT/apps/sgt_qml/widgets/RibbonWidget.qml +406 -0
- StructuralGT/apps/sgt_qml/widgets/StatusBarWidget.qml +173 -0
- StructuralGT/compute/__init__.py +0 -0
- StructuralGT/compute/c_lang/include/sgt_base.h +21 -0
- StructuralGT/compute/graph_analyzer.py +1499 -0
- StructuralGT/entrypoints.py +49 -0
- StructuralGT/imaging/__init__.py +0 -0
- StructuralGT/imaging/base_image.py +403 -0
- StructuralGT/imaging/image_processor.py +780 -0
- StructuralGT/modules.py +29 -0
- StructuralGT/networks/__init__.py +0 -0
- StructuralGT/networks/fiber_network.py +490 -0
- StructuralGT/networks/graph_skeleton.py +425 -0
- StructuralGT/networks/sknw_mod.py +199 -0
- StructuralGT/utils/__init__.py +0 -0
- StructuralGT/utils/config_loader.py +244 -0
- StructuralGT/utils/configs.ini +97 -0
- StructuralGT/utils/progress_update.py +67 -0
- StructuralGT/utils/sgt_utils.py +291 -0
- sgtlib-3.3.9.dist-info/METADATA +789 -0
- sgtlib-3.3.9.dist-info/RECORD +72 -0
- sgtlib-3.3.9.dist-info/WHEEL +5 -0
- sgtlib-3.3.9.dist-info/entry_points.txt +3 -0
- sgtlib-3.3.9.dist-info/licenses/LICENSE +674 -0
- sgtlib-3.3.9.dist-info/top_level.txt +1 -0
@@ -0,0 +1,137 @@
|
|
1
|
+
import QtQuick
|
2
|
+
import QtQuick.Controls
|
3
|
+
import QtQuick.Layouts
|
4
|
+
|
5
|
+
|
6
|
+
Item {
|
7
|
+
id: imgFiltersControl // used for external access
|
8
|
+
Layout.preferredHeight: 250
|
9
|
+
Layout.preferredWidth: parent.width
|
10
|
+
enabled: mainController.display_image();
|
11
|
+
|
12
|
+
property int cbxWidthSize: 100
|
13
|
+
property int spbWidthSize: 170
|
14
|
+
property int sldWidthSize: 140
|
15
|
+
property int lblWidthSize: 50
|
16
|
+
property int valueRole: Qt.UserRole + 4
|
17
|
+
property int dataValueRole: Qt.UserRole + 6
|
18
|
+
|
19
|
+
|
20
|
+
ColumnLayout {
|
21
|
+
id: imgFiltersCtrlLayout
|
22
|
+
spacing: 10
|
23
|
+
|
24
|
+
Repeater {
|
25
|
+
model: imgFilterModel
|
26
|
+
delegate: RowLayout {
|
27
|
+
Layout.fillWidth: true
|
28
|
+
Layout.leftMargin: 10
|
29
|
+
Layout.alignment: Qt.AlignLeft
|
30
|
+
|
31
|
+
CheckBox {
|
32
|
+
id: checkBox
|
33
|
+
objectName: model.id
|
34
|
+
Layout.preferredWidth: cbxWidthSize
|
35
|
+
text: model.text
|
36
|
+
property bool isChecked: model.value
|
37
|
+
checked: isChecked
|
38
|
+
onCheckedChanged: {
|
39
|
+
if (isChecked !== checked) { // Only update if there is a change
|
40
|
+
isChecked = checked
|
41
|
+
let val = checked ? 1 : 0;
|
42
|
+
var index = imgFilterModel.index(model.index, 0);
|
43
|
+
imgFilterModel.setData(index, val, valueRole);
|
44
|
+
mainController.apply_img_filter_changes()
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
Loader {
|
50
|
+
id: controlLoader
|
51
|
+
sourceComponent: (model.id === "apply_median_filter" || model.id === "apply_scharr_gradient") ? blankComponent : model.id === "apply_lowpass_filter" ? spinComponent : sliderComponent
|
52
|
+
}
|
53
|
+
|
54
|
+
Component {
|
55
|
+
id: blankComponent
|
56
|
+
|
57
|
+
RowLayout {
|
58
|
+
Layout.fillWidth: true
|
59
|
+
Layout.bottomMargin: 10
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
Component {
|
64
|
+
id: spinComponent
|
65
|
+
|
66
|
+
RowLayout {
|
67
|
+
Layout.fillWidth: true
|
68
|
+
SpinBox {
|
69
|
+
id: spinbox
|
70
|
+
objectName: model.dataId
|
71
|
+
Layout.minimumWidth: spbWidthSize
|
72
|
+
Layout.fillWidth: true
|
73
|
+
enabled: checkBox.checked
|
74
|
+
from: model.minValue
|
75
|
+
to: model.maxValue
|
76
|
+
stepSize: model.stepSize
|
77
|
+
property var currSBVal: model.dataValue
|
78
|
+
value: currSBVal
|
79
|
+
onValueChanged: updateValue(currSBVal, value)
|
80
|
+
}
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
Component {
|
85
|
+
id: sliderComponent
|
86
|
+
|
87
|
+
RowLayout {
|
88
|
+
Layout.fillWidth: true
|
89
|
+
|
90
|
+
Slider {
|
91
|
+
id: slider
|
92
|
+
objectName: model.dataId
|
93
|
+
Layout.minimumWidth: sldWidthSize
|
94
|
+
Layout.fillWidth: true
|
95
|
+
enabled: checkBox.checked
|
96
|
+
from: model.minValue
|
97
|
+
to: model.maxValue
|
98
|
+
stepSize: model.stepSize
|
99
|
+
property var currVal: model.dataValue
|
100
|
+
value: currVal
|
101
|
+
onValueChanged: updateValue(currVal, value)
|
102
|
+
}
|
103
|
+
|
104
|
+
Label {
|
105
|
+
id: label
|
106
|
+
Layout.preferredWidth: lblWidthSize
|
107
|
+
text: model.stepSize >= 1 ? Number(slider.value).toFixed(0) : Number(slider.value).toFixed(2) // Display 2 decimal place
|
108
|
+
enabled: checkBox.checked
|
109
|
+
}
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
function updateValue(curr_val, val) {
|
114
|
+
if (curr_val !== val){
|
115
|
+
curr_val = val;
|
116
|
+
var index = imgFilterModel.index(model.index, 0);
|
117
|
+
imgFilterModel.setData(index, val, dataValueRole);
|
118
|
+
mainController.apply_img_filter_changes();
|
119
|
+
}
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
}
|
124
|
+
|
125
|
+
}
|
126
|
+
|
127
|
+
Connections {
|
128
|
+
target: mainController
|
129
|
+
|
130
|
+
function onImageChangedSignal() {
|
131
|
+
// Force refresh
|
132
|
+
imgFiltersControl.enabled = mainController.display_image();
|
133
|
+
}
|
134
|
+
|
135
|
+
}
|
136
|
+
|
137
|
+
}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
import QtQuick
|
2
|
+
import QtQuick.Controls
|
3
|
+
import QtQuick.Layouts
|
4
|
+
|
5
|
+
|
6
|
+
Item {
|
7
|
+
id: imgPropsTbl
|
8
|
+
Layout.preferredHeight: (numRows * tblRowHeight) + 5
|
9
|
+
Layout.preferredWidth: parent.width - 10
|
10
|
+
Layout.leftMargin: 5
|
11
|
+
//Layout.rightMargin: 5
|
12
|
+
|
13
|
+
property int numRows: imagePropsModel.rowCount()
|
14
|
+
property int tblRowHeight: 30
|
15
|
+
|
16
|
+
TableView {
|
17
|
+
id: tblImgProps
|
18
|
+
height: numRows * tblRowHeight
|
19
|
+
width: parent.width - 10
|
20
|
+
model: imagePropsModel
|
21
|
+
|
22
|
+
property int tblRowHeight: 30
|
23
|
+
|
24
|
+
delegate: Rectangle {
|
25
|
+
implicitWidth: column === 0 ? (tblImgProps.width * 0.4) : (tblImgProps.width * 0.6) //imagePropsModel.columnCount
|
26
|
+
implicitHeight: tblRowHeight
|
27
|
+
color: row % 2 === 0 ? "#f5f5f5" : "#ffffff" // Alternating colors
|
28
|
+
//border.color: "#d0d0d0"
|
29
|
+
//border.width: 1
|
30
|
+
|
31
|
+
Text {
|
32
|
+
text: model.text
|
33
|
+
wrapMode: Text.Wrap
|
34
|
+
font.pixelSize: 10
|
35
|
+
color: "#303030"
|
36
|
+
anchors.fill: parent
|
37
|
+
anchors.topMargin: 5
|
38
|
+
anchors.leftMargin: 10
|
39
|
+
}
|
40
|
+
|
41
|
+
Loader {
|
42
|
+
sourceComponent: column === 1 ? lineBorder : noBorder
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
Component {
|
47
|
+
id: lineBorder
|
48
|
+
Rectangle {
|
49
|
+
width: 1 // Border width
|
50
|
+
height: tblRowHeight
|
51
|
+
color: "#e0e0e0" // Border color
|
52
|
+
anchors.left: parent.left
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
Component {
|
57
|
+
id: noBorder
|
58
|
+
Rectangle {
|
59
|
+
width: 5 // Border width
|
60
|
+
height: parent.height
|
61
|
+
color: transientParent
|
62
|
+
anchors.left: parent.left
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
Connections {
|
69
|
+
target: mainController
|
70
|
+
|
71
|
+
function onImageChangedSignal(){
|
72
|
+
//tblImgProps.height = imagePropsModel.rowCount() * tblRowHeight;
|
73
|
+
numRows = imagePropsModel.rowCount();
|
74
|
+
}
|
75
|
+
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|