Skip to content
Snippets Groups Projects
Commit 7f62f5cb authored by Provot Bertrand's avatar Provot Bertrand
Browse files

Updated convert to uchar
parent 48509804
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@
#include <QSpinBox>
#include <QComboBox>
#include <QStringList>
#include <QString>
UCharConvertDialog::UCharConvertDialog(QWidget *parent) :
......@@ -74,3 +75,7 @@ int UCharConvertDialog::getCombo(){
int UCharConvertDialog::getOffset(){
return _spinBox->value();
}
QString UCharConvertDialog::getText(){
return _comboBox->currentText();
}
......@@ -5,6 +5,7 @@
#include <QSpinBox>
#include <QLabel>
#include <QComboBox>
#include <QString>
namespace Ui {
class UCharConvertDialog;
......@@ -18,6 +19,7 @@ public:
explicit UCharConvertDialog(QWidget *parent = 0);
int getCombo();
int getOffset();
QString getText();
public slots:
......
......@@ -56,11 +56,13 @@ void UCharConvertOp::operator()(const imagein::Image_t<double>* from, const std:
std::string LogMessage = "";
Image_t<int> * tempIntImg;
int offset;
std::string windowName;
switch(dialog->getCombo())
{
case 0 :
resImg = Converter<Image>::convertAndRound(*from);
windowName = qApp->translate("Operations","Cropped").toStdString();
break;
case 1 :
......@@ -68,6 +70,7 @@ void UCharConvertOp::operator()(const imagein::Image_t<double>* from, const std:
tempIntImg->normalize();
resImg = Converter<Image>::convert(*tempIntImg);
delete tempIntImg;
windowName = qApp->translate("Operations","Normalized").toStdString();
break;
case 2 :
......@@ -76,27 +79,32 @@ void UCharConvertOp::operator()(const imagein::Image_t<double>* from, const std:
offset = dialog->getOffset();
resImg = Converter<Image>::convertAndOffset(*tempIntImg, &LogMessage, offset);
delete tempIntImg;
windowName = qApp->translate("Operations","Offset").toStdString();
break;
case 4 :
tempIntImg = Converter<Image_t<double>>::convertToInt(*from);
resImg = Converter<Image>::convertScaleAndOffset(*tempIntImg, &LogMessage);
delete tempIntImg;
windowName = qApp->translate("Operations","Offset and scaled").toStdString();
break;
case 3 :
tempIntImg = Converter<Image_t<double>>::convertToInt(*from);
resImg = Converter<Image>::convertAndScale(*tempIntImg, &LogMessage);
delete tempIntImg;
windowName = qApp->translate("Operations","Scaled").toStdString();
break;
default:
std::cout << "Default conversion" << std::endl;
resImg = Converter<Image>::convertAndRound(*from);
windowName = qApp->translate("Operations","Cropped").toStdString();
break;
}
outImage(resImg, "Title");
//si erreur lors du chargement alors non de fenêtre vide
outImage(resImg, windowName);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment