GOFIGURE2
0.9.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
Main
QGoMainWindow.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
35
#ifndef __QGoMainWindow_h
36
#define __QGoMainWindow_h
37
38
#include <QMainWindow>
39
#include <QDir>
40
41
// #include "itkImage.h"
42
// #include "itkImageToVTKImageFilter.h"
43
44
#include "
itkQtProgressBar.h
"
45
#include "
itkQtAdaptor.h
"
46
47
#include "
GoFigureFileInfoMultiIndexContainerHelper.h
"
48
#include "
GoFigureGlobalDefinition.h
"
49
#include "
QGoAboutWidget.h
"
50
#include "
QGoDBInitializationWizard.h
"
51
#include "
QGoTabImageView3DwT.h
"
52
53
class
vtkImageData;
54
55
class
vtkLSMReader
;
56
57
class
QGoWizardDB
;
58
class
QGoTabManager
;
59
class
QGoTabImageView3D
;
60
class
QGoTabImageView2D
;
61
class
QGoTabElementBase
;
62
class
QGoNetworkUtilities
;
63
64
#include "ui_go.h"
65
71
class
QGoMainWindow
:
public
QMainWindow
,
72
private
Ui::go_mainwindow
73
{
74
Q_OBJECT
75
public
:
76
friend
class
QGoTabManager
;
77
78
// typedef itk::Image< unsigned char, 3 > ImageType;
79
// typedef itk::ImageToVTKImageFilter< ImageType > VTKConvertImageType;
80
// typedef VTKConvertImageType::Pointer VTKConvertImagePointer;
81
82
// typedef itk::MultiFileReader::FILETYPE FILETYPE;
83
84
explicit
QGoMainWindow
(
QWidget
*iParent = 0,
Qt::WindowFlags
iFlags = 0);
85
~QGoMainWindow
();
86
87
void
SetSingleFileName
(
const
QString
& iFileName);
88
89
void
SetMaxNumberOfTraces
(
unsigned
int
iN );
90
91
private
slots:
92
void
on_actionOpen_Single_File_triggered
();
93
94
void
openRecentSingleFile
();
95
96
// void on_actionOpen_Multiple_Files_triggered( );
97
void
on_actionOpen_MegaCapture_Files_triggered
();
98
99
void
openRecentMultipleFile
();
100
101
void
openRecentDatabaseFile
();
102
103
void
openRecentFilesfromDB
();
104
105
void
on_actionGoFigure2_Website_triggered
();
106
107
void
on_actionReport_a_bug_triggered
();
108
109
void
on_actionUser_mailing_list_triggered
();
110
111
void
on_actionDeveloper_mailing_list_triggered
();
112
113
void
on_actionUse_DataBase_triggered
();
114
115
void
openFilesfromDB
();
116
120
void
on_actionExport_LSM_to_MegaFile_triggered
();
121
122
void
on_actionClose_triggered
();
123
124
void
on_actionClose_all_triggered
();
125
126
void
on_actionQuit_triggered
();
127
128
void
on_actionAbout_triggered
();
129
130
void
on_actionAbout_Qt_triggered
();
131
132
void
SetUpDatabase
();
133
134
void
on_actionCheck_For_Updates_triggered
();
135
136
void
DisplayUpdateResults
(
QString
result,
bool
noerror);
137
138
void
ApplyImageFilter
();
139
140
void
tobedone
(std::vector< vtkImageData * > );
141
145
void
RemoveSetUpDatabaseMenu
();
146
151
void
AddSetUpDatabaseMenu
();
152
153
private
:
154
155
std::map< GoFigure::TabDimensionType, std::list< QAction * > >
156
m_TabDimPluginActionMap
;
157
159
void
openRecentFile
(
const
bool
& IsSerie);
160
161
void
DisplayFilesfromDB
(std::string iFirst_Filename);
162
164
void
SetCurrentSingleFile
(
const
QString
& fileName);
165
166
void
SetCurrentMultiFile
(
const
QString
& fileName);
167
168
void
SetCurrentDatabaseFile
(
const
QString
& fileName);
169
171
enum
{
MaxRecentFiles
= 5 };
172
QAction
*
recentSingleFileActions
[
MaxRecentFiles
];
173
QAction
*
recentMultipleFileActions
[
MaxRecentFiles
];
174
QAction
*
recentDatabaseFileActions
[
MaxRecentFiles
];
175
176
void
UpdateRecentFileActions
(
QStringList
list,
QMenu
* menu,
177
QAction
* recentFileActions[
MaxRecentFiles
]);
178
188
QGoTabImageView3DwT
*
CreateNewTabFor3DwtImage
(
189
const
GoFigureFileInfoHelperMultiIndexContainer
& iFileList,
190
const
GoFigure::FileType
& iFileType,
191
const
std::string & iHeader,
192
const
int
& iTimePoint,
193
const
bool
& iUseDatabase);
194
200
QGoTabImageView3DwT
*
CreateNewTabFor3DwtImage
(
201
vtkLSMReader
*iReader,
const
QString
& iFile);
202
203
QGoTabImageView3D
*
CreateNewTabFor3DImage
(vtkImageData *,
const
QString
&);
204
205
QGoTabImageView2D
*
CreateNewTabFor2DImage
(vtkImageData *,
const
QString
&);
206
207
/* \brief Open Image with given iFileName
208
\param[in] iFileName */
209
// void OpenImageWithITK( const QString& iFileName );
210
215
void
OpenLSMImage
(
const
QString
& iFile,
const
int
& iTimePoint);
216
217
void
SetupPluginsAndDockWidgetFromTab
(
QGoTabElementBase
*iT);
218
219
void
SetUpGeneralMenusToolBars
(
QGoTabElementBase
*iT);
220
221
void
SetUpMenusToolBarsFor3dwtImage
(
QGoTabImageView3DwT
* iT);
222
229
GoFigureFileInfoHelperMultiIndexContainer
230
GetFileContainerForMultiFiles
(
231
std::string & ioHeader_Filename,
232
std::string iFirstFileName);
233
237
void
LoadAllTracesFromDatabaseManager
(
const
int
& iT);
238
242
//void LoadAllTracesFromDatabase(const int & iT, const std::string & iTrace);
243
244
void
LoadContoursFromDatabase
(
const
int
& iT );
245
void
LoadMeshesFromDatabase
(
const
int
& iT);
246
void
LoadTracksFromDatabase
(
const
int
& iT);
247
255
bool
ComputeFileType
(
const
QString
& iFileName,
GoFigure::FileType
& oFileType);
256
257
void
LoadPlugins
();
258
259
void
PopulateMenus
(
QObject
*plugin);
260
261
void
AddToMenu
(
QObject
*,
const
QStringList
&,
QMenu
*,
262
const
char
*,
QActionGroup
*);
263
264
QMenu
*
m_FilteringMenu
;
265
QDir
m_PluginsDir
;
266
QStringList
m_PluginFileNames
;
267
QGoTabManager
*
m_TabManager
;
268
QToolBar
*
m_ViewToolBar
;
269
QToolBar
*
m_ModeToolBar
;
270
QToolBar
*
m_TracesToolBar
;
271
QToolBar
*
m_TraceSettingsToolBar
;
272
std::list< vtkLSMReader * >
m_LSMReader
;
273
QGoWizardDB
*
m_DBWizard
;
274
QGoAboutWidget
*
m_AboutWidget
;
275
QGoDBInitializationWizard
*
m_DBInitializationWizard
;
276
277
QGoNetworkUtilities
*
m_NetworkUtilities
;
278
bool
m_ManualUpdate
;
279
281
void
ReadSettings
();
282
284
void
WriteSettings
();
285
286
void
CreateSignalSlotsConnection
();
287
289
itk::QtSignalAdaptor
m_SignalAdaptor
;
290
itk::QtProgressBar
m_Bar
;
291
293
QStringList
m_RecentSingleFiles
;
294
QStringList
m_RecentMultipleFiles
;
295
QStringList
m_RecentDatabaseFiles
;
296
bool
m_DatabaseSetUp
;
297
QAction
*
actionSet_Up_Database
;
298
300
QString
m_CurrentFile
;
301
303
QString
strippedName
(
const
QString
& fullFileName);
304
305
private
:
306
unsigned
int
m_MaxNumberOfTraces
;
307
Q_DISABLE_COPY
(
QGoMainWindow
);
308
};
309
#endif
Generated on Mon May 27 2013 08:47:31 for GOFIGURE2 by
1.8.1.2