GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
49 #include "QGoAboutWidget.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;
63 
64 #include "ui_go.h"
65 
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);
86 
87  void SetSingleFileName(const QString & iFileName);
88 
89  void SetMaxNumberOfTraces( unsigned int iN );
90 
91 private slots:
93 
94  void openRecentSingleFile();
95 
96 // void on_actionOpen_Multiple_Files_triggered( );
98 
100 
101  void openRecentDatabaseFile();
102 
103  void openRecentFilesfromDB();
104 
106 
108 
110 
112 
114 
115  void openFilesfromDB();
116 
121 
123 
125 
127 
129 
131 
132  void SetUpDatabase();
133 
135 
136  void DisplayUpdateResults(QString result, bool noerror);
137 
138  void ApplyImageFilter();
139 
140  void tobedone(std::vector< vtkImageData * > );
141 
146 
151  void AddSetUpDatabaseMenu();
152 
153 private:
154 
155  std::map< GoFigure::TabDimensionType, std::list< QAction * > >
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 };
175 
176  void UpdateRecentFileActions(QStringList list, QMenu * menu,
177  QAction * recentFileActions[MaxRecentFiles]);
178 
190  const GoFigure::FileType & iFileType,
191  const std::string & iHeader,
192  const int & iTimePoint,
193  const bool & iUseDatabase);
194 
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 
218 
220 
222 
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 
272  std::list< vtkLSMReader * > m_LSMReader;
276 
279 
281  void ReadSettings();
282 
284  void WriteSettings();
285 
287 
291 
298 
301 
303  QString strippedName(const QString & fullFileName);
304 
305 private:
306  unsigned int m_MaxNumberOfTraces;
308 };
309 #endif
QToolBar * m_ViewToolBar
Abstract class for one tab element in GoFigure2.
void LoadAllTracesFromDatabaseManager(const int &iT)
void on_actionClose_all_triggered()
QGoTabManager * m_TabManager
QGoNetworkUtilities * m_NetworkUtilities
Q_DISABLE_COPY(QGoMainWindow)
void RemoveSetUpDatabaseMenu()
remove the action &#39;Set up Database&#39; from the Database menu.
itk::QtProgressBar m_Bar
QToolBar * m_TracesToolBar
QString strippedName(const QString &fullFileName)
Remove path from a given FileName.
QMenu * m_FilteringMenu
void SetMaxNumberOfTraces(unsigned int iN)
void on_actionReport_a_bug_triggered()
QGoWizardDB * m_DBWizard
Element of the QTabWidget to be used to visualized 2D images.
void on_actionClose_triggered()
void DisplayUpdateResults(QString result, bool noerror)
GoFigureFileInfoHelperMultiIndexContainer GetFileContainerForMultiFiles(std::string &ioHeader_Filename, std::string iFirstFileName)
get the file container and the header filename for one file part of a megacapture imaging session ...
void AddToMenu(QObject *, const QStringList &, QMenu *, const char *, QActionGroup *)
QAction * recentMultipleFileActions[MaxRecentFiles]
void tobedone(std::vector< vtkImageData * >)
void LoadMeshesFromDatabase(const int &iT)
QGoMainWindow(QWidget *iParent=0, Qt::WindowFlags iFlags=0)
QToolBar * m_TraceSettingsToolBar
void SetSingleFileName(const QString &iFileName)
QAction * recentDatabaseFileActions[MaxRecentFiles]
void on_actionUser_mailing_list_triggered()
QGoDBInitializationWizard * m_DBInitializationWizard
void SetCurrentMultiFile(const QString &fileName)
void AddSetUpDatabaseMenu()
add the action &#39;Set up Database&#39; to the Database menu if it doesn&#39;t have been already added...
QString m_CurrentFile
current file name
void SetUpMenusToolBarsFor3dwtImage(QGoTabImageView3DwT *iT)
GoFigure2&#39;s main window.
Definition: QGoMainWindow.h:71
std::map< GoFigure::TabDimensionType, std::list< QAction * > > m_TabDimPluginActionMap
void on_actionGoFigure2_Website_triggered()
void OpenLSMImage(const QString &iFile, const int &iTimePoint)
Open LSM image.
void SetCurrentDatabaseFile(const QString &fileName)
void SetupPluginsAndDockWidgetFromTab(QGoTabElementBase *iT)
QStringList m_RecentSingleFiles
list of recent files
itk::QtSignalAdaptor m_SignalAdaptor
void CreateSignalSlotsConnection()
void openRecentFilesfromDB()
QGoTabImageView2D * CreateNewTabFor2DImage(vtkImageData *, const QString &)
QAction * actionSet_Up_Database
void openRecentSingleFile()
QGoAboutWidget * m_AboutWidget
std::list< vtkLSMReader * > m_LSMReader
QStringList m_RecentDatabaseFiles
void on_actionDeveloper_mailing_list_triggered()
void SetUpGeneralMenusToolBars(QGoTabElementBase *iT)
void LoadTracksFromDatabase(const int &iT)
void on_actionAbout_triggered()
void UpdateRecentFileActions(QStringList list, QMenu *menu, QAction *recentFileActions[MaxRecentFiles])
unsigned int m_MaxNumberOfTraces
void LoadContoursFromDatabase(const int &iT)
QAction * recentSingleFileActions[MaxRecentFiles]
void on_actionOpen_MegaCapture_Files_triggered()
QStringList m_PluginFileNames
void on_actionQuit_triggered()
QGoTabImageView3D * CreateNewTabFor3DImage(vtkImageData *, const QString &)
bool ComputeFileType(const QString &iFileName, GoFigure::FileType &oFileType)
Compute GoFigure file type from a given filename.
void openRecentMultipleFile()
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
QToolBar * m_ModeToolBar
void openFilesfromDB()
void PopulateMenus(QObject *plugin)
void DisplayFilesfromDB(std::string iFirst_Filename)
typedef WindowFlags
void on_actionAbout_Qt_triggered()
void on_actionCheck_For_Updates_triggered()
QStringList m_RecentMultipleFiles
void on_actionExport_LSM_to_MegaFile_triggered()
Open dialog window to set the file output path and format.
void on_actionOpen_Single_File_triggered()
About Widget which includes the list of authors, licenses, copyrights, dates, versions...
void SetCurrentSingleFile(const QString &fileName)
void on_actionUse_DataBase_triggered()
void openRecentFile(const bool &IsSerie)
This class leads the user to chose its imagingsession and enables to get the corresponding filenames ...
Definition: QGoWizardDB.h:65
As of now, the main purpose of this class is to check for updates on the official download site of go...
QGoTabImageView3DwT * CreateNewTabFor3DwtImage(const GoFigureFileInfoHelperMultiIndexContainer &iFileList, const GoFigure::FileType &iFileType, const std::string &iHeader, const int &iTimePoint, const bool &iUseDatabase)
Create a new tab in the TabWidget for a 3DwT image from one megacapture (from the database...
void openRecentDatabaseFile()