GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGoTabImageView3D.cxx
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 #include "QGoTabImageView3D.h"
36 
37 #include "QGoImageView3D.h"
38 #include "QGoLUTDialog.h"
40 
41 #include "vtkImageData.h"
42 #include "vtkLookupTable.h"
43 #include "vtkContourWidget.h"
44 #include "vtkOrientedGlyphContourRepresentation.h"
45 #include "vtkImageActorPointPlacer.h"
46 #include "vtkProperty.h"
47 // #include "vtkQuadricLODActor.h"
48 #include "vtkActor.h"
49 
50 #include "vtkImageExtractComponents.h"
51 
52 #include <QLabel>
53 #include <QColorDialog>
54 #include <QDockWidget>
55 #include <QSpinBox>
56 #include <QVBoxLayout>
57 
58 //--------------------------------------------------------------------------
64  QGoTabImageViewNDBase(iParent)
65 {
66  setupUi(this);
67 
68  for ( int i = 0; i < 3; i++ )
69  {
70  this->m_ContourRepresentation.push_back(
71  vtkSmartPointer< vtkOrientedGlyphContourRepresentation >::New() );
72  this->m_ContourRepresentation.back()->GetProperty()->SetColor(0., 1., 1.);
73  this->m_ContourRepresentation.back()->GetLinesProperty()->SetColor(1., 0., 1.);
74  this->m_ContourRepresentation.back()->GetActiveProperty()->SetColor(1., 1., 0.);
75 
76  this->m_ContourWidget.push_back(
77  vtkSmartPointer< vtkContourWidget >::New() );
78  this->m_ContourWidget.back()->SetPriority(10.0);
79  this->m_ContourWidget.back()->SetInteractor( m_ImageView->GetInteractor(i) );
80  this->m_ContourWidget.back()->Off();
81  }
82 
84  m_NavigationDockWidget->resize(120, 300);
85 
86  QObject::connect( m_NavigationDockWidget, SIGNAL( XSliceChanged(int) ),
87  this, SLOT( SetSliceViewYZ(int) ) );
88 
89  QObject::connect( this, SIGNAL( SliceViewYZChanged(int) ),
90  m_NavigationDockWidget, SLOT( SetXSlice(int) ) );
91 
92  QObject::connect( m_NavigationDockWidget, SIGNAL( YSliceChanged(int) ),
93  this, SLOT( SetSliceViewXZ(int) ) );
94 
95  QObject::connect( this, SIGNAL( SliceViewXZChanged(int) ),
96  m_NavigationDockWidget, SLOT( SetYSlice(int) ) );
97 
98  QObject::connect( m_NavigationDockWidget, SIGNAL( ZSliceChanged(int) ),
99  this, SLOT( SetSliceViewXY(int) ) );
100 
101  QObject::connect( this, SIGNAL( SliceViewXYChanged(int) ),
102  m_NavigationDockWidget, SLOT( SetZSlice(int) ) );
103 
104  QObject::connect( m_NavigationDockWidget, SIGNAL( ShowAllChannelsChanged(bool) ),
105  this, SLOT( ShowAllChannels(bool) ) );
106 
107  QObject::connect( m_NavigationDockWidget, SIGNAL( ShowOneChannelChanged(int) ),
108  this, SLOT( ShowOneChannel(int) ) );
109 
110  this->m_DockWidgetList.push_front(
111  std::pair< QGoDockWidgetStatus *, QDockWidget * >(
112  new QGoDockWidgetStatus(m_NavigationDockWidget, Qt::LeftDockWidgetArea, true, true),
114 
116 
117  //CreateModeActions();
118 
119  ReadSettings();
120 }
121 
122 //--------------------------------------------------------------------------
123 
124 //--------------------------------------------------------------------------
129 {
130  QActionGroup *group = new QActionGroup(this);
131 
132  QAction *QuadViewAction = new QAction(tr("Quad-View"), this);
133 
134  QuadViewAction->setCheckable(true);
135  QuadViewAction->setChecked(true);
136 
137  QIcon quadviewicon;
138  quadviewicon.addPixmap(QPixmap( QString::fromUtf8(":/fig/4views.png") ),
139  QIcon::Normal, QIcon::Off);
140  QuadViewAction->setIcon(quadviewicon);
141 
142  group->addAction(QuadViewAction);
143 
144  this->m_ViewActions.push_back(QuadViewAction);
145 
146  QObject::connect( QuadViewAction, SIGNAL( triggered() ),
147  this, SLOT( Quadview() ) );
148 
149  QAction *FullScreenXYAction = new QAction(tr("Full-Screen XY"), this);
150  FullScreenXYAction->setCheckable(true);
151 
152  QIcon xyicon;
153  xyicon.addPixmap(QPixmap( QString::fromUtf8(":/fig/xy.png") ),
154  QIcon::Normal, QIcon::Off);
155  FullScreenXYAction->setIcon(xyicon);
156 
157  group->addAction(FullScreenXYAction);
158 
159  this->m_ViewActions.push_back(FullScreenXYAction);
160 
161  QObject::connect( FullScreenXYAction, SIGNAL( triggered() ),
162  this, SLOT( FullScreenViewXY() ) );
163 
164  QAction *FullScreenXZAction = new QAction(tr("Full-Screen XZ"), this);
165  FullScreenXZAction->setCheckable(true);
166 
167  QIcon xzicon;
168  xzicon.addPixmap(QPixmap( QString::fromUtf8(":/fig/zx.png") ),
169  QIcon::Normal, QIcon::Off);
170  FullScreenXZAction->setIcon(xzicon);
171 
172  group->addAction(FullScreenXZAction);
173 
174  this->m_ViewActions.push_back(FullScreenXZAction);
175 
176  QObject::connect( FullScreenXZAction, SIGNAL( triggered() ),
177  this, SLOT( FullScreenViewXZ() ) );
178 
179  QAction *FullScreenYZAction = new QAction(tr("Full-Screen YZ"), this);
180  FullScreenYZAction->setCheckable(true);
181 
182  QIcon yzicon;
183  yzicon.addPixmap(QPixmap( QString::fromUtf8(":/fig/yz.png") ),
184  QIcon::Normal, QIcon::Off);
185  FullScreenYZAction->setIcon(yzicon);
186 
187  group->addAction(FullScreenYZAction);
188 
189  this->m_ViewActions.push_back(FullScreenYZAction);
190 
191  QObject::connect( FullScreenYZAction, SIGNAL( triggered() ),
192  this, SLOT( FullScreenViewYZ() ) );
193 
194  QAction *FullScreenXYZAction = new QAction(tr("Full-Screen XYZ"), this);
195  FullScreenXYZAction->setCheckable(true);
196 
197  QIcon xyzicon;
198  xyzicon.addPixmap(QPixmap( QString::fromUtf8(":/fig/xyz.png") ),
199  QIcon::Normal, QIcon::Off);
200  FullScreenXYZAction->setIcon(xyzicon);
201 
202  group->addAction(FullScreenXYZAction);
203 
204  this->m_ViewActions.push_back(FullScreenXYZAction);
205 
206  QObject::connect( FullScreenXYZAction, SIGNAL( triggered() ),
207  this, SLOT( FullScreenViewXYZ() ) );
208 
209  QAction *separator = new QAction(this);
210  separator->setSeparator(true);
211 
212  this->m_ViewActions.push_back(separator);
213 
214  QAction *LookupTableAction = new QAction(tr("Lookup Table"), this);
215  LookupTableAction->setStatusTip( tr(" Change the associated lookup table") );
216 
217  QIcon luticon;
218  luticon.addPixmap(QPixmap( QString::fromUtf8(":/fig/LookupTable.png") ),
219  QIcon::Normal, QIcon::Off);
220  LookupTableAction->setIcon(luticon);
221 
222  // Here write the connection
223  QObject::connect( LookupTableAction, SIGNAL( triggered() ),
224  this, SLOT( ChangeLookupTable() ) );
225 
226  this->m_ViewActions.push_back(LookupTableAction);
227 
228  QAction *ScalarBarAction = new QAction(tr("Display Scalar Bar"), this);
229  ScalarBarAction->setCheckable(true);
230 
231  QIcon scalarbaricon;
232  scalarbaricon.addPixmap(QPixmap( QString::fromUtf8(":/fig/scalarbar.png") ),
233  QIcon::Normal, QIcon::Off);
234  ScalarBarAction->setIcon(scalarbaricon);
235 
236  this->m_ViewActions.push_back(ScalarBarAction);
237 
238  QObject::connect( ScalarBarAction, SIGNAL( toggled(bool) ),
239  this, SLOT( ShowScalarBar(bool) ) );
240 
241  QPixmap Pix(16, 16);
242  Pix.fill(Qt::black);
243  m_BackgroundColorAction = new QAction(Pix, tr("Set Background Color"), this);
244  this->m_ViewActions.push_back(m_BackgroundColorAction);
245 
246  QObject::connect( m_BackgroundColorAction, SIGNAL( triggered() ),
247  this, SLOT( ChangeBackgroundColor() ) );
248 
249  QAction *separator2 = new QAction(this);
250  separator2->setSeparator(true);
251  this->m_ViewActions.push_back(separator2);
252 
254 
255  QAction *separator3 = new QAction(this);
256  separator3->setSeparator(true);
257  this->m_ViewActions.push_back(separator3);
258 
259  QAction *DisplayAnnotationsAction = new QAction(tr("Display annotations"), this);
260  DisplayAnnotationsAction->setCheckable(true);
261  DisplayAnnotationsAction->setChecked(true);
262  DisplayAnnotationsAction->setStatusTip( tr(" Display or not annotations in each 2d view") );
263 
264  QIcon displayannotationsicon;
265  displayannotationsicon.addPixmap(QPixmap( QString::fromUtf8(":/fig/2D_VIEWS_INFOS.png") ),
266  QIcon::Normal, QIcon::Off);
267  DisplayAnnotationsAction->setIcon(displayannotationsicon);
268 
269  QObject::connect( DisplayAnnotationsAction, SIGNAL( triggered() ),
270  this, SLOT( DisplayAnnotations() ) );
271 
272  this->m_ViewActions.push_back(DisplayAnnotationsAction);
273 
274  QAction *DisplaySplinePlanesAction = new QAction(tr("Display spline planes"), this);
275  DisplaySplinePlanesAction->setCheckable(true);
276  DisplaySplinePlanesAction->setChecked(true);
277  DisplaySplinePlanesAction->setStatusTip( tr(" Display or not spline planes on each view") );
278 
279  QIcon displaysplineplaneicon;
280  displaysplineplaneicon.addPixmap(QPixmap( QString::fromUtf8(":/fig/C_M_L.png") ),
281  QIcon::Normal, QIcon::Off);
282  DisplaySplinePlanesAction->setIcon(displaysplineplaneicon);
283 
284  QObject::connect( DisplaySplinePlanesAction, SIGNAL( triggered() ),
285  this, SLOT( DisplaySplinePlanes() ) );
286 
287  this->m_ViewActions.push_back(DisplaySplinePlanesAction);
288 
289  QAction *DisplayCube3D = new QAction(tr("Display 3D cube"), this);
290  DisplayCube3D->setCheckable(true);
291  DisplayCube3D->setChecked(true);
292  DisplayCube3D->setStatusTip( tr(" Display or not cube in 3d") );
293 
294  QIcon cube3dicon;
295  cube3dicon.addPixmap(QPixmap( QString::fromUtf8(":/fig/cube.png") ),
296  QIcon::Normal, QIcon::Off);
297  DisplayCube3D->setIcon(cube3dicon);
298 
299  QObject::connect( DisplayCube3D, SIGNAL( triggered() ),
300  this, SLOT( DisplayCube() ) );
301 
302  this->m_ViewActions.push_back(DisplayCube3D);
303 
304  QAction *Change3DPerspectiveToAxialAction =
305  new QAction(tr("Change 3D view to Posterior "), this);
306  this->m_ViewActions.push_back(Change3DPerspectiveToAxialAction);
307 
308  QIcon axialicon;
309  axialicon.addPixmap(QPixmap( QString::fromUtf8(":/fig/PosteriorView.png") ),
310  QIcon::Normal, QIcon::Off);
311  Change3DPerspectiveToAxialAction->setIcon(axialicon);
312 
313  QObject::connect( Change3DPerspectiveToAxialAction, SIGNAL( triggered() ),
314  this, SLOT( Change3DPerspectiveToAxial() ) );
315 
316  QAction *Change3DPerspectiveToCoronalAction =
317  new QAction(tr("Change 3D view to Dorsal "), this);
318  this->m_ViewActions.push_back(Change3DPerspectiveToCoronalAction);
319 
320  QIcon coronalicon;
321  coronalicon.addPixmap(QPixmap( QString::fromUtf8(":/fig/DorsalView.png") ),
322  QIcon::Normal, QIcon::Off);
323  Change3DPerspectiveToCoronalAction->setIcon(coronalicon);
324 
325  QObject::connect( Change3DPerspectiveToCoronalAction, SIGNAL( triggered() ),
326  this, SLOT( Change3DPerspectiveToCoronal() ) );
327 
328  QAction *Change3DPerspectiveToSagittalAction =
329  new QAction(tr("Change 3D view to Left "), this);
330  this->m_ViewActions.push_back(Change3DPerspectiveToSagittalAction);
331 
332  QIcon sagittalicon;
333  sagittalicon.addPixmap(QPixmap( QString::fromUtf8(":/fig/LeftView.png") ),
334  QIcon::Normal, QIcon::Off);
335  Change3DPerspectiveToSagittalAction->setIcon(sagittalicon);
336 
337  QObject::connect( Change3DPerspectiveToSagittalAction, SIGNAL( triggered() ),
338  this, SLOT( Change3DPerspectiveToSagittal() ) );
339 }
340 
341 //--------------------------------------------------------------------------
342 //-------------------------------------------------------------------------
344 {
345  //QActionGroup *group = new QActionGroup(this);
346 
347  // Call superclass
348  //QGoTabElementBase::CreateModeActions(group);
349  QGoTabElementBase::CreateModeToolBar(iMenu, iToolBar);
350  this->m_ToolBarList.push_back(this->m_ModeToolBar);
351 }
352 
353 //--------------------------------------------------------------------------
354 
355 //--------------------------------------------------------------------------
357 {
358 }
359 
360 //--------------------------------------------------------------------------
361 
362 //--------------------------------------------------------------------------
368 {
369  if ( iParent->objectName().isEmpty() )
370  {
371  iParent->resize(800, 800);
372  }
373 
374  m_ImageView = new QGoImageView3D(this);
377 
379  this, SIGNAL( SliceViewXYChanged(int) ) );
380 
382  this, SIGNAL( SliceViewXZChanged(int) ) );
383 
385  this, SIGNAL( SliceViewYZChanged(int) ) );
386 
388  this, SIGNAL( FullScreenViewChanged(int) ) );
389 
390  retranslateUi(iParent);
391 
393 } // setupUi
394 
395 //--------------------------------------------------------------------------
396 
397 //--------------------------------------------------------------------------
403 {
404  iParent->setWindowTitle( tr("QGoTabImageView3D") );
405  Q_UNUSED(iParent);
406 }
407 
408 //--------------------------------------------------------------------------
409 
410 //--------------------------------------------------------------------------
416 {
417  return GoFigure::THREE_D;
418 }
419 
420 //--------------------------------------------------------------------------
421 
422 //--------------------------------------------------------------------------
427 {
428  m_ImageView->Update();
429  int extent[6];
430  m_Image->GetExtent(extent);
431 
432  m_NavigationDockWidget->SetXSlice( ( extent[0] + extent[1] ) / 2 );
433  m_NavigationDockWidget->SetYSlice( ( extent[2] + extent[3] ) / 2 );
434  m_NavigationDockWidget->SetZSlice( ( extent[4] + extent[5] ) / 2 );
435 }
436 
437 //--------------------------------------------------------------------------
438 
439 //--------------------------------------------------------------------------
444 {
445  vtkLookupTable *lut = vtkLookupTable::New();
446 
447  lut->DeepCopy( QGoLUTDialog::GetLookupTable( this,
448  tr("Choose one look-up table") ) );
450  lut->Delete();
451 }
452 
453 //--------------------------------------------------------------------------
454 
455 //--------------------------------------------------------------------------
460 void QGoTabImageView3D::ShowScalarBar(const bool & iShow)
461 {
462  m_ImageView->ShowScalarBar(iShow);
463 }
464 
465 //--------------------------------------------------------------------------
466 
467 //--------------------------------------------------------------------------
475  const GoFigure::FileType & iType,
476  const QString & iBaseName)
477 {
478  return m_ImageView->SnapshotViewXY(iType, iBaseName);
479 }
480 
481 //--------------------------------------------------------------------------
482 
483 //--------------------------------------------------------------------------
491  const GoFigure::FileType & iType,
492  const QString & iBaseName)
493 {
494  return m_ImageView->SnapshotViewXZ(iType, iBaseName);
495 }
496 
497 //--------------------------------------------------------------------------
498 
499 //--------------------------------------------------------------------------
507  const GoFigure::FileType & iType,
508  const QString & iBaseName)
509 {
510  return m_ImageView->SnapshotViewYZ(iType, iBaseName);
511 }
512 
513 //--------------------------------------------------------------------------
514 
515 //--------------------------------------------------------------------------
523  const GoFigure::FileType & iType,
524  const QString & iBaseName)
525 {
526  return m_ImageView->SnapshotViewXYZ(iType, iBaseName);
527 }
528 
529 //--------------------------------------------------------------------------
530 
531 //--------------------------------------------------------------------------
537 {
539 }
540 
541 //--------------------------------------------------------------------------
542 
543 //--------------------------------------------------------------------------
549 {
551 }
552 
553 //--------------------------------------------------------------------------
554 
555 //--------------------------------------------------------------------------
561 {
563 }
564 
565 //--------------------------------------------------------------------------
566 
567 //--------------------------------------------------------------------------
573 {
575 }
576 
577 //--------------------------------------------------------------------------
578 
579 //--------------------------------------------------------------------------
584 {
587 }
588 
589 //--------------------------------------------------------------------------
590 
591 //--------------------------------------------------------------------------
596 {
599 }
600 
601 //--------------------------------------------------------------------------
602 
603 //--------------------------------------------------------------------------
608 {
611 }
612 
613 //--------------------------------------------------------------------------
614 
615 //--------------------------------------------------------------------------
620 {
623 }
624 
625 //--------------------------------------------------------------------------
626 
627 //--------------------------------------------------------------------------
632 {
635 }
636 
637 //--------------------------------------------------------------------------
638 
639 //--------------------------------------------------------------------------
644 {
645  double r(0.), g(0.), b(0.);
646 
648  this->m_BackgroundColor.setRgbF(r, g, b);
649 }
650 
651 //--------------------------------------------------------------------------
652 
653 //--------------------------------------------------------------------------
658 {
660 }
661 
662 //--------------------------------------------------------------------------
663 
664 //--------------------------------------------------------------------------
670 {
671  m_ImageView->SetImage(image);
672  // create LUT for the image
673  vtkSmartPointer<vtkLookupTable> bwLut =
674  vtkSmartPointer<vtkLookupTable>::New();
675  double* range = image->GetScalarRange();
676  bwLut->SetTableRange (0, range[1]);
677  bwLut->SetValueRange (0, 1);
678  bwLut->SetSaturationRange(0.0, 0.0);
679  bwLut->Build();
680  m_ImageView->SetLookupTable(bwLut);
681  m_ImageView->Update();
682 
683  for ( unsigned int i = 0; i < this->m_ContourWidget.size(); i++ )
684  {
685  vtkImageActorPointPlacer *point_placer = vtkImageActorPointPlacer::New();
686  point_placer->SetImageActor( m_ImageView->GetImageActor(i) );
687 
688  this->m_ContourRepresentation[i]->SetPointPlacer(point_placer);
689  point_placer->Delete();
690 
691  this->m_ContourWidget[i]->SetRepresentation(this->m_ContourRepresentation[i]);
692  }
693 }
694 
695 //--------------------------------------------------------------------------
696 
697 //--------------------------------------------------------------------------
699 {
701 }
702 
703 //--------------------------------------------------------------------------
704 
705 //--------------------------------------------------------------------------
706 // std::vector< vtkQuadricLODActor* >
707 std::vector< vtkActor * >
708 QGoTabImageView3D::AddContour(vtkPolyData *dataset,
709  vtkProperty *iProperty)
710 {
711  return this->m_ImageView->AddContour(dataset, iProperty);
712 }
713 
714 //--------------------------------------------------------------------------
715 
716 //--------------------------------------------------------------------------
717 void
718 QGoTabImageView3D::RemoveActorFromViewer(const int & iId, vtkActor *iActor)
719 {
720  m_ImageView->RemoveActor(iId, iActor);
721 }
722 
723 //--------------------------------------------------------------------------
724 
725 //--------------------------------------------------------------------------
726 void QGoTabImageView3D::DisplayActorInViewer(const int & iId, vtkActor *iActor)
727 {
728  m_ImageView->AddActor(iId, iActor);
729 }
730 
731 //--------------------------------------------------------------------------
732 
733 //--------------------------------------------------------------------------
734 void
735 QGoTabImageView3D::SetSlice(int iDir, int *iIdx)
736 {
737  switch ( iDir )
738  {
739  default:
740  case 0:
741  {
742  this->SetSliceViewXY(iIdx[2]);
743  break;
744  }
745  case 1:
746  {
747  this->SetSliceViewXZ(iIdx[1]);
748  break;
749  }
750  case 2:
751  {
752  this->SetSliceViewXY(iIdx[0]);
753  break;
754  }
755  }
756 }
757 
758 //--------------------------------------------------------------------------
759 
760 void
762 {
763  double r(0.), g(0.), b(0.);
764 
766  m_BackgroundColor.setRgbF(r, g, b);
767 
769  this, tr("Choose Background Color") );
770 
771  if ( temp != m_BackgroundColor )
772  {
773  m_BackgroundColor = temp;
775  QPixmap Pix(16, 16);
776  Pix.fill(temp);
778  }
779 }
780 
781 //-------------------------------------------------------------------------
782 void
784 {
785  this->m_ImageView->ShowAnnotations();
786 }
787 
788 //-------------------------------------------------------------------------
789 
790 //-------------------------------------------------------------------------
791 void
793 {
794  this->m_ImageView->ShowSplinePlane();
795 }
796 
797 //-------------------------------------------------------------------------
798 
799 //-------------------------------------------------------------------------
800 void
802 {
803  this->m_ImageView->ShowCube3D();
804 }
805 
806 //-------------------------------------------------------------------------
807 
808 //-------------------------------------------------------------------------
809 void
811 {
812  this->m_ImageView->SetCamera(1);
813 }
814 
815 //-------------------------------------------------------------------------
816 
817 //-------------------------------------------------------------------------
818 void
820 {
821  this->m_ImageView->SetCamera(2);
822 }
823 
824 //-------------------------------------------------------------------------
825 
826 //-------------------------------------------------------------------------
827 void
829 {
830  this->m_ImageView->SetCamera(3);
831 }
832 
833 //-------------------------------------------------------------------------
834 void
836 {
837  (void)iEnable;
838  this->m_ImageView->DefaultMode();
839 }
840 
841 //-------------------------------------------------------------------------
842 
843 //-------------------------------------------------------------------------
844 void
846 {
847  (void)iEnable;
848  this->m_ImageView->ZoomMode();
849 }
850 
851 //-------------------------------------------------------------------------
852 
853 //-------------------------------------------------------------------------
854 void
856 {
857  (void)iEnable;
858  this->m_ImageView->PanMode();
859 }
860 
861 //------------------------------------------------------------------------------
862 
863 //------------------------------------------------------------------------------
864 void
866 {
867  // Get the current view displayed in full screen
868  int FullScreenView = m_ImageView->GetFullScreenView();
869 
871 
872  switch ( FullScreenView )
873  {
874  case 1:
875  filename.append("snapshot-xy-");
877  break;
878 
879  case 2:
880  filename.append("snapshot-xz-");
882  break;
883 
884  case 3:
885  filename.append("snapshot-yz-");
887  break;
888 
889  default:
890  filename.append("snapshot-xyz-");
892  break;
893  }
894 }
895 
896 //-------------------------------------------------------------------------
QAction * toggleViewAction()
virtual void ShowScalarBar(const bool &)
QString toNativeSeparators(const QString &pathName)
QString & append(QChar ch)
GoFigure::TabDimensionType GetTabDimensionType() const
void setSeparator(bool b)
void setRgbF(qreal r, qreal g, qreal b, qreal a)
virtual void SetSlice(int iDir, int *iIdx)
virtual void PanInteractorBehavior(bool)
Mouse interaction style allows user to pan volume with all buttons.
void fill(const QColor &color)
std::vector< vtkSmartPointer< vtkContourWidget > > m_ContourWidget
std::list< QGoDockWidgetStatusPair > m_DockWidgetList
void GetBackgroundColor(double &r, double &g, double &b)
Returns used background color by viewers.
void setChecked(bool)
virtual void RemoveActorFromViewer(const int &iId, vtkActor *iActor)
void SetImageToImageViewer(vtkImageData *image)
QAction * m_BackgroundColorAction
void setIcon(const QIcon &icon)
QString SnapshotViewYZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-yz-"))
vtkSmartPointer< vtkImageData > m_Image
void SetFullScreenView(const int &iS)
QAction * addAction(QAction *action)
QString SnapshotViewXYZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xyz-"))
void ShowOneChannel(int iChannel)
std::vector< vtkActor * > AddContour(vtkPolyData *iDataset, vtkProperty *iProperty=NULL)
Add contour with given property into the visualization.
QString homePath()
void GetBackgroundColorFromImageViewer()
QString tr(const char *sourceText, const char *disambiguation, int n)
void DefaultMode()
Use the default interactor style.
void SetSliceViewXY(const int &)
void resize(int w, int h)
void SetSliceViewXZ(const int &)
QString fromUtf8(const char *str, int size)
class for the visualization of 3D Image represented by one vtkImageData*.
int GetFullScreenView() const
virtual void RemoveActor(const int &iId, vtkActor *iActor)
virtual void CreateModeToolBar(QMenu *iMenu, QToolBar *iToolBar)
QString SnapshotViewXYZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xyz-"))
QVTKInteractor * GetInteractor(const int &)
Returns the interactor for one given view.
vtkLookupTable * GetLookupTable()
get the selected look up table
void ShowScalarBar(const bool &)
void addPixmap(const QPixmap &pixmap, Mode mode, State state)
void setCentralWidget(QWidget *widget)
void SetSliceViewXZ(const int &)
QString SnapshotViewXZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xz-"))
QGoImageView3D * m_ImageView
Dock Widget for browsing images (changing slice, time point...)
int * GetImageCoordinatesFromWorldCoordinates(double pos[3])
void SetSliceViewYZ(const int &)
QString SnapshotViewYZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-yz"))
void SliceViewYZChanged(int Slice)
void FullScreenViewChanged(int View)
QColor getColor(const QColor &initial, QWidget *parent, const QString &title, QFlags< QColorDialog::ColorDialogOption > options)
virtual void AddActor(const int &iId, vtkActor *iActor)
std::list< QGoToolBarStatus * > m_ToolBarList
void CreateModeToolBar(QMenu *iMenu, QToolBar *iToolBar)
void setCheckable(bool)
QString SnapshotViewXY(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xy-"))
virtual void SetImage(vtkImageData *iImage)
Set the image to displaid.
virtual void ReadSettings()
Read Settings.
void SetFullScreenView(const int &iS)
Abstract class for representing one tab element which contains 2D or 3D image (without any temporal c...
void SetBackgroundColorToImageViewer()
void SliceViewXYChanged(int Slice)
virtual void SetLookupTable(vtkLookupTable *)
void setStatusTip(const QString &statusTip)
int * GetImageCoordinatesFromWorldCoordinates(double pos[3])
Get Image Coordinates from World Coordinates.
void PanMode()
Use the pan interactor style.
virtual void DefaultInteractorBehavior(bool)
Mouse interaction style set as default.
void SetSliceViewYZ(const int &)
QGoNavigationDockWidget * m_NavigationDockWidget
void retranslateUi(QWidget *parent)
QString SnapshotViewXZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xz-"))
void setWindowTitle(const QString &)
std::vector< QAction * > m_ViewActions
QString SnapshotViewXY(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xy-"))
void setupUi(QWidget *parent)
std::vector< vtkSmartPointer< vtkOrientedGlyphContourRepresentation > > m_ContourRepresentation
virtual void Update()
Update the rendering of the tab.
void SliceViewXZChanged(int Slice)
vtkImageActor * GetImageActor(const int &iId)
Get the image actor.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void ZoomMode()
Use the zoom interactor style.
void SetBackgroundColor(const double &r, const double &g, const double &b)
Set background color for all views.
void ShowAllChannels(bool iChecked)
void SetSliceViewXY(const int &)
void setEnabled(bool)
void connectSlotsByName(QObject *object)
virtual std::vector< vtkActor * > AddContour(vtkPolyData *dataset, vtkProperty *property=NULL)
virtual void ZoomInteractorBehavior(bool)
Mouse interaction style allows user to zoom in/out volume with all buttons.
QGoToolBarStatus * m_ModeToolBar
void ShowAnnotations()
Show annotations in the collection.
virtual void DisplayActorInViewer(const int &iId, vtkActor *iActor)
QGoTabImageView3D(QWidget *parent=0)
Constructor.