-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,185 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#------------------------------------------------- | ||
# | ||
# Project created by QtCreator 2019-02-13T12:51:17 | ||
# | ||
#------------------------------------------------- | ||
|
||
QT += core gui | ||
|
||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets | ||
|
||
TARGET = CinTesting | ||
TEMPLATE = app vcapp | ||
|
||
# The following define makes your compiler emit warnings if you use | ||
# any feature of Qt which has been marked as deprecated (the exact warnings | ||
# depend on your compiler). Please consult the documentation of the | ||
# deprecated API in order to know how to port your code away from it. | ||
DEFINES += QT_DEPRECATED_WARNINGS | ||
|
||
# You can also make your code fail to compile if you use deprecated APIs. | ||
# In order to do so, uncomment the following line. | ||
# You can also select to disable deprecated APIs only up to a certain version of Qt. | ||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 | ||
|
||
CONFIG += c++11 | ||
|
||
SOURCES += \ | ||
main.cpp \ | ||
mainwindow.cpp \ | ||
about.cpp | ||
|
||
HEADERS += \ | ||
mainwindow.h \ | ||
about.h | ||
|
||
FORMS += \ | ||
mainwindow.ui \ | ||
about.ui | ||
|
||
# Default rules for deployment. | ||
qnx: target.path = /tmp/$${TARGET}/bin | ||
else: unix:!android: target.path = /opt/$${TARGET}/bin | ||
!isEmpty(target.path): INSTALLS += target | ||
|
||
RESOURCES += \ | ||
resource.qrc | ||
VERSION = 1.0.2 |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "about.h" | ||
#include "ui_about.h" | ||
|
||
About::About(QWidget *parent) : | ||
QDialog(parent), | ||
ui(new Ui::About) | ||
{ | ||
ui->setupUi(this); | ||
} | ||
|
||
About::~About() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void About::on_pushButton_clicked() | ||
{ | ||
close(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef ABOUT_H | ||
#define ABOUT_H | ||
|
||
#include <QDialog> | ||
|
||
namespace Ui { | ||
class About; | ||
} | ||
|
||
class About : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit About(QWidget *parent = nullptr); | ||
~About(); | ||
|
||
private slots: | ||
void on_pushButton_clicked(); | ||
|
||
private: | ||
Ui::About *ui; | ||
}; | ||
|
||
#endif // ABOUT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>About</class> | ||
<widget class="QDialog" name="About"> | ||
<property name="windowModality"> | ||
<enum>Qt::ApplicationModal</enum> | ||
</property> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>659</width> | ||
<height>425</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>О программе</string> | ||
</property> | ||
<property name="modal"> | ||
<bool>true</bool> | ||
</property> | ||
<widget class="QTextBrowser" name="textBrowser"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>40</x> | ||
<y>10</y> | ||
<width>581</width> | ||
<height>351</height> | ||
</rect> | ||
</property> | ||
<property name="html"> | ||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> | ||
<html><head><meta name="qrichtext" content="1" /><style type="text/css"> | ||
p, li { white-space: pre-wrap; } | ||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:7.8pt; font-weight:400; font-style:normal;"> | ||
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-weight:600;">Авторы</span></p> | ||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Малков Федор Сергеевич. Аспирант ИДСТУ СО РАН, г. Иркутск. +7-924-833-38-34; [email protected]</span></p> | ||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">При поддержке ФГБНУ &quot;Научный центр проблем здоровья семьи и репродукции человека&quot;, г. Иркутск </span></p> | ||
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-weight:600;">ИНСТРУКЦИЯ</span></p> | ||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Скачать три архива с сайта </span><a href="https://www.kaggle.com/c/intel-mobileodt-cervical-cancer-screening/data"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">kaggle.com (https://www.kaggle.com/c/intel-mobileodt-cervical-cancer-screening/data)</span></a></p> | ||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Скачиваем архивы </span><span style=" font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);">additional_Type_1_v2.7z, additional_Type_2_v2.7z и additional_Type_3_v2.7z (в сумме 25.7 ГБ)</span></p> | ||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);">Распаковываем их в папки на компьютере.</span></p> | ||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);">Переходим в папку с этой программой. </span></p> | ||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);">Из папок Type_1, Type_2 и Type_3 копируем или перемещаем изображения в папки cin/1; cin/2 и cin/3</span></p> | ||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);">Перезапускаем программу</span></p> | ||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);">По умолчанию, вместе с программой поставляется по два изображения для CIN1..CIN3</span></p> | ||
<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Atlas Grotesk,sans-serif'; font-size:10pt; font-weight:600; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);">ВЕРСИЯ</span></p> | ||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118); background-color:rgba(225,240,246,0.294118);">Версия программы 1.0.2. <br />6 марта 2019 года</span></p> | ||
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Atlas Grotesk,sans-serif'; font-size:8pt; color:rgba(0,0,0,0.694118);"><br /></p></body></html></string> | ||
</property> | ||
</widget> | ||
<widget class="QPushButton" name="pushButton"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>240</x> | ||
<y>370</y> | ||
<width>93</width> | ||
<height>28</height> | ||
</rect> | ||
</property> | ||
<property name="text"> | ||
<string>OK</string> | ||
</property> | ||
</widget> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "mainwindow.h" | ||
#include <QApplication> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
QApplication a(argc, argv); | ||
MainWindow w; | ||
w.show(); | ||
|
||
return a.exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
#include "mainwindow.h" | ||
#include "ui_mainwindow.h" | ||
#include "about.h" | ||
#include "ui_about.h" | ||
#include <QDir> | ||
#include <QFileInfoList> | ||
#include <QString> | ||
#include <QDebug> | ||
#include <vector> | ||
#include <random> | ||
#include <time.h> | ||
|
||
using namespace std; | ||
|
||
MainWindow::MainWindow(QWidget *parent) : | ||
QMainWindow(parent), | ||
ui(new Ui::MainWindow) | ||
{ | ||
ui->setupUi(this); | ||
ui->pushButton->setEnabled(false); | ||
ui->pushButton_2->setEnabled(false); | ||
|
||
} | ||
|
||
void MainWindow::traverse(const QString &pattern, const QString &dirname, int level) | ||
{ | ||
QDir dir(dirname); | ||
dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoSymLinks | QDir::NoDot | QDir::NoDotDot); | ||
|
||
static const QStringList stringList = pattern.split('/'); | ||
foreach (QFileInfo fileInfo, dir.entryInfoList(stringList.mid(level, 1))) { | ||
if (fileInfo.isDir() && fileInfo.isReadable()) | ||
traverse(pattern, fileInfo.filePath(), level+1); | ||
else if (stringList.size() == (level + 1)) { | ||
// pth | ||
pth.push_back(fileInfo.filePath()); | ||
|
||
|
||
// qDebug() << fileInfo.filePath(); | ||
} | ||
} | ||
|
||
} | ||
|
||
MainWindow::~MainWindow() | ||
{ | ||
|
||
delete ui; | ||
} | ||
|
||
void MainWindow::on_pushButton_clicked() | ||
{ | ||
|
||
ui->lbl_descr->clear(); | ||
//qsrand(qrand()); | ||
srand (time(NULL)); | ||
MyRand = rand() % ((pth.size() - 1)); | ||
//qDebug() << pth.at(MyRand) << " - " << MyRand; | ||
QImage *img; | ||
img = new QImage(); | ||
img->load(pth.at(MyRand)); | ||
ui->ImgLabel->setPixmap(QPixmap::fromImage(img->scaled( | ||
ui->ImgLabel->geometry().width(), | ||
ui->ImgLabel->geometry().height(), Qt::IgnoreAspectRatio))); | ||
delete img; | ||
ui->pushButton_2->setEnabled(true); | ||
|
||
|
||
|
||
|
||
} | ||
|
||
unsigned int MainWindow::getNumberFPath(unsigned int V) | ||
{ | ||
QString str = pth.at(V); | ||
return str.split('/').at(1).toInt(); | ||
} | ||
|
||
void MainWindow::on_pushButton_2_clicked() | ||
{ | ||
unsigned int var = getNumberFPath(MyRand); | ||
unsigned int rb; | ||
if (ui->radioButton->isChecked()) { | ||
rb = 1; | ||
} else if (ui->radioButton_2->isChecked()) { | ||
rb =2; | ||
} else { | ||
rb = 3; | ||
} | ||
|
||
if (rb == var) { | ||
cinTrue+=1; | ||
ui->lbl_true->setText("Правильных ответов - " + QString::number(cinTrue)); | ||
} else { | ||
cinFalse +=1; | ||
ui->lbl_false->setText("Неправильных ответов - " + QString::number(cinFalse)); | ||
} | ||
ui->lbl_descr->setText("<<<----- это CIN"+QString::number(var)); | ||
ui->pushButton_2->setEnabled(false); | ||
|
||
} | ||
|
||
void MainWindow::on_pushButton_3_clicked() | ||
{ | ||
pth.clear(); | ||
traverse("*/*", "cin", 0); | ||
ui->pushButton->setEnabled(true); | ||
ui->pushButton->click(); | ||
ui->pushButton_3->setEnabled(false); | ||
ui->pushButton_2->setEnabled(true); | ||
cinTrue = 0; | ||
cinFalse = 0; | ||
cnt=0; | ||
|
||
} | ||
|
||
void MainWindow::on_pushButton_4_clicked() | ||
{ | ||
About* ab = new About(); | ||
ab->show(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#ifndef MAINWINDOW_H | ||
#define MAINWINDOW_H | ||
|
||
#include <QMainWindow> | ||
#include <QString> | ||
#include <QImage> | ||
|
||
#include <vector> | ||
using namespace std; | ||
|
||
namespace Ui { | ||
class MainWindow; | ||
} | ||
|
||
class MainWindow : public QMainWindow | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit MainWindow(QWidget *parent = nullptr); | ||
~MainWindow(); | ||
|
||
|
||
|
||
private slots: | ||
void on_pushButton_clicked(); | ||
|
||
void on_pushButton_2_clicked(); | ||
|
||
void on_pushButton_3_clicked(); | ||
|
||
void on_pushButton_4_clicked(); | ||
|
||
private: | ||
Ui::MainWindow *ui; | ||
vector <QString> pth; | ||
QImage *myimg; | ||
unsigned int MyRand; | ||
unsigned int cinTrue; | ||
unsigned int cinFalse; | ||
unsigned int cnt; | ||
unsigned int getNumberFPath(unsigned int V); | ||
void traverse(const QString &pattern, const QString &dirname, int level); | ||
|
||
}; | ||
|
||
#endif // MAINWINDOW_H |
Oops, something went wrong.