iRoCS Toolbox  1.1.0
MultiChannelModel.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * This file belongs to the iRoCS Toolbox.
4  *
5  * Copyright (C) 2015 Thorsten Falk
6  *
7  * Image Analysis Lab, University of Freiburg, Germany
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software Foundation,
21  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  *
23  **************************************************************************/
24 
25 #ifndef MULTICHANNELMODEL_HH
26 #define MULTICHANNELMODEL_HH
27 
28 #ifdef HAVE_CONFIG_H
29 #include <config.hh>
30 #endif
31 
32 #include <QtCore/QObject>
33 
34 #include <libArrayToolbox/Array.hh>
36 #include <libArrayToolbox/iRoCS.hh>
38 
39 #include "Marker.hh"
40 #include "ChannelSpecs.hh"
41 
42 class QWidget;
43 class QComboBox;
44 class QStackedWidget;
45 class QLineEdit;
46 class QToolButton;
47 
48 class DataChannelSpecs;
49 class RGBChannelSpecs;
53 class IRoCSChannelSpecs;
55 
56 class ViewWidget;
57 
60 
61 class MultiChannelModel : public QObject
62 {
63 
64 Q_OBJECT
65 
66 public:
67 
68  typedef std::vector<ChannelSpecs*>::iterator iterator;
69 
72 
73  blitz::TinyVector<double,3> const &lowerBoundUm() const;
74  blitz::TinyVector<double,3> const &upperBoundUm() const;
75  blitz::TinyVector<double,3> boundingBoxShapeUm() const;
76  blitz::TinyVector<double,3> const &elementSizeUm() const;
77  void setElementSizeUm(blitz::TinyVector<double,3> const &elementSizeUm);
78 
79  QWidget* channelEditorWidget() const;
80  QWidget* infoWidget() const;
81 
84  atb::Array<blitz::TinyVector<float,3>,3>* channel);
86  atb::Array<int,3> *channel = NULL);
88  Marker::MarkerType markerType = Marker::Point);
90  atb::BSpline< blitz::TinyVector<double,3> > *spline);
94  void removeChannel(ChannelSpecs* channel, bool freeMemory = true);
95  void removeChannel(size_t index);
96  void removeChannel(const std::string& name);
97 
98  size_t nChannels(
99  ChannelSpecs::ChannelTypes types = ChannelSpecs::Any) const;
100 
102 
103  ChannelSpecs* channel(size_t index);
104  ChannelSpecs* channel(const std::string& name);
105  iterator begin();
106  iterator end();
107 
108  void addView(ViewWidget* view);
109  void removeView(ViewWidget* view);
110  std::vector<ViewWidget*>::iterator viewsBegin();
111  std::vector<ViewWidget*>::iterator viewsEnd();
112 
113  void updateInfoWidget(const blitz::TinyVector<double,3>& positionUm);
114 
115  bool modified();
116  void setModified(bool modified);
117 
118 signals:
119 
120  void modifiedFlagChanged(bool);
121  void isEmpty(bool);
122  void containsAnnotationsChanged(bool);
123  void boundingBoxChanged(
124  blitz::TinyVector<double,3> const &, blitz::TinyVector<double,3> const &);
125  void elementSizeChanged(blitz::TinyVector<double,3> const &);
126  void channelAdded(ChannelSpecs *);
128  // Warning: The passed pointer is already released!!! Only use it as unique
129  // channel identifier to remove associated ressources
131  void channelSelectionChanged(int);
132  void annotationChannelSelected(bool);
133 
134 public slots:
135 
136  void setBoundingBoxUm(
137  blitz::TinyVector<double,3> const &lowerBoundUm,
138  blitz::TinyVector<double,3> const &upperBoundUm);
139  void setActiveChannel(int index);
140  void deleteActiveChannel();
141 
142 private slots:
143 
144  void setActiveChannelName();
145  void updateViews();
146 
147 private:
148 
149  void setLowerBoundUm(blitz::TinyVector<double,3> const &lowerBoundUm);
150  void setUpperBoundUm(blitz::TinyVector<double,3> const &upperBoundUm);
151  std::string newChannelName();
152  bool channelNamesUnique();
153  void addChannelSpecs(ChannelSpecs* specs);
154 
155  std::vector<ChannelSpecs*> _channels;
156  std::vector<ViewWidget*> _views;
157 
158  blitz::TinyVector<double,3> _lowerBoundUm, _upperBoundUm;
159  blitz::TinyVector<double,3> _elementSizeUm;
160 
161  QWidget* p_channelEditorWidget;
162  ChannelSelectionControlElement *p_channelSelectionControl;
163  QStackedWidget* p_channelControlStack;
164  QToolButton* p_deleteChannelButton;
165 
166  QWidget* p_infoWidget;
167  QLineEdit* p_positionVxXLineEdit;
168  QLineEdit* p_positionVxYLineEdit;
169  QLineEdit* p_positionVxZLineEdit;
170  QLineEdit* p_positionUmXLineEdit;
171  QLineEdit* p_positionUmYLineEdit;
172  QLineEdit* p_positionUmZLineEdit;
173  QLineEdit* p_valueLineEdit;
174 
175  bool _modified;
176 };
177 
178 #endif
iterator begin()
void boundingBoxChanged(blitz::TinyVector< double, 3 > const &, blitz::TinyVector< double, 3 > const &)
blitz::TinyVector< double, 3 > const & upperBoundUm() const
Array class derived from blitz++ Arrays for handling microscopic datasets with associated element siz...
void deleteActiveChannel()
SplineCurveChannelSpecs * addSplineCurveChannel(atb::BSpline< blitz::TinyVector< double, 3 > > *spline)
blitz::TinyVector< double, 3 > boundingBoxShapeUm() const
std::vector< ViewWidget * >::iterator viewsBegin()
void containsAnnotationsChanged(bool)
The BSpline class provides functions for fitting B-Splines to point clouds and evaluating them at arb...
Definition: ATBSpline.hh:68
The IRoCS class provides means to attach iRoCS to different kinds of processed root images...
Definition: iRoCS.hh:69
blitz::TinyVector< double, 3 > const & elementSizeUm() const
void isEmpty(bool)
IRoCSSCTChannelSpecs * addIRoCSSCTChannel(ShellCoordinateTransform *sct)
QWidget * infoWidget() const
VisualizationChannelSpecs * addVisualizationChannel(atb::Array< int, 3 > *channel=NULL)
void addView(ViewWidget *view)
ChannelSpecs * channel(size_t index)
ChannelSpecs * selectedChannel()
RGBChannelSpecs * addRGBChannel(atb::Array< blitz::TinyVector< float, 3 >, 3 > *channel)
void setActiveChannel(int index)
QWidget * channelEditorWidget() const
void removeView(ViewWidget *view)
DataChannelSpecs * addDataChannel(atb::Array< float, 3 > *channel)
void setModified(bool modified)
The intrinsic root coordinate system.
AnnotationChannelSpecs * addAnnotationChannel(Marker::MarkerType markerType=Marker::Point)
void setElementSizeUm(blitz::TinyVector< double, 3 > const &elementSizeUm)
void updateInfoWidget(const blitz::TinyVector< double, 3 > &positionUm)
void setBoundingBoxUm(blitz::TinyVector< double, 3 > const &lowerBoundUm, blitz::TinyVector< double, 3 > const &upperBoundUm)
ChannelSpecs * addChannel(ChannelSpecs *channel)
std::vector< ViewWidget * >::iterator viewsEnd()
void channelAdded(ChannelSpecs *)
void channelNamesOrIconsChanged()
IRoCSChannelSpecs * addIRoCSChannel(atb::IRoCS *rct)
void modifiedFlagChanged(bool)
size_t nChannels(ChannelSpecs::ChannelTypes types=ChannelSpecs::Any) const
void channelSelectionChanged(int)
void annotationChannelSelected(bool)
void removeChannel(ChannelSpecs *channel, bool freeMemory=true)
MarkerType
Marker.hh "liblabelling_qt4/Marker.hh".
Definition: Marker.hh:73
blitz::TinyVector< double, 3 > const & lowerBoundUm() const
std::vector< ChannelSpecs * >::iterator iterator
void channelRemoved(ChannelSpecs *)
void elementSizeChanged(blitz::TinyVector< double, 3 > const &)
static ChannelTypes const Any
Definition: ChannelSpecs.hh:70