Skip to content

Commit f03bd6a

Browse files
author
JlexZhong
committed
第一次提交
1 parent 0b55e31 commit f03bd6a

27 files changed

+1711
-1
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,12 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
132+
133+
134+
__pycache__
135+
.vscode
136+
.idea
137+
git_ignore
138+
.qt_for_python

README.assets/display.gif

4.92 MB
Loading
195 KB
Loading
14.6 KB
Loading
24 KB
Loading
108 KB
Loading

README.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,62 @@
1-
# CTRockImages3DReconstruc
1+
# 基于CT扫描的砾石图像三维重建
2+
3+
**主界面**
4+
5+
<img src="README.assets/image-20220118171145158.png" alt="image-20220118171145158" style="zoom: 50%;" />
6+
7+
**效果:**
8+
9+
<img src="README.assets/display.gif" alt="display" style="zoom: 50%;" />
10+
11+
## 使用方法
12+
13+
#### 配置环境
14+
15+
requirement.txt
16+
17+
```
18+
scipy==1.5.4
19+
torch==1.6.0+cpu
20+
pyqtgraph==0.11.1
21+
numpy==1.19.5
22+
mayavi==4.7.4
23+
tqdm==4.42.1
24+
pandas==1.1.5
25+
opencv_python_headless==4.5.3.56
26+
torchvision==0.7.0+cpu
27+
matplotlib==3.1.2
28+
Pillow==9.0.0
29+
PyQt5==5.15.6
30+
```
31+
32+
主目录下:
33+
34+
```bash
35+
pip install -r requirement.txt
36+
```
37+
38+
#### 下载预训练权重
39+
40+
41+
42+
#### 导入CT影像
43+
44+
#### 选择神经网络模型
45+
46+
目前只支持UNet
47+
48+
#### 载入权重
49+
50+
#### 进行图像分割
51+
52+
可选择使用GPU加速
53+
54+
#### 结果优化
55+
56+
可使用画笔将粘结的砾石通过人工分开,右侧可调整画笔粗细和颜色。
57+
58+
<img src="README.assets/image-20220118192928686.png" alt="image-20220118192928686" style="zoom:80%;" />
59+
60+
<img src="README.assets/image-20220118193013517.png" alt="image-20220118193013517" style="zoom:80%;" />
61+
62+
<img src="README.assets/image-20220118193517921.png" alt="image-20220118193517921" style="zoom: 50%;" />

UI/MainW.ui

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>MainWindow</class>
4+
<widget class="QMainWindow" name="MainWindow">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>1122</width>
10+
<height>730</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>MainWindow</string>
15+
</property>
16+
<widget class="QWidget" name="centralwidget">
17+
<layout class="QHBoxLayout" name="horizontalLayout_4">
18+
<item>
19+
<layout class="QHBoxLayout" name="horizontalLayout_2">
20+
<item>
21+
<widget class="QStackedWidget" name="stackedWidget">
22+
<property name="enabled">
23+
<bool>true</bool>
24+
</property>
25+
<property name="currentIndex">
26+
<number>0</number>
27+
</property>
28+
<widget class="QWidget" name="page_1">
29+
<layout class="QHBoxLayout" name="horizontalLayout">
30+
<item>
31+
<widget class="QLabel" name="label_previous_img">
32+
<property name="text">
33+
<string/>
34+
</property>
35+
</widget>
36+
</item>
37+
<item>
38+
<widget class="QWidget" name="widget_seg" native="true"/>
39+
</item>
40+
</layout>
41+
</widget>
42+
<widget class="QWidget" name="page_2">
43+
<layout class="QHBoxLayout" name="horizontalLayout_3"/>
44+
</widget>
45+
</widget>
46+
</item>
47+
<item>
48+
<widget class="QWidget" name="widget_tools" native="true">
49+
<property name="minimumSize">
50+
<size>
51+
<width>200</width>
52+
<height>0</height>
53+
</size>
54+
</property>
55+
<layout class="QVBoxLayout" name="verticalLayout">
56+
<item>
57+
<widget class="QLabel" name="label_now_img_id">
58+
<property name="text">
59+
<string>当前切片:</string>
60+
</property>
61+
<property name="alignment">
62+
<set>Qt::AlignCenter</set>
63+
</property>
64+
</widget>
65+
</item>
66+
<item>
67+
<widget class="QPushButton" name="pushButton_openfile">
68+
<property name="text">
69+
<string>导入砾石CT切片</string>
70+
</property>
71+
</widget>
72+
</item>
73+
<item>
74+
<widget class="QComboBox" name="comboBox">
75+
<item>
76+
<property name="text">
77+
<string>UNet</string>
78+
</property>
79+
</item>
80+
<item>
81+
<property name="text">
82+
<string>UNet++</string>
83+
</property>
84+
</item>
85+
</widget>
86+
</item>
87+
<item>
88+
<widget class="QPushButton" name="pushButton_load_model">
89+
<property name="text">
90+
<string>载入模型</string>
91+
</property>
92+
</widget>
93+
</item>
94+
<item>
95+
<widget class="QCheckBox" name="checkBox">
96+
<property name="focusPolicy">
97+
<enum>Qt::WheelFocus</enum>
98+
</property>
99+
<property name="text">
100+
<string>使用GPU加速</string>
101+
</property>
102+
<property name="autoRepeatDelay">
103+
<number>300</number>
104+
</property>
105+
</widget>
106+
</item>
107+
<item>
108+
<widget class="QPushButton" name="pushButton_seg_imgs">
109+
<property name="text">
110+
<string>分割砾石</string>
111+
</property>
112+
</widget>
113+
</item>
114+
<item>
115+
<widget class="Line" name="line">
116+
<property name="orientation">
117+
<enum>Qt::Horizontal</enum>
118+
</property>
119+
</widget>
120+
</item>
121+
<item>
122+
<widget class="QPushButton" name="pushButton_openfile_seged">
123+
<property name="text">
124+
<string>导入分割后图片</string>
125+
</property>
126+
</widget>
127+
</item>
128+
<item>
129+
<widget class="QPushButton" name="Button_pre_img">
130+
<property name="text">
131+
<string>上一张</string>
132+
</property>
133+
</widget>
134+
</item>
135+
<item>
136+
<widget class="QPushButton" name="Button_next_img">
137+
<property name="text">
138+
<string>下一张</string>
139+
</property>
140+
</widget>
141+
</item>
142+
<item>
143+
<widget class="Line" name="line_2">
144+
<property name="orientation">
145+
<enum>Qt::Horizontal</enum>
146+
</property>
147+
</widget>
148+
</item>
149+
<item>
150+
<widget class="QPushButton" name="Button_resetnow">
151+
<property name="text">
152+
<string>重置当前</string>
153+
</property>
154+
</widget>
155+
</item>
156+
<item>
157+
<widget class="QLabel" name="label_pensize">
158+
<property name="maximumSize">
159+
<size>
160+
<width>16777215</width>
161+
<height>50</height>
162+
</size>
163+
</property>
164+
<property name="text">
165+
<string>画笔粗细</string>
166+
</property>
167+
</widget>
168+
</item>
169+
<item>
170+
<widget class="QSpinBox" name="spinBox_pensize">
171+
<property name="value">
172+
<number>10</number>
173+
</property>
174+
</widget>
175+
</item>
176+
<item>
177+
<widget class="QLabel" name="label_pencolor">
178+
<property name="maximumSize">
179+
<size>
180+
<width>16777215</width>
181+
<height>50</height>
182+
</size>
183+
</property>
184+
<property name="text">
185+
<string>画笔颜色</string>
186+
</property>
187+
</widget>
188+
</item>
189+
<item>
190+
<widget class="QComboBox" name="comboBox_color"/>
191+
</item>
192+
<item>
193+
<widget class="Line" name="line_3">
194+
<property name="orientation">
195+
<enum>Qt::Horizontal</enum>
196+
</property>
197+
</widget>
198+
</item>
199+
<item>
200+
<widget class="QPushButton" name="pushButton_save_imgs">
201+
<property name="text">
202+
<string>保存全部图片</string>
203+
</property>
204+
</widget>
205+
</item>
206+
<item>
207+
<widget class="QPushButton" name="pushButton_save_vtk_files">
208+
<property name="text">
209+
<string>输出VTK文件</string>
210+
</property>
211+
</widget>
212+
</item>
213+
<item>
214+
<widget class="QPushButton" name="pushButton_3D_build">
215+
<property name="text">
216+
<string>三维重建</string>
217+
</property>
218+
</widget>
219+
</item>
220+
<item>
221+
<spacer name="verticalSpacer">
222+
<property name="orientation">
223+
<enum>Qt::Vertical</enum>
224+
</property>
225+
<property name="sizeType">
226+
<enum>QSizePolicy::Expanding</enum>
227+
</property>
228+
<property name="sizeHint" stdset="0">
229+
<size>
230+
<width>20</width>
231+
<height>40</height>
232+
</size>
233+
</property>
234+
</spacer>
235+
</item>
236+
</layout>
237+
</widget>
238+
</item>
239+
</layout>
240+
</item>
241+
</layout>
242+
</widget>
243+
<widget class="QStatusBar" name="statusbar"/>
244+
<action name="action">
245+
<property name="text">
246+
<string>导入原始CT切片</string>
247+
</property>
248+
</action>
249+
</widget>
250+
<resources/>
251+
<connections/>
252+
</ui>

0 commit comments

Comments
 (0)