Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
displayformat.h
Go to the documentation of this file.
1 #ifndef DISPLAYFORMAT_H
2 #define DISPLAYFORMAT_H
3 
4 #include <QColor>
5 #include <QObject>
6 #include <QVector>
7 #include <array>
8 
9 enum class Modality { BW2D = 1, RGB2D = 2, BW3D = 4 };
10 enum class Layout { GRID, HORIZONTAL, VERTICAL };
11 enum class Views { SHOW0 = 1, SHOW1 = 2, SHOW2 = 4, SHOW3 = 8, SHOW012 = 7, SHOW123 = 14, SHOW0123 = 15 };
12 
13 class DisplayFormat : public QObject {
14  Q_OBJECT
15 public:
16  explicit DisplayFormat( QObject *parent );
17  ~DisplayFormat( );
18 
19  Modality modality( ) const;
20 
21  Layout currentLayout( ) const;
22  virtual void setCurrentLayout( const Layout &currentLayout );
23 
24  Views currentViews( ) const;
25  virtual void setCurrentViews( const Views &currentViews );
26 
27  bool hasViewerControls( ) const;
28 
29  bool enableTools( ) const;
30 
31  bool rotateAll( ) const;
32 
33  bool rotateSingle( ) const;
34 
35  bool hasOverlay( ) const;
36 
37  bool showNiftiViews( ) const;
38 
39  bool showNiftiAxis( ) const;
40 
41  bool showOrientation( ) const;
42 
43  bool showPpmViews( ) const;
44 
45  bool showPpmChannels( ) const;
46 
47  bool overlay( ) const;
48 
49  void setOverlay( bool overlay );
50 
51  void toggleOverlay( );
52 
53  bool hasLayout( ) const;
54 
55  bool has3Views( ) const;
56 
57  bool has4Views( ) const;
58 
59  std::array< bool, 4 > getViews( );
60 
61  int getNumberOfViews( ) const;
62  virtual void setNumberOfViews( int numberOfViews ) = 0;
63 
64  QColor overlayColor( ) const;
65  void setOverlayColor( const QColor &overlayColor );
66 
67  size_t getMaximumNumberOfViews( ) const;
68 
69 signals:
70  void updated( );
71 
72 protected:
76 
77  void loadSettings( );
78  bool m_overlay;
79 
84 
89 
95 
100 };
101 
102 class BW2DFormat : public DisplayFormat {
103 public:
104  BW2DFormat( QObject *parent = 0 );
105  void setNumberOfViews( int numberOfViews );
106 };
107 
108 class BW3DFormat : public DisplayFormat {
109 public:
110  BW3DFormat( QObject *parent = 0 );
111  void setNumberOfViews( int numberOfViews );
112 };
113 
114 class RGB2DFormat : public DisplayFormat {
115 public:
116  RGB2DFormat( QObject *parent = 0 );
117  void setNumberOfViews( int numberOfViews );
118 };
119 
120 #endif /* DISPLAYFORMAT_H */
bool m_showNiftiViews
Definition: displayformat.h:90
Modality
Definition: displayformat.h:9
Modality m_modality
Definition: displayformat.h:73
Views
Definition: displayformat.h:11
bool m_showPpmChannels
Definition: displayformat.h:94
Views defaultViews
Definition: displayformat.h:96
bool m_hasViewerControls
Definition: displayformat.h:80
QColor m_overlayColor
Definition: displayformat.h:99
Views m_currentViews
Definition: displayformat.h:75
Layout m_currentLayout
Definition: displayformat.h:74
bool m_showNiftiAxis
Definition: displayformat.h:91
bool m_showOrientation
Definition: displayformat.h:92
Layout
Definition: displayformat.h:10
size_t m_maximumNumberOfViews
Definition: displayformat.h:98