// This slot is call when user open file.--------------------------------------
void DR_GUI_NEW::screenFile(){
// Get user selected file path
fileName
= QFileDialog::getOpenFileName(this, tr
("Open image file for screening"),
tr("Images (*.bmp *.jpg *.tiff *.png *.tif)"));
// filename is not empty
if (!fileName.isEmpty()) {
image.load(fileName);
// Load input image
if (image.isNull()) {
QMessageBox::information(this, tr
("Diabetic Retinopathy"), tr
("Cannot load \"%1\"").
arg(fileName
));
return ;
}
ui.radioButton_IP_1->setEnabled(true);
// Show input Image
ui.
mainImageLabel->setPixmap
(QPixmap::fromImage(image
));
// Enable Processing Algorithms
ui.actionOld_Algorithms->setEnabled(true);
ui.actionNew_Algorithm->setEnabled(true);
}
//file name is empty
else{
// If filename is empty
// Only empty when user press cancel
// No need to catch error Here ??
}
}// end screenFile slot
// screenDirectory slot -------------------------------------------------------
void DR_GUI_NEW::screenDirectory(){
QMessageBox::information(this, tr
("Directory Mode"), tr
("Welcom to Directory Mode"));
tr("Please select directory to screen"),
}
//-----------------------------------------------------------------------------
// This slot is call when user open file.--------------------------------------
void DR_GUI_NEW::screenFile(){
// Get user selected file path
fileName = QFileDialog::getOpenFileName(this, tr("Open image file for screening"),
QDir::currentPath(),
tr("Images (*.bmp *.jpg *.tiff *.png *.tif)"));
// filename is not empty
if (!fileName.isEmpty()) {
image.load(fileName);
// Load input image
if (image.isNull()) {
QMessageBox::information(this, tr("Diabetic Retinopathy"), tr("Cannot load \"%1\"").arg(fileName));
return ;
}
ui.radioButton_IP_1->setEnabled(true);
// Show input Image
ui.mainImageLabel->setPixmap(QPixmap::fromImage(image));
// Enable Processing Algorithms
ui.actionOld_Algorithms->setEnabled(true);
ui.actionNew_Algorithm->setEnabled(true);
}
//file name is empty
else{
// If filename is empty
// Only empty when user press cancel
// No need to catch error Here ??
}
}// end screenFile slot
// screenDirectory slot -------------------------------------------------------
void DR_GUI_NEW::screenDirectory(){
QMessageBox::information(this, tr("Directory Mode"), tr("Welcom to Directory Mode"));
dirPath = QFileDialog::getExistingDirectory(this,
tr("Please select directory to screen"),
QDir::currentPath(),
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
}
//-----------------------------------------------------------------------------
To copy to clipboard, switch view to plain text mode
Bookmarks