Skip to content
Snippets Groups Projects
Commit d5611d29 authored by Sacha Percot-Tétu's avatar Sacha Percot-Tétu
Browse files

Minor corrections

parent 45e0d3a5
No related branches found
No related tags found
No related merge requests found
......@@ -22,23 +22,3 @@
using namespace std;
using namespace imagein;
ImageListBox::ImageListBox(QWidget *parent, const Image* img, const map<const Image*, string>& imgList) :
QComboBox(parent)
{
int i = 0, index = 0;
for(map<const Image*, string>::const_iterator it = imgList.begin(); it != imgList.end(); ++it) {
_images.insert(pair<string, const Image*>(it->second, it->first));
this->insertItem(i, QString(it->second.c_str()));
if(it->first == img) index = i;
}
this->setCurrentIndex(index);
}
const Image* ImageListBox::currentImage() {
string name = this->currentText().toStdString();
map<string, const Image*>::iterator it = _images.find(name);
if(it != _images.end()) {
return _images[name];
}
return NULL;
}
......@@ -26,19 +26,34 @@
#include <Image.h>
class ImageListBox : public QComboBox
template<typename D>
class ImageListBox_t : public QComboBox
{
Q_OBJECT
public:
explicit ImageListBox(QWidget *parent, const imagein::Image*, const std::map<const imagein::Image*, std::string>&);
const imagein::Image* currentImage();
signals:
public slots:
explicit ImageListBox_t(QWidget *parent, const imagein::Image_t<D>* img, const std::map<const imagein::Image_t<D>*, std::string>& imgList)
: QComboBox(parent)
{
int i = 0, index = 0;
for(typename std::map<const imagein::Image_t<D>*, std::string>::const_iterator it = imgList.begin(); it != imgList.end(); ++it) {
_images.insert(std::pair<std::string, const imagein::Image_t<D>*>(it->second, it->first));
this->insertItem(i, QString(it->second.c_str()));
if(it->first == img) index = i;
}
this->setCurrentIndex(index);
}
const imagein::Image_t<D>* currentImage() {
std::string name = this->currentText().toStdString();
typename std::map<std::string, const imagein::Image_t<D>*>::iterator it = _images.find(name);
if(it != _images.end()) {
return _images[name];
}
return NULL;
}
protected:
std::map<std::string, const imagein::Image*> _images;
std::map<std::string, const imagein::Image_t<D>*> _images;
};
typedef ImageListBox_t<imagein::Image::depth_t> ImageListBox;
#endif // IMAGELISTBOX_H
......@@ -41,6 +41,7 @@
#include "Operations/SignalToNoiseOp.h"
#include "Operations/MeanSquaredErrorOp.h"
#include "Operations/FFTOp.h"
#include "Operations/IFFTOp.h"
using namespace genericinterface;
using namespace std;
......
......@@ -34,7 +34,7 @@ namespace genericinterface {
class GenericOperation {
public:
GenericOperation(std::string name) : _name(name), _ws(NULL) {}
GenericOperation(std::string name) : _name(name), _ws(NULL), _curImgWnd(NULL) {}
inline std::string getName() { return _name; }
......@@ -52,6 +52,7 @@ class GenericOperation {
void outText(std::string);
std::string _name;
EIImageService* _ws;
genericinterface::ImageWindow* _curImgWnd;
private:
void outImgWnd(genericinterface::ImageWindow* imgWnd, std::string title);
};
......
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