add beta
This commit is contained in:
parent
c0be9b687e
commit
398e4aad46
1
config/imaging/f1.json
Normal file
1
config/imaging/f1.json
Normal file
@ -0,0 +1 @@
|
||||
{"t_end": 1499, "t_start": 0, "v2": 5900, "dct_center": 497, "dct_bandwidth": 739, "f_rows": 1502}
|
||||
1
config/imaging/f2.json
Normal file
1
config/imaging/f2.json
Normal file
@ -0,0 +1 @@
|
||||
{"t_end": 4502, "t_start": 0, "v2": 1530, "dct_center": 580, "dct_bandwidth": 735, "f_rows": 4419}
|
||||
@ -33,14 +33,14 @@ class Beamformer(Node):
|
||||
if data is None:
|
||||
return
|
||||
d2 = (data
|
||||
.crop(arg.t_start, arg.t_end)
|
||||
# .dct(80, 1500)
|
||||
.dct_center(arg.dct_center, arg.dct_bandwidth)
|
||||
.call(lambda m: m.astype(cp.int16))
|
||||
.call(pwi)
|
||||
.call(cp.asarray, order='C')
|
||||
.argrelextrema()
|
||||
.conv_guass(b=18 * 0.01)
|
||||
.conv_guass(b=arg.beta * 0.01)
|
||||
.crop(arg.t_start, arg.t_end)
|
||||
.rotate90()
|
||||
# .grey()
|
||||
.cpu()
|
||||
|
||||
@ -52,10 +52,7 @@ class Adv(QMainWindow, Ui_MainWindow):
|
||||
self.zoom -= 0.1
|
||||
|
||||
def on_zmq_event(self, msg: QByteArray):
|
||||
t0 = time.time()
|
||||
msg = Msg.decode_msg(msg.data())
|
||||
t1 = time.time()
|
||||
print(t1 - t0)
|
||||
if isinstance(msg, KillMsg):
|
||||
if msg.name == '':
|
||||
self.close()
|
||||
@ -63,7 +60,6 @@ class Adv(QMainWindow, Ui_MainWindow):
|
||||
w = msg.rfmat.w
|
||||
h = msg.rfmat.h
|
||||
d: RfMat = msg.rfmat
|
||||
|
||||
d2 = (d
|
||||
.pseudo_color(cond=not self.grey)
|
||||
.grey(cond=self.grey)
|
||||
|
||||
@ -456,6 +456,12 @@ class Adv(QMainWindow, Ui_MainWindow):
|
||||
if self.cb_bscan.sender() is None:
|
||||
self.p.send(SetWindowVisibleMsg('ui', 'bscan', v == 2))
|
||||
|
||||
@pyqtSlot(int)
|
||||
def on_s_beta_valueChanged(self, v):
|
||||
if self.s_beta.sender() is None:
|
||||
self.arg.beta = v
|
||||
self.p.send(self.arg)
|
||||
|
||||
@pyqtSlot(int)
|
||||
def on_s_dct_center_valueChanged(self, v):
|
||||
if self.s_dct_center.sender() is None:
|
||||
|
||||
@ -489,13 +489,16 @@ class Ui_MainWindow(object):
|
||||
self.spinBox.setObjectName("spinBox")
|
||||
self.gridLayout_5.addWidget(self.spinBox, 4, 2, 1, 1)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.gridLayout_5.addItem(spacerItem2, 9, 1, 1, 1)
|
||||
self.gridLayout_5.addItem(spacerItem2, 10, 1, 1, 1)
|
||||
self.s_t_end = QJumpSlider(parent=self.centralwidget)
|
||||
self.s_t_end.setMinimum(1)
|
||||
self.s_t_end.setMaximum(1500)
|
||||
self.s_t_end.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.s_t_end.setObjectName("s_t_end")
|
||||
self.gridLayout_5.addWidget(self.s_t_end, 4, 1, 1, 1)
|
||||
self.spinBox_7 = QtWidgets.QSpinBox(parent=self.centralwidget)
|
||||
self.spinBox_7.setObjectName("spinBox_7")
|
||||
self.gridLayout_5.addWidget(self.spinBox_7, 7, 2, 1, 1)
|
||||
self.label_5 = QtWidgets.QLabel(parent=self.centralwidget)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.gridLayout_5.addWidget(self.label_5, 4, 0, 1, 1)
|
||||
@ -521,6 +524,15 @@ class Ui_MainWindow(object):
|
||||
self.spinBox_3 = QtWidgets.QSpinBox(parent=self.centralwidget)
|
||||
self.spinBox_3.setObjectName("spinBox_3")
|
||||
self.gridLayout_5.addWidget(self.spinBox_3, 6, 2, 1, 1)
|
||||
self.spinBox_13 = QtWidgets.QSpinBox(parent=self.centralwidget)
|
||||
self.spinBox_13.setObjectName("spinBox_13")
|
||||
self.gridLayout_5.addWidget(self.spinBox_13, 8, 2, 1, 1)
|
||||
self.s_f_rows = QtWidgets.QSlider(parent=self.centralwidget)
|
||||
self.s_f_rows.setMinimum(500)
|
||||
self.s_f_rows.setMaximum(7000)
|
||||
self.s_f_rows.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.s_f_rows.setObjectName("s_f_rows")
|
||||
self.gridLayout_5.addWidget(self.s_f_rows, 8, 1, 1, 1)
|
||||
self.s_dct_bandwidth = QtWidgets.QSlider(parent=self.centralwidget)
|
||||
self.s_dct_bandwidth.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.s_dct_bandwidth.setObjectName("s_dct_bandwidth")
|
||||
@ -544,21 +556,22 @@ class Ui_MainWindow(object):
|
||||
self.label_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridLayout_5.addWidget(self.label_2, 0, 0, 1, 3)
|
||||
self.s_f_rows = QtWidgets.QSlider(parent=self.centralwidget)
|
||||
self.s_f_rows.setMinimum(500)
|
||||
self.s_f_rows.setMaximum(7000)
|
||||
self.s_f_rows.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.s_f_rows.setObjectName("s_f_rows")
|
||||
self.gridLayout_5.addWidget(self.s_f_rows, 8, 1, 1, 1)
|
||||
self.spinBox_12 = QtWidgets.QSpinBox(parent=self.centralwidget)
|
||||
self.spinBox_12.setObjectName("spinBox_12")
|
||||
self.gridLayout_5.addWidget(self.spinBox_12, 3, 2, 1, 1)
|
||||
self.spinBox_7 = QtWidgets.QSpinBox(parent=self.centralwidget)
|
||||
self.spinBox_7.setObjectName("spinBox_7")
|
||||
self.gridLayout_5.addWidget(self.spinBox_7, 7, 2, 1, 1)
|
||||
self.spinBox_13 = QtWidgets.QSpinBox(parent=self.centralwidget)
|
||||
self.spinBox_13.setObjectName("spinBox_13")
|
||||
self.gridLayout_5.addWidget(self.spinBox_13, 8, 2, 1, 1)
|
||||
self.s_beta = QtWidgets.QSlider(parent=self.centralwidget)
|
||||
self.s_beta.setMinimum(1)
|
||||
self.s_beta.setMaximum(30)
|
||||
self.s_beta.setProperty("value", 10)
|
||||
self.s_beta.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.s_beta.setObjectName("s_beta")
|
||||
self.gridLayout_5.addWidget(self.s_beta, 9, 1, 1, 1)
|
||||
self.label_35 = QtWidgets.QLabel(parent=self.centralwidget)
|
||||
self.label_35.setObjectName("label_35")
|
||||
self.gridLayout_5.addWidget(self.label_35, 9, 0, 1, 1)
|
||||
self.spinBox_14 = QtWidgets.QSpinBox(parent=self.centralwidget)
|
||||
self.spinBox_14.setObjectName("spinBox_14")
|
||||
self.gridLayout_5.addWidget(self.spinBox_14, 9, 2, 1, 1)
|
||||
self.gridLayout.addLayout(self.gridLayout_5, 3, 0, 1, 1)
|
||||
self.gridLayout.setRowStretch(0, 1)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
@ -640,4 +653,5 @@ class Ui_MainWindow(object):
|
||||
self.b_new_imaging_config.setText(_translate("MainWindow", "New"))
|
||||
self.label_6.setText(_translate("MainWindow", "v2"))
|
||||
self.label_2.setText(_translate("MainWindow", "Imaging"))
|
||||
self.label_35.setText(_translate("MainWindow", "beta"))
|
||||
from flandre.pyqt.QJumpSlider import QJumpSlider
|
||||
|
||||
@ -912,7 +912,7 @@ border-radius: 7px;
|
||||
<item row="4" column="2">
|
||||
<widget class="QSpinBox" name="spinBox"/>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<item row="10" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
@ -938,6 +938,9 @@ border-radius: 7px;
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QSpinBox" name="spinBox_7"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
@ -979,6 +982,22 @@ border-radius: 7px;
|
||||
<item row="6" column="2">
|
||||
<widget class="QSpinBox" name="spinBox_3"/>
|
||||
</item>
|
||||
<item row="8" column="2">
|
||||
<widget class="QSpinBox" name="spinBox_13"/>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QSlider" name="s_f_rows">
|
||||
<property name="minimum">
|
||||
<number>500</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>7000</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QSlider" name="s_dct_bandwidth">
|
||||
<property name="orientation">
|
||||
@ -1025,27 +1044,34 @@ border-radius: 7px;
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QSlider" name="s_f_rows">
|
||||
<item row="3" column="2">
|
||||
<widget class="QSpinBox" name="spinBox_12"/>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QSlider" name="s_beta">
|
||||
<property name="minimum">
|
||||
<number>500</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>7000</number>
|
||||
<number>30</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QSpinBox" name="spinBox_12"/>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_35">
|
||||
<property name="text">
|
||||
<string>beta</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QSpinBox" name="spinBox_7"/>
|
||||
</item>
|
||||
<item row="8" column="2">
|
||||
<widget class="QSpinBox" name="spinBox_13"/>
|
||||
<item row="9" column="2">
|
||||
<widget class="QSpinBox" name="spinBox_14"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
||||
@ -246,6 +246,7 @@ class ImageArgMsg(Msg):
|
||||
dct_center: int = 0
|
||||
dct_bandwidth: int = 0
|
||||
f_rows: int = 0
|
||||
beta: int = 10
|
||||
|
||||
@staticmethod
|
||||
def from_path(p: Path):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user