Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
controller.h
Go to the documentation of this file.
1 #ifndef CONTROLLER_H
2 #define CONTROLLER_H
3 
4 #include "guiimage.h"
5 #include "tool.h"
6 
7 #include <QGraphicsPixmapItem>
8 #include <QObject>
9 #include <QVector>
10 
11 class ThumbsWidget;
12 
17 class Controller : public QObject {
18  Q_OBJECT
19 
20  DisplayFormat * bw2dFormat;
21  DisplayFormat *rgb2dFormat;
22  DisplayFormat *bw3dFormat;
28  QVector< GuiImage* > m_images;
36  QVector< QGraphicsPixmapItem* > m_pixmapItems;
37  QVector< QGraphicsPixmapItem* > m_labelItems;
43  int m_currentImagePos;
47  ThumbsWidget *m_thumbsWidget;
51  double scale;
52 
53 public:
54  enum { MaxRecentFiles = 10 };
62  explicit Controller( int views, QObject *parent = 0 );
76  GuiImage* imageAt( int pos );
83  int currentImagePos( ) const;
90  bool addImage( QString fname );
97  bool addLabel( QString label );
104  bool removeCurrentLabel( );
110  void removeCurrentImage( );
117  bool isEmpty( );
123  void clear( );
130  int size( );
135  void setThumbsWidget( ThumbsWidget *thumbsWidget );
145  QGraphicsPixmapItem* getPixmapItem( size_t view );
151  QGraphicsPixmapItem* getLabelItem( size_t view );
152 
153 signals:
157  void currentImageChanged( );
161  void imageUpdated( );
165  void containerUpdated( );
169  void recentFilesUpdated( );
170 public slots:
176  void update( );
183  void setCurrentImagePos( int position );
190  void loadNextImage( );
197  void setCurrentSlice( size_t view, size_t slice );
202  void setZoom( int value );
207  void setInterpolation( bool isSmooth );
211  void rotateAll90( );
216  void rotate90( size_t view );
221  void flipH( size_t view );
226  void flipV( size_t view );
227 
228 private:
233  void setRecentFile( QString fname );
234 };
235 
236 #endif
void setCurrentImagePos(int position)
setCurrentImagePos
Definition: controller.cpp:144
GuiImage * imageAt(int pos)
currentImage
Definition: controller.cpp:28
void recentFilesUpdated()
recentFilesUpdated
void update()
update updates the image pixmaps.
Definition: controller.cpp:118
DisplayFormat * currentFormat()
currentFormat returns the modality of current image.
Definition: controller.cpp:230
The GuiImage class is a bridge to the Bial::Image data structure to the QImage data structure...
Definition: guiimage.h:20
void setCurrentSlice(size_t view, size_t slice)
setCurrentSlice is called by the imageViewer when the slider or the spinbox have theis values updated...
Definition: controller.cpp:165
void setInterpolation(bool isSmooth)
setInterpolation switches between smoot and fast interpolation.
Definition: controller.cpp:175
void rotate90(size_t view)
rotate90 rotates a view in 90 degrees.
Definition: controller.cpp:191
Controller(int views, QObject *parent=0)
Controller&#39;s constructor.
Definition: controller.cpp:8
void flipH(size_t view)
flipH mirrors the current view on X axis.
Definition: controller.cpp:196
bool removeCurrentLabel()
removeCurrentLabel removes the current label from current image.
Definition: controller.cpp:84
void setZoom(int value)
setZoom updates the zoom factor.
Definition: controller.cpp:169
void removeCurrentImage()
removeCurrentImage removes the current image from vector.
Definition: controller.cpp:89
The Controller class is one of the most important classes of the User Interface, and is responsible t...
Definition: controller.h:17
void rotateAll90()
rotateAll90 rotates all views in 90 degrees.
Definition: controller.cpp:186
void flipV(size_t view)
flipV mirrors the current view on Y axis.
Definition: controller.cpp:201
int size()
size
Definition: controller.cpp:114
bool isEmpty()
isEmpty
Definition: controller.cpp:101
void loadNextImage()
loadNextImage is a slot called from controlsdock that loads the next image ( like an circular list )...
Definition: controller.cpp:156
void clear()
clear Clears the image vector, and resets thumbnails.
Definition: controller.cpp:105
QGraphicsPixmapItem * getLabelItem(size_t view)
getLabelItem returns the LabelItem of the view.
Definition: controller.cpp:247
QGraphicsPixmapItem * getPixmapItem(size_t view)
getPixmapItem returns the PixmapItem of the view.
Definition: controller.cpp:243
GuiImage * currentImage()
currentImage
Definition: controller.cpp:24
int currentImagePos() const
currentImagePos
Definition: controller.cpp:35
void currentImageChanged()
This signal is emmited every time the current image changes.
bool addLabel(QString label)
addLabel Adds a label to the current image.
Definition: controller.cpp:78
void setThumbsWidget(ThumbsWidget *thumbsWidget)
setThumbsWidget setThumbsWidget sets the pointer to the thumbnails dock.
Definition: controller.cpp:225
void containerUpdated()
This signal is emmited avery time the m_images vector is updated.
void imageUpdated()
This signal is emmited every time the current image is updated.
bool addImage(QString fname)
addImage Adds an image to vector m_images.
Definition: controller.cpp:39