GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGoCreateImgSessionPage.h
Go to the documentation of this file.
1 /*=========================================================================
2  Authors: The GoFigure Dev. Team.
3  at Megason Lab, Systems biology, Harvard Medical school, 2009-11
4 
5  Copyright (c) 2009-11, President and Fellows of Harvard College.
6  All rights reserved.
7 
8  Redistribution and use in source and binary forms, with or without
9  modification, are permitted provided that the following conditions are met:
10 
11  Redistributions of source code must retain the above copyright notice,
12  this list of conditions and the following disclaimer.
13  Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16  Neither the name of the President and Fellows of Harvard College
17  nor the names of its contributors may be used to endorse or promote
18  products derived from this software without specific prior written
19  permission.
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
25  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 =========================================================================*/
34 #ifndef __QGoCreateImgSessionPage_h
35 #define __QGoCreateImgSessionPage_h
36 
37 #include <QWizardPage>
38 #include <QLineEdit>
39 #include <QLabel>
40 #include <QTextEdit>
41 #include <QRadioButton>
42 #include <QComboBox>
43 #include <QStringList>
44 #include <QPushButton>
45 #include <QFileInfo>
46 #include <QString>
47 #include <string>
48 
49 #include "GoDBImageRow.h"
50 #include "GoDBCoordinateRow.h"
52 #include "vtkMySQLDatabase.h"
54 #include "itkMegaCaptureImport.h"
55 #include "QTextEditChild.h"
56 
57 #include "QGoGUILibConfigure.h"
58 
59 class QGOGUILIB_EXPORT QGoCreateImgSessionPage:public QWizardPage
60 {
61  Q_OBJECT
62 public:
63  explicit QGoCreateImgSessionPage(QWidget *parent = 0);
65 
66  void initializePage();
67 
68  bool validatePage();
69 
70  void cleanupPage();
71 
72  vtkMySQLDatabase *m_DatabaseConnector;
73 
74  GoFigureFileInfoHelperMultiIndexContainer GetMultiIndexFileContainer();
75 
76  std::string GetMegaCaptureHeaderFilename();
77 
78 private:
80  QStringList GetListMicroscopes();
81 
85  int CreateImgSession(vtkMySQLDatabase *DatabaseConnector);
86 
90  void ImportImages(vtkMySQLDatabase *DatabaseConnector); //,QString
91  // newfilename);
92 
93  typedef GoFigureFileInfoHelperMultiIndexContainer::iterator
95 
99  int CreateImageCoordMin(vtkMySQLDatabase *DatabaseConnector,
101 
104  int FindChannelIDForImage(vtkMySQLDatabase *DatabaseConnector,
105  int ImagingSessionID,
106  int ChannelNumber);
107 
109  GoDBImageRow CreateImage(vtkMySQLDatabase *DatabaseConnector,
110  MultiIndexContainerIteratorType It, int ImagingSessionID);
111 
114  void CreateChannels(vtkMySQLDatabase *DatabaseConnector, int ImagingSessionID);
115 
119  void CreateImgSessionCoord(vtkMySQLDatabase *DatabaseConnector, int ImagingSessionID);
120 
121  void OpenDBConnection();
122 
123  bool SaveInfoInDatabase();
124 
127  bool ImportInfoFromMegacapture(QString newfilename);
128 
142 
147 protected slots:
148 
149  void SelectImages();
150 
151  void AddMicroscopes();
152 
153  void UpdateListMicroscopes();
154 
155 private:
156  unsigned int m_PCoordMin;
157  unsigned int m_PCoordMax;
158 
159  unsigned int m_RCoordMin;
160  unsigned int m_RCoordMax;
161 
162  unsigned int m_CCoordMin;
163  unsigned int m_CCoordMax;
164 
165  unsigned int m_XTileCoordMin;
166  unsigned int m_XTileCoordMax;
167 
168  unsigned int m_YTileCoordMin;
169  unsigned int m_YTileCoordMax;
170 
171  unsigned int m_ZTileCoordMin;
172  unsigned int m_ZTileCoordMax;
173 
174  unsigned int m_ZCoordMin;
175  unsigned int m_ZCoordMax;
176 
177  unsigned int m_TCoordMin;
178  unsigned int m_TCoordMax;
179 };
180 #endif
GoDBCoordinateRow m_ImgSessionCoordMax
in the QTextEdit class, there is no method to have a restriction on the number of characters the user...
virtual bool validatePage()
GoDBCoordinateRow m_ImgSessionCoordMin
manages a map with keys matching fields of the gofiguredatabase Coordinate table and values of the ma...
GoFigureFileInfoHelperMultiIndexContainer::iterator MultiIndexContainerIteratorType
virtual void cleanupPage()
manages a map with keys matching fields of the gofiguredatabase Image table and values of the map mat...
Definition: GoDBImageRow.h:48
MegaCaptureHeaderReader m_HeaderFileInfo
itk::MegaCaptureImport::Pointer m_importFileInfoList
boost::multi_index::multi_index_container< GoFigureFileInfoHelper, boost::multi_index::indexed_by< boost::multi_index::ordered_non_unique< boost::multi_index::tag< m_PCoord >, >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< m_RCoord >, >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< m_CCoord >, >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< m_XTileCoord >, >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< m_YTileCoord >, >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< m_ZTileCoord >, >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< m_ZCoord >, >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< m_Channel >, >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< m_TCoord >, > >> GoFigureFileInfoHelperMultiIndexContainer
virtual void initializePage()
vtkMySQLDatabase * m_DatabaseConnector
SmartPointer< Self > Pointer