Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
*.o
*.egsphant.gz
*.log
eb_gui
eb_gui.app/*
*.dcm
*.stash
source/moc_*
source/Makefile
source/.qmake.stash
*/*.zip
LDR_Phantom_Test_Case
configuration.txt
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ A Graphical User Interface (GUI) made for EGSnrc application egs_brachy, with ad

Installation:

Ensure Qt5 is installed, along with an appropriate version of qmake along with it. Navigate to the source code directory, and invoke the following commands:
Ensure Qt 6 is installed (widgets and charts modules), along with an appropriate version of qmake. Navigate to the source code directory, and invoke the following commands:

> qmake;
> make

which will first create a Makefile using the appropriate Qt libraries on your computer qmake finds, then compile the actual program. The program is fairly robust and takes a while to compile, especially the database.cpp file which contains tag data for every DICOM tag. After compilation is complete, there should be an eb_gui file that is executeable in the parent directory.
which will first create a Makefile using the appropriate Qt libraries on your computer qmake finds, then compile the actual program. The program is fairly robust and takes a while to compile, especially the database.cpp file which contains tag data for every DICOM tag. After compilation is complete, there should be an `eb_gui` executable in the parent directory.

On systems where both Qt 5 and Qt 6 are installed, invoke Qt 6's qmake explicitly (for example `qmake6` or the full path to Qt 6's `qmake`).
1 change: 1 addition & 0 deletions source/GUI/appInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#ifndef APPINTERFACE_H
#define APPINTERFACE_H

#include <QtWidgets>
#include <QtGui>
#include <iostream>
#include "../interface.h"
Expand Down
40 changes: 21 additions & 19 deletions source/GUI/doseInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@

// Constructors
doseInterface::doseInterface() :
allowedReals(QRegExp(REGEX_REAL)),
allowedPosReals(QRegExp(REGEX_REAL_POS)),
allowedPosRealArrs(QRegExp(REGEX_REAL_POS_ARR)),
allowedNats(QRegExp(REGEX_NATURAL_POS)),
allowedPercents(QRegExp(REGEX_PERCENT)),
allowedPercentArrs(QRegExp(REGEX_PERCENT_ARR)) {
allowedReals(QRegularExpression(REGEX_REAL)),
allowedPosReals(QRegularExpression(REGEX_REAL_POS)),
allowedPosRealArrs(QRegularExpression(REGEX_REAL_POS_ARR)),
allowedNats(QRegularExpression(REGEX_NATURAL_POS)),
allowedPercents(QRegularExpression(REGEX_PERCENT)),
allowedPercentArrs(QRegularExpression(REGEX_PERCENT_ARR)) {
parent = (Interface*)parentWidget();

log = new logWindow();
Expand All @@ -55,12 +55,12 @@ allowedPercentArrs(QRegExp(REGEX_PERCENT_ARR)) {
}

doseInterface::doseInterface(Interface* p) :
allowedReals(QRegExp(REGEX_REAL)),
allowedPosReals(QRegExp(REGEX_REAL_POS)),
allowedPosRealArrs(QRegExp(REGEX_REAL_POS_ARR)),
allowedNats(QRegExp(REGEX_NATURAL_POS)),
allowedPercents(QRegExp(REGEX_PERCENT)),
allowedPercentArrs(QRegExp(REGEX_PERCENT_ARR)) {
allowedReals(QRegularExpression(REGEX_REAL)),
allowedPosReals(QRegularExpression(REGEX_REAL_POS)),
allowedPosRealArrs(QRegularExpression(REGEX_REAL_POS_ARR)),
allowedNats(QRegularExpression(REGEX_NATURAL_POS)),
allowedPercents(QRegularExpression(REGEX_PERCENT)),
allowedPercentArrs(QRegularExpression(REGEX_PERCENT_ARR)) {
parent = p;

log = new logWindow();
Expand Down Expand Up @@ -880,7 +880,7 @@ void doseInterface::connectLayout() {
sigMap->setMapping(isoDoseBox[1], 1);
sigMap->setMapping(isoDoseBox[2], 2);

connect(sigMap, SIGNAL(mapped(int)),
connect(sigMap, SIGNAL(mappedInt(int)),
this, SLOT(loadIsoDose(int)));

// Change all colours
Expand All @@ -902,7 +902,7 @@ void doseInterface::connectLayout() {
for (int i = 0; i < 5; i++)
sigMap->setMapping(isoColourButton[i], 3+i);

connect(sigMap, SIGNAL(mapped(int)),
connect(sigMap, SIGNAL(mappedInt(int)),
this, SLOT(previewChangeColor(int)));

// Histogram ~~~~~~~~~~~~
Expand Down Expand Up @@ -1954,7 +1954,7 @@ QImage doseInterface::createLegend() {
pen.setColor(Qt::black);

QFont font;
font.setWeight(75);
font.setWeight(QFont::Bold);
font.setPointSize(10);

painter.begin(&legend);
Expand Down Expand Up @@ -3310,17 +3310,19 @@ void doseInterface::savePreviewEgsphant() {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Hover Label Class~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*******************************************************************************/
void HoverLabel::mousePressEvent(QMouseEvent *event) {
if (event->x() > 0 && event->x() < width() && event->y() > 0 && event->y() < height()) {
emit mouseClicked(event->x(),event->y());
const QPoint p = event->position().toPoint();
if (p.x() > 0 && p.x() < width() && p.y() > 0 && p.y() < height()) {
emit mouseClicked(p.x(), p.y());
}
event->accept();
}

void HoverLabel::wheelEvent(QWheelEvent *event) {
if (event->delta() > 0 && event->x() > 0 && event->x() < width() && event->y() > 0 && event->y() < height()) {
const QPointF p = event->position();
if (event->angleDelta().y() > 0 && p.x() > 0 && p.x() < width() && p.y() > 0 && p.y() < height()) {
emit mouseWheelUp();
}
else if (event->x() > 0 && event->x() < width() && event->y() > 0 && event->y() < height()) {
else if (p.x() > 0 && p.x() < width() && p.y() > 0 && p.y() < height()) {
emit mouseWheelDown();
}
event->accept();
Expand Down
13 changes: 7 additions & 6 deletions source/GUI/doseInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#ifndef DOSEINTERFACE_H
#define DOSEINTERFACE_H

#include <QtWidgets>
#include <QtGui>
#include <QtCharts>
#include <iostream>
Expand All @@ -61,12 +62,12 @@ class doseInterface : public QWidget {

Interface *parent; // Pointer to the parent to access data with

QRegExpValidator allowedReals;
QRegExpValidator allowedPosReals;
QRegExpValidator allowedPosRealArrs;
QRegExpValidator allowedNats;
QRegExpValidator allowedPercents;
QRegExpValidator allowedPercentArrs;
QRegularExpressionValidator allowedReals;
QRegularExpressionValidator allowedPosReals;
QRegularExpressionValidator allowedPosRealArrs;
QRegularExpressionValidator allowedNats;
QRegularExpressionValidator allowedPercents;
QRegularExpressionValidator allowedPercentArrs;

// Shared objects
QScrollArea *canvasArea;
Expand Down
4 changes: 2 additions & 2 deletions source/GUI/ebInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

// Constructors
ebInterface::ebInterface()
: allowedNums(QRegExp(REGEX_REAL_POS)) {
: allowedNums(QRegularExpression(REGEX_REAL_POS)) {
parent = (Interface*)parentWidget();

console = new consoleWindow;
Expand All @@ -53,7 +53,7 @@ ebInterface::ebInterface()
}

ebInterface::ebInterface(Interface* p)
: allowedNums(QRegExp(REGEX_REAL_POS)) {
: allowedNums(QRegularExpression(REGEX_REAL_POS)) {
parent = p;

console = new consoleWindow();
Expand Down
3 changes: 2 additions & 1 deletion source/GUI/ebInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#ifndef EBINTERFACE_H
#define EBINTERFACE_H

#include <QtWidgets>
#include <QtGui>
#include <iostream>
#include "../interface.h"
Expand All @@ -63,7 +64,7 @@ class ebInterface : public QWidget {
// LAYOUT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
QGridLayout* mainLayout;

QRegExpValidator allowedNums;
QRegularExpressionValidator allowedNums;

QFrame* simulationOptions;
QGridLayout* simulationLayout;
Expand Down
22 changes: 11 additions & 11 deletions source/GUI/phantInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ phantInterface::phantInterface()
// 1) some number of digits
// 2) (e|E)[+]?\d{1,2} character e or E, an optional +, then 1-2 digits
// 3) .\d*(e|E)[+]?\d{1,2} dot ., some number of digits, character e or E, an optional +, then 1-2 digits
: allowedNums(QRegExp(REGEX_REAL_POS)) {
: allowedNums(QRegularExpression(REGEX_REAL_POS)) {
parent = (Interface*)parentWidget();

log = new logWindow();
Expand All @@ -58,7 +58,7 @@ phantInterface::phantInterface(Interface* p)
// 1) some number of digits
// 2) (e|E)[+]?\d{1,2} character e or E, an optional +, then 1-2 digits
// 3) .\d*(e|E)[+]?\d{1,2} dot ., some number of digits, character e or E, an optional +, then 1-2 digits
: allowedNums(QRegExp(REGEX_REAL_POS)) {
: allowedNums(QRegularExpression(REGEX_REAL_POS)) {
parent = p;

log = new logWindow();
Expand Down Expand Up @@ -638,7 +638,7 @@ void phantInterface::loadCTFiles() {
else {
QString temp = "";
for (unsigned int s = 0; s < tempAtt->vl; s++) {
temp.append(tempAtt->vf[s]);
temp.append(QChar(tempAtt->vf[s]));
}

if (temp.trimmed().compare("CT")) { // See if the field contains CT
Expand All @@ -657,7 +657,7 @@ void phantInterface::loadCTFiles() {
if (tempAtt->tag[0] == 0x0010 && tempAtt->tag[1] == 0x0010) {
QString temp = "";
for (unsigned int s = 0; s < tempAtt->vl; s++) {
temp.append(tempAtt->vf[s]);
temp.append(QChar(tempAtt->vf[s]));
}

phantNameEdit->setText(temp);
Expand Down Expand Up @@ -725,7 +725,7 @@ void phantInterface::loadCTDir() { // Very similar to CT files with an extra ste
else {
QString temp = "";
for (unsigned int s = 0; s < tempAtt->vl; s++) {
temp.append(tempAtt->vf[s]);
temp.append(QChar(tempAtt->vf[s]));
}

if (temp.trimmed().compare("CT")) { // See if the field contains CT
Expand All @@ -744,7 +744,7 @@ void phantInterface::loadCTDir() { // Very similar to CT files with an extra ste
if (tempAtt->tag[0] == 0x0010 && tempAtt->tag[1] == 0x0010 && tempAtt->vl) {
QString temp = "";
for (unsigned int s = 0; s < tempAtt->vl; s++) {
temp.append(tempAtt->vf[s]);
temp.append(QChar(tempAtt->vf[s]));
}

phantNameEdit->setText(temp);
Expand Down Expand Up @@ -884,10 +884,10 @@ void phantInterface::loadStruct() {
for (int l = 0; l < att->size(); l++) {
if (att->at(l)->tag[0] == 0x3006 && att->at(l)->tag[1] == 0x0026)
for (unsigned int s = 0; s < att->at(l)->vl; s++)
tempS.append(att->at(l)->vf[s]);
tempS.append(QChar(att->at(l)->vf[s]));
else if (att->at(l)->tag[0] == 0x3006 && att->at(l)->tag[1] == 0x0022)
for (unsigned int s = 0; s < att->at(l)->vl; s++)
tempI.append(att->at(l)->vf[s]);
tempI.append(QChar(att->at(l)->vf[s]));
}
tempS = tempS.trimmed().replace(" ", "_");

Expand Down Expand Up @@ -948,7 +948,7 @@ void phantInterface::loadStruct() {
for (int m = 0; m < att2->size(); m++)
if (att2->at(m)->tag[0] == 0x3006 && att2->at(m)->tag[1] == 0x0050)
for (unsigned int s = 0; s < att2->at(m)->vl; s++)
tempS.append(att2->at(m)->vf[s]);
tempS.append(QChar(att2->at(m)->vf[s]));

pointData = tempS.split('\\');
structZTemp.append(pointData[2].toDouble()/10.0);
Expand All @@ -963,7 +963,7 @@ void phantInterface::loadStruct() {
else if (att->at(l)->tag[0] == 0x3006 && att->at(l)->tag[1] == 0x0084) {
QString tempI = ""; // Get the number
for (unsigned int s = 0; s < att->at(l)->vl; s++)
tempI.append(att->at(l)->vf[s]);
tempI.append(QChar(att->at(l)->vf[s]));
structReferenceTemp = tempI.toInt();
}
}
Expand Down Expand Up @@ -1135,7 +1135,7 @@ void phantInterface::refresh() {
void phantInterface::loadHU2rho() {
QString path = QFileDialog::getOpenFileName(this, tr("Load HU to density conversion table"), parent->data->gui_location+"/database/HU_conversion", tr("HU2RHO file (*.HU2RHO)"));

if (path < 1)
if (path.isEmpty())
return;

// Check if it opens as a text file (at the very least)
Expand Down
3 changes: 2 additions & 1 deletion source/GUI/phantInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#ifndef PHANTINTERFACE_H
#define PHANTINTERFACE_H

#include <QtWidgets>
#include <QtGui>
#include <iostream>
#include "../interface.h"
Expand All @@ -63,7 +64,7 @@ class phantInterface : public QWidget {
// LAYOUT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
QGridLayout *mainLayout;

QRegExpValidator allowedNums;
QRegularExpressionValidator allowedNums;

// Select DICOM files
QLabel* dcmImport;
Expand Down
4 changes: 2 additions & 2 deletions source/GUI/sourceInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void sourceInterface::loadPlan() {
if (tempAtt->tag[0] == 0x0008 && tempAtt->tag[1] == 0x0060) {// See if it is (0008,0060)
QString temp = "";
for (unsigned int s = 0; s < tempAtt->vl; s++) {
temp.append(tempAtt->vf[s]);
temp.append(QChar(tempAtt->vf[s]));
}

if (temp.trimmed().compare("RTPLAN")) {
Expand All @@ -228,7 +228,7 @@ void sourceInterface::loadPlan() {
if (tempAtt->tag[0] == 0x0010 && tempAtt->tag[1] == 0x0010) {
QString temp = "";
for (unsigned int s = 0; s < tempAtt->vl; s++) {
temp.append(tempAtt->vf[s]);
temp.append(QChar(tempAtt->vf[s]));
}

tagEdit->setText(temp);
Expand Down
1 change: 1 addition & 0 deletions source/GUI/sourceInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#ifndef SOURCEINTERFACE_H
#define SOURCEINTERFACE_H

#include <QtWidgets>
#include <QtGui>
#include <iostream>
#include "../interface.h"
Expand Down
Loading