void MainWindow::dropEvent(QDropEvent *event) { event->acceptProposedAction(); QList<QUrl> droppedUrls = event->mimeData()->urls(); int droppedUrlCnt = droppedUrls.size(); QStringList files; for(int i = 0; i < droppedUrlCnt; i++) files << droppedUrls[i].toLocalFile(); if(files.size() == 1) { if(QFileInfo(files[0]).completeSuffix() == "fib.gz") { loadFib(files[0]); return; } if(QFileInfo(files[0]).completeSuffix() == "src.gz") { loadSrc(files); return; } } dicom_parser* dp = new dicom_parser(files,this); dp->setAttribute(Qt::WA_DeleteOnClose); dp->showNormal(); }
//wraps it all together void FindGoal::finalize() { loadSrc(); cv::Mat blurred = preProcess(src); std::vector<cv::Vec4i> houghLines = edgeDetection(blurred, srcCopy); cv::Vec4i goalCors = shapeValidation(houghLines); graphics(goalCors, srcCopy); }
bool Shader::loadFile(const QString& f) { bool changed = false; setFilename(f); QFile file(filename()); if (file.open(QFile::ReadOnly | QFile::Text)) { changed = loadSrc(file.readAll()); } return changed; }
void MainWindow::on_Reconstruction_clicked() { QStringList filenames = QFileDialog::getOpenFileNames( this, "Open Src files", ui->workDir->currentText(), "Src files (*src.gz *.src);;All files (*)" ); if (filenames.isEmpty()) return; loadSrc(filenames); }
void MainWindow::openRecentSrcFile(void) { QAction *action = qobject_cast<QAction *>(sender()); loadSrc(QStringList() << action->data().toString()); }
void MainWindow::open_src_at(int row,int col) { loadSrc(QStringList() << (ui->recentSrc->item(row,1)->text() + "/" + ui->recentSrc->item(row,0)->text())); }