增加输入成像平面代码
parent
94fd13bac8
commit
84f1ac6a5c
|
|
@ -17,6 +17,10 @@ QSimulationBPImage::QSimulationBPImage(QWidget *parent)
|
||||||
QObject::connect(ui->pushButtonImageSelect, SIGNAL(clicked()), this, SLOT(onpushButtonImageSelectClicked()));
|
QObject::connect(ui->pushButtonImageSelect, SIGNAL(clicked()), this, SLOT(onpushButtonImageSelectClicked()));
|
||||||
QObject::connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onbtnaccepted()));
|
QObject::connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onbtnaccepted()));
|
||||||
QObject::connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(onbtnrejected()));
|
QObject::connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(onbtnrejected()));
|
||||||
|
QObject::connect(ui->checkBox, SIGNAL(stateChanged(int)), this, SLOT(oncheckboxTrigged(int)));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -84,7 +88,13 @@ void QSimulationBPImage::onbtnaccepted()
|
||||||
TBPimag.setImageL1(imagL1);
|
TBPimag.setImageL1(imagL1);
|
||||||
long cpucore_num = std::thread::hardware_concurrency();
|
long cpucore_num = std::thread::hardware_concurrency();
|
||||||
TBPimag.setGPU(true);
|
TBPimag.setGPU(true);
|
||||||
|
if (ui->checkBox->isChecked()) {
|
||||||
|
TBPimag.ProcessWithGridNet(cpucore_num,ui->lineEdit->text().trimmed());
|
||||||
|
}
|
||||||
|
else {
|
||||||
TBPimag.Process(cpucore_num);
|
TBPimag.Process(cpucore_num);
|
||||||
|
}
|
||||||
|
|
||||||
QMessageBox::information(this,u8"成像",u8"成像结束");
|
QMessageBox::information(this,u8"成像",u8"成像结束");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -93,3 +103,28 @@ void QSimulationBPImage::onbtnrejected()
|
||||||
{
|
{
|
||||||
this->close();
|
this->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QSimulationBPImage::oncheckboxTrigged(int)
|
||||||
|
{
|
||||||
|
this->ui->lineEdit->setEnabled(this->ui->checkBox->isChecked());
|
||||||
|
this->ui->GridNetBtn->setEnabled(this->ui->checkBox->isChecked());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void QSimulationBPImage::onpushButtonGridNetSelectClicked( )
|
||||||
|
{
|
||||||
|
QString fileNames = QFileDialog::getSaveFileName(
|
||||||
|
this, // 父窗口
|
||||||
|
tr(u8"选择影像文件"), // 标题
|
||||||
|
QString(), // 默认路径
|
||||||
|
tr(u8"All Files(*);;dat(*.dat);;tif(*.tif);;tiff(*.tiff)") // 文件过滤器
|
||||||
|
);
|
||||||
|
|
||||||
|
// 如果用户选择了文件
|
||||||
|
if (!fileNames.isEmpty()) {
|
||||||
|
this->ui->lineEdit->setText(fileNames);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
QMessageBox::information(this, tr(u8"没有选择文件"), tr(u8"没有选择任何文件。"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,9 @@ public slots:
|
||||||
void onbtnaccepted();
|
void onbtnaccepted();
|
||||||
void onbtnrejected();
|
void onbtnrejected();
|
||||||
|
|
||||||
|
void oncheckboxTrigged(int);
|
||||||
|
void onpushButtonGridNetSelectClicked( );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::QSimulationBPImageClass* ui;
|
Ui::QSimulationBPImageClass* ui;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,60 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_3">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBox">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>图像网格</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lineEdit">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="GridNetBtn">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>PushButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="frame_2">
|
<widget class="QFrame" name="frame_2">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
|
|
|
||||||
|
|
@ -215,9 +215,13 @@ ErrorCode TBPImageAlgCls::Process(long num_thread)
|
||||||
qDebug() << u8"创建成像平面的XYZ";
|
qDebug() << u8"创建成像平面的XYZ";
|
||||||
QString outRasterXYZ = JoinPath(this->L1ds->getoutFolderPath(), this->L0ds->getSimulationTaskName() + "_xyz.bin");
|
QString outRasterXYZ = JoinPath(this->L1ds->getoutFolderPath(), this->L0ds->getSimulationTaskName() + "_xyz.bin");
|
||||||
CreatePixelXYZ(this->L0ds, outRasterXYZ);
|
CreatePixelXYZ(this->L0ds, outRasterXYZ);
|
||||||
this->outRasterXYZPath = outRasterXYZ;
|
return this->ProcessWithGridNet(num_thread, outRasterXYZ);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ErrorCode TBPImageAlgCls::ProcessWithGridNet(long num_thread,QString xyzRasterPath)
|
||||||
|
{
|
||||||
|
this->outRasterXYZPath = xyzRasterPath;
|
||||||
qDebug() << u8"频域回波-> 时域回波";
|
qDebug() << u8"频域回波-> 时域回波";
|
||||||
this->TimeEchoDataPath = JoinPath(this->L1ds->getoutFolderPath(), this->L0ds->getSimulationTaskName() + "_Timeecho.bin");
|
this->TimeEchoDataPath = JoinPath(this->L1ds->getoutFolderPath(), this->L0ds->getSimulationTaskName() + "_Timeecho.bin");
|
||||||
this->EchoFreqToTime();
|
this->EchoFreqToTime();
|
||||||
|
|
@ -237,16 +241,16 @@ ErrorCode TBPImageAlgCls::Process(long num_thread)
|
||||||
if (startline + templine >= imageheight) {
|
if (startline + templine >= imageheight) {
|
||||||
templine = imageheight - startline;
|
templine = imageheight - startline;
|
||||||
}
|
}
|
||||||
qDebug() << "\r[" << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz") << "] imgxyz :\t" << startline << "\t-\t" << startline + templine << " / " << imageheight ;
|
qDebug() << "\r[" << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz") << "] imgxyz :\t" << startline << "\t-\t" << startline + templine << " / " << imageheight;
|
||||||
|
|
||||||
std::shared_ptr<std::complex<double>> imageRaster = this->L1ds->getImageRaster(startline, templine);
|
std::shared_ptr<std::complex<double>> imageRaster = this->L1ds->getImageRaster(startline, templine);
|
||||||
|
|
||||||
for (long i = 0; i < templine; i++) {
|
for (long i = 0; i < templine; i++) {
|
||||||
for (long j = 0; j < imagewidth; j++) {
|
for (long j = 0; j < imagewidth; j++) {
|
||||||
imageRaster.get()[i * imagewidth + j] = std::complex<double>(0,0);
|
imageRaster.get()[i * imagewidth + j] = std::complex<double>(0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->L1ds->saveImageRaster(imageRaster, startline,templine);
|
this->L1ds->saveImageRaster(imageRaster, startline, templine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -256,12 +260,16 @@ ErrorCode TBPImageAlgCls::Process(long num_thread)
|
||||||
return this->ProcessGPU();
|
return this->ProcessGPU();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QMessageBox::information(nullptr,u8"Ìáʾ",u8"Ŀǰֻ֧³ÖÏÔ¿¨");
|
QMessageBox::information(nullptr, u8"Ìáʾ", u8"Ŀǰֻ֧³ÖÏÔ¿¨");
|
||||||
return ErrorCode::FAIL;
|
return ErrorCode::FAIL;
|
||||||
}
|
}
|
||||||
return ErrorCode::SUCCESS;
|
return ErrorCode::SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ErrorCode TBPImageAlgCls::ProcessGPU()
|
ErrorCode TBPImageAlgCls::ProcessGPU()
|
||||||
{
|
{
|
||||||
// 常用参数
|
// 常用参数
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ public:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ErrorCode Process(long num_thread);
|
ErrorCode Process(long num_thread);
|
||||||
|
ErrorCode ProcessWithGridNet(long num_thread,QString xyzRasterPath);
|
||||||
void setGPU(bool flag);
|
void setGPU(bool flag);
|
||||||
bool getGPU( );
|
bool getGPU( );
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue