cmtkQtTriplanarWindow.h

Go to the documentation of this file.
00001 /*
00002 //
00003 //  Copyright 1997-2010 Torsten Rohlfing
00004 //
00005 //  Copyright 2004-2010 SRI International
00006 //
00007 //  This file is part of the Computational Morphometry Toolkit.
00008 //
00009 //  http://www.nitrc.org/projects/cmtk/
00010 //
00011 //  The Computational Morphometry Toolkit is free software: you can
00012 //  redistribute it and/or modify it under the terms of the GNU General Public
00013 //  License as published by the Free Software Foundation, either version 3 of
00014 //  the License, or (at your option) any later version.
00015 //
00016 //  The Computational Morphometry Toolkit is distributed in the hope that it
00017 //  will be useful, but WITHOUT ANY WARRANTY; without even the implied
00018 //  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 //  GNU General Public License for more details.
00020 //
00021 //  You should have received a copy of the GNU General Public License along
00022 //  with the Computational Morphometry Toolkit.  If not, see
00023 //  <http://www.gnu.org/licenses/>.
00024 //
00025 //  $Revision: 2398 $
00026 //
00027 //  $LastChangedDate: 2010-10-05 14:54:37 -0700 (Tue, 05 Oct 2010) $
00028 //
00029 //  $LastChangedBy: torstenrohlfing $
00030 //
00031 */
00032 
00033 #ifndef __cmtkQtTriplanarWindow_h_included_
00034 #define __cmtkQtTriplanarWindow_h_included_
00035 
00036 #include <cmtkconfig.h>
00037 
00038 #include <qwidget.h>
00039 #include <qslider.h>
00040 #include <qlayout.h>
00041 #include <qpushbutton.h>
00042 #include <qlineedit.h>
00043 #include <qvalidator.h>
00044 #include <qcombobox.h>
00045 #include <qmenubar.h>
00046 #include <qstatusbar.h>
00047 #include <qlabel.h>
00048 #include <qtabwidget.h>
00049 #include <QGridLayout>
00050 #include <QActionGroup>
00051 
00052 #include <Base/cmtkMacros.h>
00053 #include <IO/cmtkStudy.h>
00054 
00055 #include <Pipeline/cmtkImage.h>
00056 #include <Pipeline/cmtkColormap.h>
00057 #include <Pipeline/cmtkImageToImageRGB.h>
00058 
00059 #include <Qt/cmtkQtProgress.h>
00060 #include <Qt/cmtkQtScrollRenderView.h>
00061 #include <Qt/cmtkQtWindowLevelControls.h>
00062 
00063 namespace
00064 cmtk
00065 {
00066 
00069 
00072 class QtTriplanarWindow :
00074   public QWidget
00075 {
00076   Q_OBJECT // we're using slots
00077 
00078 public:
00080   QtTriplanarWindow();
00081 
00082 protected:
00084   cmtkGetSetMacro(Study::SmartPtr,Study);
00085 
00087   QAction* m_InterpolateAction;
00088 
00090   QAction* m_CrosshairAction;
00091 
00093   QAction* m_CheckerboxAction;
00094 
00096   int m_ZoomFactor;
00097 
00099   void UpdateDialog();
00100 
00102   bool m_BatchMode;
00103 
00105   QActionGroup* m_ZoomActions;
00106 
00107 public slots:
00108   void slotDataChanged( Study::SmartPtr& study );
00109   void slotColormapChanged( Study::SmartPtr& study );
00110   void slotSwitchToStudy( Study::SmartPtr& study );
00111   void slotSwitchToStudyInternal( Study::SmartPtr& study );
00112 
00113 protected slots:
00114   void slotView25();
00115   void slotView33();
00116   void slotView50();
00117   void slotView100();
00118   void slotView200();
00119   void slotView300();
00120   void slotView400();
00121   void slotView500();
00122 
00123   void slotViewInterpolation();
00124   void slotViewCrosshair();
00125   void slotViewCheckerbox();
00126 
00127   void slotExportMenuCmd( QAction* );
00128   void slotRenderAll();
00129 
00131   void slotSetColormap( const QString& cmap );
00132   void slotSetWindowLevel( const QString& wl );
00133   void slotGoToPixel( const QString& xyz );
00134   void slotGoToLocation( const QString& xyz );
00135   void slotExportImage( const QString& filename, const int command );
00136   void slotSetInterpolateMode( const bool mode );
00137   void slotSetCrosshairMode( const bool mode );
00138   void slotSetCheckerboardMode( const bool mode );
00139   void slotSetZoom( const int zoomPercent );
00140 
00142   void slotSwitchImageAx( int imageIndex );
00143   void slotSwitchImageSa( int imageIndex );
00144   void slotSwitchImageCo( int imageIndex );
00145 
00147   void slotMouse3D( Qt::MouseButton, const Vector3D& );
00148 
00150   void slotMouseAx( Qt::MouseButton, const Vector3D& );
00151 
00153   void slotMouseSa( Qt::MouseButton, const Vector3D& );
00154 
00156   void slotMouseCo( Qt::MouseButton, const Vector3D& );
00157 
00159   void slotCenter();
00160 
00162   void slotGoToLocation();
00163 
00165   void slotGoToLandmark();
00166 
00168   void slotDeleteLandmark();
00169 
00171   void slotAddLandmark();
00172 
00174   void slotExportLandmarks();
00175 
00177   void slotImportLandmarks();
00178 
00179 protected:
00181   QMenu* ViewMenu;
00182 
00184   QMenu* ExportMenu;
00185 
00187   DataGrid::IndexType VolumeDims;
00188 
00190   QtScrollRenderView* ScrollRenderViewAx;
00191   QtScrollRenderView* ScrollRenderViewSa;
00192   QtScrollRenderView* ScrollRenderViewCo;
00193 
00194   Image* PipelineImageAx;
00195   Image* PipelineImageSa;
00196   Image* PipelineImageCo;
00197 
00198   Colormap* m_Colormap;
00199 
00200   ImageToImageRGB* ImageToImageRGBAx;
00201   ImageToImageRGB* ImageToImageRGBSa;
00202   ImageToImageRGB* ImageToImageRGBCo;
00203 
00204   QMenuBar* MenuBar;
00205   QGridLayout* GridLayout;
00206   QStatusBar* StatusBar;
00207 
00208   QGridLayout* LandmarksLayout;
00209   QLineEdit* LocationEntryX;
00210   QLineEdit* LocationEntryY;
00211   QLineEdit* LocationEntryZ;
00212   QDoubleValidator* LocationValidatorX;
00213   QDoubleValidator* LocationValidatorY;
00214   QDoubleValidator* LocationValidatorZ;
00215 
00216   QPushButton* GoToLocationButton;
00217   QPushButton* CenterButton;
00218   QPushButton* GoToLandmarkButton;
00219   QPushButton* AddLandmarkButton;
00220   QPushButton* DeleteLandmarkButton;
00221   QPushButton* ExportLandmarksButton;
00222   QPushButton* ImportLandmarksButton;
00223     
00224   QComboBox* LandmarkBox;
00225   QtWindowLevelControls* WindowLevelControls;
00226 
00227   QTabWidget* m_ControlsTab;
00228   QtProgress* m_ProgressReporter;
00229 
00230 private:
00232   DataGrid::IndexType GridIndex;
00233 
00235   QLabel* GridIndexInfo;
00236 
00238   void UpdateGridInfo();
00239 };
00240 
00242 
00243 } // namespace cmtk
00244 
00245 #endif // #ifndef __cmtkQtTriplanarWindow_h_included_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines