GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGoImageView3D.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 "QGoImageView3D.h"
36 #include "QDebug"
37 
38 #include "vtkImageData.h"
39 #include "vtkViewImage2D.h"
40 #include "vtkViewImage3D.h"
43 #include "vtkRenderWindowInteractor.h"
44 #include "vtkRenderWindow.h"
45 #include "vtkRendererCollection.h"
46 #include "vtkRenderer.h"
48 #include "vtkTextProperty.h"
49 #include "vtkProperty.h"
50 #include "vtkImageClip.h"
51 #include "vtkImagePermute.h"
52 #include "vtkImageResample.h"
53 #include "vtkWindowToImageFilter.h"
54 #include "vtkBMPWriter.h"
55 #include "vtkPostScriptWriter.h"
56 #include "vtkJPEGWriter.h"
57 #include "vtkPNGWriter.h"
58 #include "vtkTIFFWriter.h"
59 #include "vtkCamera.h"
60 
61 #include "vtkEventQtSlotConnect.h"
62 #include "QSplitterChild.h"
63 #include "QVTKWidget.h"
64 
65 #include <QResizeEvent>
66 #include <QSettings>
67 
68 #include "vtkViewImage2DCommand.h"
70 #include "vtkViewImage3DCommand.h"
71 #include "vtkImageActorPointPlacer.h"
72 
73 #include "vtkCellArray.h"
74 #include "vtkMath.h"
75 #include "vtkPolyData.h"
76 
77 #include "vtkImplicitPlaneWidget.h"
78 #include "vtkPlane.h"
79 
80 #include "vtkLookupTable.h"
81 
82 #include "vtkPiecewiseFunction.h"
83 
84 #include <cstdlib>
85 
86 //-------------------------------------------------------------------------
88  QGoImageView(iParent),
89  IsFullScreen(0),
90  m_FirstRender(true),
91  m_Initialized(false),
92  m_ShowCube(true),
93  m_BoxWidget(0),
94  m_PlaneWidget(0)
95 {
96  VtkEventQtConnector = vtkEventQtSlotConnect::New();
97 
98  m_HighlightedContourProperty = vtkProperty::New();
99  m_HighlightedContourProperty->SetColor(1., 0., 0.);
100  m_HighlightedContourProperty->SetLineWidth(3.);
101 
102  setupUi(this);
103 
104  QObject::connect( this->SliderXY, SIGNAL( valueChanged(int) ),
105  this, SLOT( SetSliceViewXY(int) ) );
106  QObject::connect( this->SliderXZ, SIGNAL( valueChanged(int) ),
107  this, SLOT( SetSliceViewXZ(int) ) );
108  QObject::connect( this->SliderYZ, SIGNAL( valueChanged(int) ),
109  this, SLOT( SetSliceViewYZ(int) ) );
110 
111  QObject::connect( this->HtSplitter, SIGNAL( splitterMoved(int, int) ),
112  this->HbSplitter, SLOT( moveSplitter(int, int) ) );
113  QObject::connect( this->HbSplitter, SIGNAL( splitterMoved(int, int) ),
114  this->HtSplitter, SLOT( moveSplitter(int, int) ) );
115 
118 
119  this->m_Pool->AddItem(View1);
120  View1->Delete();
121 
124 
125  this->m_Pool->AddItem(View2);
126  View2->Delete();
127 
130 
131  this->m_Pool->AddItem(View3);
132  View3->Delete();
133 
134  vtkRenderWindow *renwin4 = this->QvtkWidget_XYZ->GetRenderWindow();
135  this->m_View3D = vtkViewImage3D::New();
136  this->m_View3D->SetRenderWindow(renwin4);
137  this->m_View3D->SetupInteractor( this->QvtkWidget_XYZ->GetInteractor() );
138 
139  this->m_Pool->SetExtraRenderWindow(renwin4);
140 
141  // Initialize widget which doesn't require information about the input image
146 }
147 
148 //--------------------------------------------------------------------------
149 
150 //-------------------------------------------------------------------------
153 {
154  delete HtSplitter;
155  delete HbSplitter;
156 
157  // note m_Pool is supposed to be deleted in QGoImageView, but due to a bug
158  // it has to be deleted in this order...
159  if ( m_Pool )
160  {
161  m_Pool->Delete();
162  m_Pool = NULL;
163  }
164  m_View3D->Delete();
165  m_View3D = NULL;
166 
167  VtkEventQtConnector->Delete();
169 
170  if ( m_BoxWidget )
171  {
172  m_BoxWidget->Delete();
173  m_BoxWidget = NULL;
174  }
175 
176  if ( m_PlaneWidget )
177  {
178  m_PlaneWidget->Delete();
179  m_PlaneWidget = NULL;
180  }
181 }
182 
183 //--------------------------------------------------------------------------
184 
185 //-------------------------------------------------------------------------
186 void
188 {
189  if ( iParent->objectName().isEmpty() )
190  {
191  iParent->resize(800, 800);
192  }
193 
194  QList< int > list_size;
195  list_size.push_back(400);
196  list_size.push_back(400);
197 
198  this->VSplitter = new QSplitter(Qt::Vertical, iParent);
199 
200  this->HtSplitter = new QSplitterChild(this->VSplitter);
201  this->HbSplitter = new QSplitterChild(this->VSplitter);
202 
203  this->VSplitter->addWidget(this->HtSplitter);
204  this->VSplitter->addWidget(this->HbSplitter);
205  this->VSplitter->setSizes(list_size);
206  this->VSplitter->resize(800, 800);
207 
208  this->QvtkWidget_XY = new QVTKWidget;
209  this->SliderXY = new QSlider(Qt::Vertical);
210  this->LayOut1 = new QHBoxLayout;
211  this->LayOut1->addWidget(this->QvtkWidget_XY);
212  this->LayOut1->addWidget(this->SliderXY);
213  this->LayOutWidget1 = new QWidget;
214  this->LayOutWidget1->setLayout(this->LayOut1);
215  this->HtSplitter->addWidget(this->LayOutWidget1);
216 
217  this->QvtkWidget_XZ = new QVTKWidget;
218  this->SliderXZ = new QSlider(Qt::Vertical);
219  this->LayOut2 = new QHBoxLayout;
220  this->LayOut2->addWidget(this->QvtkWidget_XZ);
221  this->LayOut2->addWidget(this->SliderXZ);
222  this->LayOutWidget2 = new QWidget;
223  this->LayOutWidget2->setLayout(this->LayOut2);
224  this->HbSplitter->addWidget(this->LayOutWidget2);
225 
226  this->QvtkWidget_YZ = new QVTKWidget;
227  this->SliderYZ = new QSlider(Qt::Vertical);
228  this->LayOut3 = new QHBoxLayout;
229  this->LayOut3->addWidget(this->QvtkWidget_YZ);
230  this->LayOut3->addWidget(this->SliderYZ);
231  this->LayOutWidget3 = new QWidget;
232  this->LayOutWidget3->setLayout(this->LayOut3);
233  this->HtSplitter->addWidget(this->LayOutWidget3);
234 
235  this->QvtkWidget_XYZ = new QVTKWidget;
236  this->LayOut4 = new QHBoxLayout;
237  this->LayOut4->addWidget(this->QvtkWidget_XYZ);
238  this->LayOut4->addSpacing(27);
239  this->LayOutWidget4 = new QWidget;
240  this->LayOutWidget4->setLayout(this->LayOut4);
241  this->HbSplitter->addWidget(this->LayOutWidget4);
242 
243  this->HtSplitter->setSizes(list_size);
244  this->HtSplitter->resize(800, 400);
245 
246  this->HbSplitter->setSizes(list_size);
247  this->HbSplitter->resize(800, 400);
248 
249  retranslateUi(iParent);
250 
252 } // setupUi
253 
254 //-------------------------------------------------------------------------
255 
256 //-------------------------------------------------------------------------
257 void
259 {
260  iParent->setWindowTitle( tr("QGoImageView3D") );
261  Q_UNUSED(iParent);
262 }
263 
264 //-------------------------------------------------------------------------
265 
266 //-------------------------------------------------------------------------
267 void
269 {
270  int extent[6];
271 
272  this->m_Image->GetExtent(extent);
273 
274  vtkViewImage2D *View1 = this->m_Pool->GetItem(0);
275  View1->SetInput(this->m_Image);
276  View1->SetIntersectionLineWidth(this->m_IntersectionLineWidth);
277 
278  this->m_View3D->Add2DPhantom( 0,
279  View1->GetImageActor(),
280  View1->GetSlicePlane() );
281 
282  this->SliderXY->setMinimum(extent[4]);
283  this->SliderXY->setMaximum(extent[5]);
284 
285  vtkViewImage2D *View2 = this->m_Pool->GetItem(1);
286  View2->SetInput(this->m_Image);
287  View2->SetIntersectionLineWidth(this->m_IntersectionLineWidth);
288 
289  this->m_View3D->Add2DPhantom( 1,
290  View2->GetImageActor(),
291  View2->GetSlicePlane() );
292 
293  this->SliderXZ->setMinimum(extent[2]);
294  this->SliderXZ->setMaximum(extent[3]);
295 
296  vtkViewImage2D *View3 = this->m_Pool->GetItem(2);
297  View3->SetInput(this->m_Image);
298  View3->SetIntersectionLineWidth(this->m_IntersectionLineWidth);
299 
300  this->m_View3D->Add2DPhantom( 2,
301  View3->GetImageActor(),
302  View3->GetSlicePlane() );
303 
304  this->SliderYZ->setMinimum(extent[0]);
305  this->SliderYZ->setMaximum(extent[1]);
306 
307  this->m_View3D->SetInput(this->m_Image);
308  this->m_View3D->SetIntersectionLineWidth(this->m_IntersectionLineWidth);
309 
310  if ( m_FirstRender )
311  {
313  }
314  else
315  {
316  this->m_Pool->SyncRender();
317  }
318 
320 }
321 
322 //-------------------------------------------------------------------------
323 
324 //-------------------------------------------------------------------------
325 void
327 {
328  vtkViewImage2D *View1 = this->m_Pool->GetItem(0);
329 
332 
333  vtkViewImage2D *View2 = this->m_Pool->GetItem(1);
336 
337  vtkViewImage2D *View3 = this->m_Pool->GetItem(2);
340 
343  this->m_View3D->SetShowScalarBar(false);
344 
345  this->SliderXY->setValue( ( this->SliderXY->minimum() + this->SliderXY->maximum() ) / 2 );
346  this->SliderXZ->setValue( ( this->SliderXZ->minimum() + this->SliderXZ->maximum() ) / 2 );
347  this->SliderYZ->setValue( ( this->SliderYZ->minimum() + this->SliderYZ->maximum() ) / 2 );
348 
349  this->m_Pool->SyncSetBackground( this->m_Pool->GetItem(0)->GetBackground() );
350  this->m_Pool->SyncSetShowAnnotations(m_ShowAnnotations);
354 
355  // should not be there
356  // setCollectionFontToArial
357  for ( int i = 0; i < 3; i++ )
358  {
359  this->m_Pool->GetItem(i)->GetTextProperty()->SetFontFamilyToArial();
360  this->m_Pool->GetItem(i)->GetTextProperty()->SetFontSize(14);
361  }
362 
363  this->m_Pool->SyncReset();
365  this->m_Pool->Initialize();
366 
367  // share bounds between all interactors styles, to prevent picking planes,
368  // wire mode on planes, surface mode on planes
370  static_cast< vtkInteractorStyleImage2D * >(
371  this->m_Pool->GetItem(0)->GetInteractorStyle());
374  static_cast< vtkInteractorStyleImage2D * >(
375  this->m_Pool->GetItem(1)->GetInteractorStyle());
378  static_cast< vtkInteractorStyleImage2D * >(
379  this->m_Pool->GetItem(2)->GetInteractorStyle());
383 
384  // Rotate the camera to show that the view is 3d
385  vtkCamera *camera = this->m_View3D->GetRenderer()->GetActiveCamera();
386  camera->Roll(-135);
387  camera->Azimuth(-45);
388 
389  this->m_View3D->GetRenderer()->SetActiveCamera(camera);
390  this->m_View3D->ResetCamera();
391 
393 
394  // Initialize widgets which requiere information about the input image
397 
398  m_FirstRender = false;
399 }
400 
401 //-------------------------------------------------------------------------
402 
403 //-------------------------------------------------------------------------
404 void
406 {
407  vtkViewImage2D *View1 = this->m_Pool->GetItem(0);
408  vtkViewImage2D *View2 = this->m_Pool->GetItem(1);
409  vtkViewImage2D *View3 = this->m_Pool->GetItem(2);
410  vtkViewImage3D *View3D = this->m_View3D;
411 
412  // Event connection between vtk and qt
413  // when RequestedPositionEvent occurs in the XY View (double-click),
414  // SliderXZ and SliderYZ move.
415  VtkEventQtConnector->Connect(
416  reinterpret_cast< vtkObject * >( View1->GetInteractorStyle() ),
418  this, SLOT( MoveSliderXZ() ) );
419 
420  VtkEventQtConnector->Connect(
421  reinterpret_cast< vtkObject * >( View1->GetInteractorStyle() ),
423  this, SLOT( MoveSliderYZ() ) );
424 
425  // Event connection between vtk and qt
426  // when RequestedPositionEvent occurs in the XY View (double-click),
427  // SliderXZ and SliderYZ move.
428  VtkEventQtConnector->Connect(
429  reinterpret_cast< vtkObject * >( View2->GetInteractorStyle() ),
431  this, SLOT( MoveSliderXY() ) );
432 
433  VtkEventQtConnector->Connect(
434  reinterpret_cast< vtkObject * >( View2->GetInteractorStyle() ),
436  this, SLOT( MoveSliderYZ() ) );
437 
438  // Event connection between vtk and qt
439  // when SliceMoveEvent occurs in the XY View, SliderXY moves.
440  VtkEventQtConnector->Connect(
441  reinterpret_cast< vtkObject * >( View3->GetInteractorStyle() ),
443  this, SLOT( MoveSliderYZ() ) );
444 
445  // Event connection between vtk and qt
446  // when RequestedPositionEvent occurs in the XY View (double-click),
447  // SliderXZ and SliderYZ move.
448  VtkEventQtConnector->Connect(
449  reinterpret_cast< vtkObject * >( View3->GetInteractorStyle() ),
451  this, SLOT( MoveSliderXY() ) );
452 
453  VtkEventQtConnector->Connect(
454  reinterpret_cast< vtkObject * >( View3->GetInteractorStyle() ),
456  this, SLOT( MoveSliderXZ() ) );
457 
458  // Event connection between vtk and qt
459  // when SliceMoveEvent occurs in the XY View, SliderXY moves.
460  VtkEventQtConnector->Connect(
461  reinterpret_cast< vtkObject * >( View2->GetInteractorStyle() ),
463  this, SLOT( MoveSliderXZ() ) );
464 
465  // Event connection between vtk and qt
466  // when SliceMoveEvent occurs in the XY View, SliderXY moves.
467  VtkEventQtConnector->Connect(
468  reinterpret_cast< vtkObject * >( View1->GetInteractorStyle() ),
470  this, SLOT( MoveSliderXY() ) );
471 
473 
474  // Event connection between vtk and qt
475  // when contours picked, send a signal
476  VtkEventQtConnector->Connect(
477  reinterpret_cast< vtkObject * >( View1->GetInteractorStyle() ),
479  this, SLOT( UpdateCurrentActorSelection(vtkObject *) ) );
480 
481  VtkEventQtConnector->Connect(
482  reinterpret_cast< vtkObject * >( View2->GetInteractorStyle() ),
484  this, SLOT( UpdateCurrentActorSelection(vtkObject *) ) );
485 
486  VtkEventQtConnector->Connect(
487  reinterpret_cast< vtkObject * >( View3->GetInteractorStyle() ),
489  this, SLOT( UpdateCurrentActorSelection(vtkObject *) ) );
490 
491  // Event connection between vtk and qt
492  // when contours picked, send a signal
493  VtkEventQtConnector->Connect(
494  reinterpret_cast< vtkObject * >( View3D->GetInteractorStyle3D() ),
496  this, SLOT( UpdateCurrentActorSelection(vtkObject *) ) );
497 
499 
500  // Event connection between vtk and qt
501  // when contours picked, send a signal
502  VtkEventQtConnector->Connect(
503  reinterpret_cast< vtkObject * >( View1->GetInteractorStyle() ),
504  vtkCommand::WindowLevelEvent,
505  this, SLOT( UpdateLUT() ) );
506 
507  VtkEventQtConnector->Connect(
508  reinterpret_cast< vtkObject * >( View2->GetInteractorStyle() ),
509  vtkCommand::WindowLevelEvent,
510  this, SLOT( UpdateLUT() ) );
511 
512  VtkEventQtConnector->Connect(
513  reinterpret_cast< vtkObject * >( View3->GetInteractorStyle() ),
514  vtkCommand::WindowLevelEvent,
515  this, SLOT( UpdateLUT() ) );
516 
518 
519  // Event connection between vtk and qt
520  // when contours picked, send a signal
521  VtkEventQtConnector->Connect(
522  reinterpret_cast< vtkObject * >( View3D ),
524  this, SLOT( UpdateCurrentActorVisibility(vtkObject *) ) );
525 
526  // Event connection between vtk and qt
527  // when contours picked, send a signal
528  VtkEventQtConnector->Connect(
529  reinterpret_cast< vtkObject * >( View3D ),
531  this, SLOT( UpdateRenderWindows() ) );
532 
534 }
535 
536 //--------------------------------------------------------------------------
537 
538 //-------------------------------------------------------------------------
539 void
540 QGoImageView3D::SetImage(vtkImageData *input)
541 {
542  if ( !input )
543  {
544  vtkSmartPointer<vtkImageData> test = vtkSmartPointer<vtkImageData>::New();
545  this->m_Image->ShallowCopy(test);
546  }
547  else
548  {
549  int dim[3];
550  input->GetDimensions(dim);
551 
552  assert ( dim[0] + dim[1] + dim[2] > 0 );
553 
554  m_Initialized = true;
555  this->m_Image->ShallowCopy(input);
556  }
557 }
558 
559 //--------------------------------------------------------------------------
560 
561 //-------------------------------------------------------------------------
562 QVTKInteractor *
564 {
565  if ( ( iId < 0 ) || ( iId > 3 ) )
566  {
567  return NULL;
568  }
569  else
570  {
571  switch ( iId )
572  {
573  default:
574  case 0:
575  {
576  return this->QvtkWidget_XY->GetInteractor();
577  }
578  case 1:
579  {
580  return this->QvtkWidget_XZ->GetInteractor();
581  }
582  case 2:
583  {
584  return this->QvtkWidget_YZ->GetInteractor();
585  }
586  case 3:
587  {
588  return this->QvtkWidget_XYZ->GetInteractor();
589  }
590  }
591  }
592 }
593 
594 //--------------------------------------------------------------------------
595 
596 //-------------------------------------------------------------------------
597 QString
599  const QString & iBaseName)
600 {
601  QString filename = SnapshotView(QvtkWidget_XY, iType,
602  iBaseName, m_SnapshotId);
603 
604  m_SnapshotId++;
605  return filename;
606 }
607 
608 //--------------------------------------------------------------------------
609 
610 //-------------------------------------------------------------------------
611 QString
613  const QString & iBaseName)
614 {
615  QString filename = SnapshotView(QvtkWidget_XZ, iType,
616  iBaseName, m_SnapshotId);
617 
618  m_SnapshotId++;
619  return filename;
620 }
621 
622 //--------------------------------------------------------------------------
623 
624 //-------------------------------------------------------------------------
625 QString
627  const GoFigure::FileType & iType,
628  const QString & iBaseName)
629 {
630  QString filename = SnapshotView(QvtkWidget_YZ, iType,
631  iBaseName, m_SnapshotId);
632 
633  m_SnapshotId++;
634  return filename;
635 }
636 
637 //--------------------------------------------------------------------------
638 
639 //-------------------------------------------------------------------------
640 QString
642  const GoFigure::FileType & iType,
643  const QString & iBaseName)
644 {
645  QString filename = SnapshotView(QvtkWidget_XYZ, iType,
646  iBaseName, m_SnapshotId);
647 
648  m_SnapshotId++;
649  return filename;
650 }
651 
652 //--------------------------------------------------------------------------
653 
654 //-------------------------------------------------------------------------
655 void
657 {
658  if ( IsFullScreen != iS )
659  {
660  IsFullScreen = iS;
661 
662  switch ( IsFullScreen )
663  {
664  default:
665  case 0:
666  {
667  Quadview();
668  break;
669  }
670  case 1:
671  {
673  break;
674  }
675  case 2:
676  {
678  break;
679  }
680  case 3:
681  {
683  break;
684  }
685  case 4:
686  {
688  break;
689  }
690  }
692  }
693 }
694 
695 //--------------------------------------------------------------------------
696 
697 //-------------------------------------------------------------------------
698 void
700 {
701  IsFullScreen = 0;
702  LayOutWidget1->show();
703  LayOutWidget2->show();
704  LayOutWidget3->show();
705  LayOutWidget4->show();
706 }
707 
708 //--------------------------------------------------------------------------
709 
710 //-------------------------------------------------------------------------
711 void
713 {
714  IsFullScreen = 1;
715  LayOutWidget1->show();
716  LayOutWidget2->hide();
717  LayOutWidget3->hide();
718  LayOutWidget4->hide();
719 }
720 
721 //--------------------------------------------------------------------------
722 
723 //-------------------------------------------------------------------------
724 void
726 {
727  IsFullScreen = 2;
728  LayOutWidget1->hide();
729  LayOutWidget2->show();
730  LayOutWidget3->hide();
731  LayOutWidget4->hide();
732 }
733 
734 //--------------------------------------------------------------------------
735 
736 //-------------------------------------------------------------------------
737 void
739 {
740  IsFullScreen = 3;
741  LayOutWidget1->hide();
742  LayOutWidget2->hide();
743  LayOutWidget3->show();
744  LayOutWidget4->hide();
745 }
746 
747 //--------------------------------------------------------------------------
748 
749 //-------------------------------------------------------------------------
750 void
752 {
753  IsFullScreen = 4;
754  LayOutWidget1->hide();
755  LayOutWidget2->hide();
756  LayOutWidget3->hide();
757  LayOutWidget4->show();
758 }
759 
760 //--------------------------------------------------------------------------
761 
762 //-------------------------------------------------------------------------
763 int
765 {
766  return IsFullScreen;
767 }
768 
769 //--------------------------------------------------------------------------
770 
771 //-------------------------------------------------------------------------
772 void
774 {
775  QWidget::resizeEvent(iEvent);
776  VSplitter->resize( iEvent->size() );
777 }
778 
779 //--------------------------------------------------------------------------
780 
781 //-------------------------------------------------------------------------
782 void
784 {
785  if ( m_Initialized )
786  {
787  int s = GetSliceViewXY();
788 
789  if ( iSlice != s )
790  {
791  vtkViewImage2D *viewer = this->m_Pool->GetItem(0);
792  viewer->SetSlice(iSlice);
793  viewer->Render();
794  this->m_Pool->SyncRender(viewer);
795  // move slider and emit signal
796  this->SliderXY->setValue(iSlice);
797  // emit signal to navigation widget
798  emit SliceViewXYChanged(iSlice);
799  }
800  }
801 }
802 
803 //--------------------------------------------------------------------------
804 
805 //-------------------------------------------------------------------------
806 int
808 {
809  return this->m_Pool->GetItem(0)->GetSlice();
810 }
811 
812 //--------------------------------------------------------------------------
813 
814 //-------------------------------------------------------------------------
815 void
817 {
818  if ( m_Initialized )
819  {
820  int s = GetSliceViewXZ();
821 
822  if ( s != iSlice )
823  {
824  vtkViewImage2D *viewer = this->m_Pool->GetItem(1);
825  viewer->SetSlice(iSlice);
826  viewer->Render();
827  this->m_Pool->SyncRender(viewer);
828  // move slider and emit signal
829  this->SliderXZ->setValue(iSlice);
830  // emit signal to navigation widget
831  emit SliceViewXZChanged(iSlice);
832  }
833  }
834 }
835 
836 //--------------------------------------------------------------------------
837 
838 //-------------------------------------------------------------------------
839 int
841 {
842  return this->m_Pool->GetItem(1)->GetSlice();
843 }
844 
845 //--------------------------------------------------------------------------
846 
847 //-------------------------------------------------------------------------
848 void
850 {
851  if ( m_Initialized )
852  {
853  int s = GetSliceViewYZ();
854 
855  if ( s != iSlice )
856  {
857  vtkViewImage2D *viewer = this->m_Pool->GetItem(2);
858  viewer->SetSlice(iSlice);
859  viewer->Render();
860  this->m_Pool->SyncRender(viewer);
861  // move slider and emit signal
862  this->SliderYZ->setValue(iSlice);
863  // emit signal to navigation widget
864  emit SliceViewYZChanged(iSlice);
865  }
866  }
867 }
868 
869 //--------------------------------------------------------------------------
870 
871 //-------------------------------------------------------------------------
872 int
874 {
875  return this->m_Pool->GetItem(2)->GetSlice();
876 }
877 
878 //--------------------------------------------------------------------------
879 
880 //-------------------------------------------------------------------------
881 void
883 {
884  if ( m_Initialized )
885  {
886  int s = GetSliceViewXY();
887 
888  if ( s != this->SliderXY->value() )
889  {
890  this->SliderXY->setValue(s);
891  emit SliceViewXYChanged(s);
892  }
893  }
894 }
895 
896 //--------------------------------------------------------------------------
897 
898 //-------------------------------------------------------------------------
899 void
901 {
902  if ( m_Initialized )
903  {
904  int s = GetSliceViewXZ();
905 
906  if ( s != this->SliderXZ->value() )
907  {
908  this->SliderXZ->setValue(s);
909  emit SliceViewXZChanged(s);
910  }
911  }
912 }
913 
914 //--------------------------------------------------------------------------
915 
916 //-------------------------------------------------------------------------
917 void
919 {
920  if ( m_Initialized )
921  {
922  int s = GetSliceViewYZ();
923 
924  if ( s != this->SliderYZ->value() )
925  {
926  this->SliderYZ->setValue(s);
927  emit SliceViewYZChanged(s);
928  }
929  }
930 }
931 
932 //-------------------------------------------------------------------------
933 void
935 {
936  QSettings settings;
937 
938  settings.setValue( "VSplitterSizes", VSplitter->saveState() );
939  settings.setValue( "HtSplitterSizes", HtSplitter->saveState() );
940  settings.setValue( "HbSplitterSizes", HbSplitter->saveState() );
941 }
942 
943 //--------------------------------------------------------------------------
944 
945 //--------------------------------------------------------------------------
948 {
949  return m_View3D;
950 }
951 
952 //--------------------------------------------------------------------------
953 
954 //--------------------------------------------------------------------------
955 std::vector< vtkActor * >
956 QGoImageView3D::AddContour(vtkPolyData *iDataset, vtkProperty *iProperty)
957 {
958  std::vector< vtkActor * > oList =
959  QGoImageView::AddContour(iDataset, iProperty);
960 
961  vtkActor *temp = m_View3D->AddDataSet( (vtkDataSet *)iDataset,
962  iProperty, false, false );
963 
964  oList.push_back(temp);
965 
966  return oList;
967 }
968 //--------------------------------------------------------------------------
969 
970 //--------------------------------------------------------------------------
971 void
972 QGoImageView3D::RemoveActor(const int & iId, vtkActor *iActor)
973 {
974  if ( iId == 3 )
975  {
976  // remove from renderer
977  // should be add/remove view property
978  m_View3D->GetRenderer()->RemoveActor(iActor);
979  }
980  else
981  {
982  // remove from renderer
983  QGoImageView::RemoveActor(iId, iActor);
984  }
985 }
986 
987 //--------------------------------------------------------------------------
988 
989 //--------------------------------------------------------------------------
990 void
991 QGoImageView3D::AddActor(const int & iId, vtkActor *iActor)
992 {
993  if ( iId == 3 )
994  {
995  // add to renderer
996  m_View3D->GetRenderer()->AddActor(iActor);
997  }
998  else
999  {
1000  // add to renderer
1001  QGoImageView::AddActor(iId, iActor);
1002  }
1003 }
1004 
1005 //--------------------------------------------------------------------------
1006 
1007 //--------------------------------------------------------------------------
1008 void
1009 QGoImageView3D::SetLookupTable(vtkLookupTable *iLut)
1010 {
1011  m_View3D->SetLookupTable(iLut);
1013 }
1014 
1015 //--------------------------------------------------------------------------
1016 
1017 //--------------------------------------------------------------------------
1018 void
1020 {
1021  if ( this->m_Image->GetNumberOfScalarComponents() == 1 )
1022  {
1023  m_View3D->SetShowScalarBar(iShow);
1024  m_View3D->Render();
1025  }
1026 
1028 }
1029 
1030 //--------------------------------------------------------------------------
1031 
1032 //--------------------------------------------------------------------------
1033 void
1035 {
1038 
1040 }
1041 
1042 //--------------------------------------------------------------------------
1043 
1044 //--------------------------------------------------------------------------
1045 void
1047 {
1048  // Invert state of m_ShowCubes
1051 
1053 }
1054 
1055 //-------------------------------------------------------------------------
1056 
1057 //-------------------------------------------------------------------------
1058 void
1060 {
1061  //Strange behaviour....
1062 
1063  vtkCamera *camera = vtkCamera::New();
1064 
1065  this->m_View3D->GetRenderer()->SetActiveCamera(camera);
1066 
1067  // Dorsal view
1068  camera->Roll(180);
1069 
1070  // Posterior view
1071  if ( iView == 1 )
1072  {
1073  camera->SetRoll(0);
1074  camera->Elevation(90);
1075  }
1076 
1077  // Left view
1078  if ( iView == 3 )
1079  {
1080  camera->Azimuth(-90);
1081  }
1082 
1083  this->m_View3D->ResetCamera();
1084  this->m_View3D->Render();
1085  camera->Delete();
1086 }
1087 
1088 //-------------------------------------------------------------------------
1089 
1090 //-------------------------------------------------------------------------
1091 void
1093 {
1094  // Call superclass default mode
1096 
1097  // Update behavior in 3d view
1099  t->EnableDefaultMode();
1100 }
1101 
1102 //--------------------------------------------------------------------------
1103 
1104 //-------------------------------------------------------------------------
1105 void
1107 {
1108  // Call superclass default mode
1110 
1111  // Update behavior in 3d view
1113  t->EnableZoomMode();
1114 }
1115 
1116 //-------------------------------------------------------------------------
1117 
1118 //-------------------------------------------------------------------------
1119 void
1121 {
1122  // Call superclass default mode
1124 
1125  // Update behavior in 3d view
1127  t->EnablePanMode();
1128 }
1129 
1130 //-------------------------------------------------------------------------
1131 
1132 //-------------------------------------------------------------------------
1133 void
1135 {
1137 
1138  // Update behavior in 3d view to pick mode
1140  t->EnablePickMode();
1141 }
1142 
1143 //-------------------------------------------------------------------------
1144 
1145 //-------------------------------------------------------------------------
1146 void
1148 {
1149  // Enable widget in each slice
1150  QGoImageView::EnableSeedWidget(iActivate);
1151 
1152  // Update behavior to default mode in 3d view to default mode
1154  t->EnableDefaultMode();
1155 }
1156 
1157 //-------------------------------------------------------------------------
1158 
1159 //-------------------------------------------------------------------------
1160 void
1162 {
1163  //qDebug() << "Box ---Widget---";
1164  DefaultMode();
1165  m_BoxWidget->SetEnabled(iValue);
1166 
1167  // if widget is enabled, update meshes visibility according to the widget
1168  if ( iValue )
1169  {
1170  this->m_BoxWidget->InvokeEvent(vtkViewImage2DCommand::InteractionEvent);
1171  m_View3D->Render();
1172  m_Pool->SyncRender();
1173  }
1174 }
1175 
1176 //-------------------------------------------------------------------------
1177 void
1179 {
1180  //qDebug() << "Plane ---Widget---";
1181  DefaultMode();
1182  m_PlaneWidget->SetEnabled(iValue);
1183 
1184  // if widget is enabled, update meshes visibility according to the widget
1185  if ( iValue )
1186  {
1187  this->m_PlaneWidget->InvokeEvent(vtkViewImage2DCommand::InteractionEvent);
1188  m_View3D->Render();
1189  m_Pool->SyncRender();
1190  }
1191 }
1192 
1193 //-------------------------------------------------------------------------
1194 
1195 //-------------------------------------------------------------------------
1196 void
1198 {
1199  if(m_Pool->GetItem(0)->GetIsColor())
1200  {
1201  return;
1202  }
1203  // update tf function by modifying the widget
1204  double window = m_Pool->GetItem(0)->GetWindow();
1205  double color = m_Pool->GetItem(0)->GetLevel();
1206  emit NewWindowLevel(window, color);
1207 }
1208 //-------------------------------------------------------------------------
1209 
1210 //-------------------------------------------------------------------------
1211 void
1213 {
1214  //Change cursor
1215  QvtkWidget_XY->setCursor(iCursorShape);
1216  QvtkWidget_XZ->setCursor(iCursorShape);
1217  QvtkWidget_YZ->setCursor(iCursorShape);
1218  QvtkWidget_XYZ->setCursor(iCursorShape);
1219 }
1220 
1221 //-------------------------------------------------------------------------
1222 
1223 //-------------------------------------------------------------------------
1224 void
1226 {
1228  vtkImageData *imageData = this->m_Image;
1229  int extent[6];
1230  double spacing[3];
1231  imageData->GetExtent(extent);
1232  imageData->GetSpacing(spacing);
1233 
1234  m_BoxWidget->SetInput(imageData);
1235  m_BoxWidget->SetInteractor( m_View3D->GetInteractor() );
1236  m_BoxWidget->SetPlaceFactor(1);
1237  m_BoxWidget->PlaceWidget(extent[0] * spacing[0], extent[1] * spacing[0],
1238  extent[2] * spacing[1], extent[3] * spacing[1],
1239  extent[4] * spacing[2], extent[5] * spacing[2]);
1240  //m_BoxWidget->RotationEnabledOff();
1241  m_BoxWidget->SetKeyPressActivationValue ('b');
1242  m_BoxWidget->InsideOutOff();
1243 
1244  // has observer to be removed manually??
1245  m_BoxWidget->AddObserver(
1246  vtkViewImage2DCommand::InteractionEvent, m_View3D->GetCommand() );
1247 // update 2d views
1248  m_BoxWidget->AddObserver(
1249  vtkCommand::EndInteractionEvent, m_Pool->GetCommand() );
1250 
1251  m_View3D->GetCommand()->SetBoxWidget(m_BoxWidget);
1252 }
1253 
1254 //-------------------------------------------------------------------------
1255 
1256 //-------------------------------------------------------------------------
1257 void
1259 {
1260  m_PlaneWidget = vtkImplicitPlaneWidget::New();
1261  vtkImageData *imageData = this->m_Image;
1262  int extent[6];
1263  double spacing[3];
1264  imageData->GetExtent(extent);
1265  imageData->GetSpacing(spacing);
1266 
1267  m_PlaneWidget->SetInteractor( m_View3D->GetInteractor() );
1268  m_PlaneWidget->SetInput(imageData);
1269  m_PlaneWidget->SetPlaceFactor(1);
1270  m_PlaneWidget->PlaceWidget(
1271  extent[0] * spacing[0], extent[1] * spacing[0],
1272  extent[2] * spacing[1], extent[3] * spacing[1],
1273  extent[4] * spacing[2], extent[5] * spacing[2]);
1274  m_PlaneWidget->SetOrigin(
1275  ( extent[0] + extent[1] ) * spacing[0] / 2,
1276  ( extent[2] + extent[3] ) * spacing[1] / 2,
1277  ( extent[4] + extent[5] ) * spacing[2] / 2);
1278 
1279  m_PlaneWidget->ScaleEnabledOff();
1280  m_PlaneWidget->OutlineTranslationOff();
1281  m_PlaneWidget->GetPlaneProperty()->SetOpacity(0.5);
1282 
1283  m_PlaneWidget->UpdatePlacement();
1284 
1285  // has observer to be removed manually??
1286  m_PlaneWidget->AddObserver(
1287  vtkCommand::InteractionEvent, m_View3D->GetCommand() );
1288  // update 2d views
1289  m_PlaneWidget->AddObserver(
1290  vtkCommand::EndInteractionEvent, m_Pool->GetCommand() );
1291 
1292  m_View3D->GetCommand()->SetPlaneWidget(m_PlaneWidget);
1293 }
1294 
1295 //-------------------------------------------------------------------------
1297 //-------------------------------------------------------------------------
1298 void
1300 EnableVolumeRendering(const std::vector<vtkImageData*>& iImages,
1301  const std::vector<vtkPiecewiseFunction*>& iOpacities)
1302 {
1303  m_View3D->SetVolumeRenderingOn(iImages, iOpacities);
1304  m_View3D->Render();
1305 }
1306 //---------------------------------------------------------------------------
1307 
1308 //---------------------------------------------------------------------------
1309 void
1312 {
1314  m_View3D->Render();
1315 }
1316 //---------------------------------------------------------------------------
1317 
1318 //---------------------------------------------------------------------------
1319 void
1321 {
1323  static_cast< vtkInteractorStyleImage2D * >( caller );
1324 
1325  if( t->GetCurrentProp() )
1326  {
1327  m_CurrentActor = vtkActor::SafeDownCast ( t->GetCurrentProp() );
1328  emit SelectionChanged();
1329  }
1330 }
1331 
1332 //---------------------------------------------------------------------------
1333 
1334 //-------------------------------------------------------------------------
1335 void
1337 {
1338  vtkViewImage3D *t =
1339  static_cast< vtkViewImage3D * >( caller );
1340 
1341  m_CurrentActor = vtkActor::
1342  SafeDownCast( t->GetInteractorStyle3D()->GetCurrentProp() );
1344 
1345  emit VisibilityChanged();
1346 }
1347 
1348 //-------------------------------------------------------------------------
1349 
1350 //---------------------------------------------------------------------------
1351 vtkActor *
1353 {
1354  return m_CurrentActor;
1355 }
1356 
1357 //---------------------------------------------------------------------------
1358 
1359 //---------------------------------------------------------------------------
1360 bool
1362 {
1363  return m_CurrentState;
1364 }
1365 
1366 //---------------------------------------------------------------------------
1367 
1368 //---------------------------------------------------------------------------
1369 void
1371 {
1372  int n = m_Pool->GetNumberOfItems();
1373 
1374  for ( int i = 0; i < n; i++ )
1375  {
1376  vtkViewImage2D *viewer = m_Pool->GetItem(i);
1377  m_Pool->SynchronizeViews( iSynchronize );
1378  viewer->SynchronizeViews( iSynchronize );
1379  }
1380 }
1381 //---------------------------------------------------------------------------
1382 
1383 //---------------------------------------------------------------------------
1384 void
1386 {
1387  if(iShow)
1388  {
1390  }
1391 else
1392  {
1394  }
1395 
1396  m_View3D->Render();
1397 }
vtkActor * GetCurrentActor()
virtual void ShowScalarBar(const bool &)
void EnableZoomMode()
Start the Zoom Mode.
QWidget * LayOutWidget3
void SliceViewXZChanged(int Slice)
void SliceViewXYChanged(int Slice)
void EnableBoxWidget(bool)
Creates a box in 3d view to allow multiple meshes selection.
void setSizes(const QList< int > &list)
virtual void SetViewOrientation(int orientation)
void SetupVTKtoQtConnections()
virtual void Render(void)
in the QSplitter class, the method moveSplitter is protected, so it is not possible to use connect be...
void SelectionChanged()
QWidget * window() const
void push_back(const T &value)
vtkImageData * m_Image
Definition: QGoImageView.h:267
void UpdateRenderWindows()
Update only the visualization.
void InitializeSeedWidget()
Initializae the seed widget.
QSplitterChild * HtSplitter
void FullScreenViewChanged(int View)
QGoImageView3D(QWidget *parent=0)
Constructor by default.
virtual vtkActor * AddDataSet(vtkDataSet *dataset, vtkProperty *property=NULL, const bool &intersection=true, const bool &iDataVisibility=false)
void SetPlanesActors(std::vector< vtkProp3D * > iBounds)
void EnablePickMode()
Start the Pick Mode.
void UpdateCurrentActorVisibility(vtkObject *caller)
void SetVolumeRenderingOff()
virtual void AddActor(const int &iId, vtkActor *iActor)
vtkProp * GetCurrentProp()
Return the actor which is pointed by the cursor.
void ShowScalarBar(const bool &)
Show/hide the scalar bar in the collection.
QSlider * SliderYZ
QHBoxLayout * LayOut3
void NewWindowLevel(double, double)
void SetVolumeRenderingOn(const std::vector< vtkImageData * > &iImages, const std::vector< vtkPiecewiseFunction * > &iOpacities)
void EnableDefaultMode()
Start the Default Mode.
void PanMode()
Use the pan interactor style.
std::vector< vtkActor * > AddContour(vtkPolyData *iDataset, vtkProperty *iProperty=NULL)
Add contour with given property into the visualization.
void ShowPlanes(bool iShow)
void SynchronizeViews(bool iSynchronize)
void InitializeContourWidget()
Initializae the angle widget.
QSplitterChild * HbSplitter
void SetPlanesActors(std::vector< vtkProp3D * > iBounds)
QSlider * SliderXY
void addSpacing(int size)
void EnableSeedWidget(bool iActivate)
Use the one click interactor style.
Define the interactor behavior withing a vtkImage2D. 4 modes (Default, Zoom, Pan and Pick) ...
void EnableContourPickingMode()
Use the contour picking mode.
virtual void SyncReset(void)
Description: Synchronize reset between views.
QString tr(const char *sourceText, const char *disambiguation, int n)
int GetSliceViewYZ() const
void DefaultMode()
Use the default interactor style.
void addWidget(QWidget *widget)
virtual void SyncRender()
Description: Synchronize render between views.
void SetupViewGivenQVTKWidget(vtkViewImage2D *iView, QVTKWidget *iWidget)
void SetLookupTable(vtkLookupTable *iLut)
Set the lookup table in the collection.
std::vector< vtkProp3D * > GetPlanesActors()
double GetLevel()
void setValue(const QString &key, const QVariant &value)
void SynchronizeViews(bool iSynchronize)
Synchronize the 2d views.
void resize(int w, int h)
void SetSliceViewXZ(const int &)
vtkViewImage3D * m_View3D
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
virtual void resizeEvent(QResizeEvent *event)
virtual void retranslateUi(QWidget *parent)
void setLayout(QLayout *layout)
vtkInteractorStyleImage3D * GetInteractorStyle3D()
Get the interactor style for the vtkViewImage3D.
int GetFullScreenView() const
void SetSplinePlaneActorsVisibility(bool iVisibility)
Set the visibility of the plane actor.
void SetTriPlanarRenderingOn()
virtual void RemoveActor(const int &iId, vtkActor *iActor)
Abstract class for the visualization of 3D Image represented by one vtkImageData*.
Definition: QGoImageView.h:75
vtkViewImage3D * GetImageViewer3D()
QString SnapshotViewXYZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xyz-"))
QVTKInteractor * GetInteractor(const int &)
Returns the interactor for one given view.
void ZoomMode()
Use the zoom interactor style.
QHBoxLayout * LayOut1
virtual void SetLookupTable(vtkLookupTable *lookuptable)
void SetBoundsActorsVisibility(bool iVisibility)
Set the bounds actors visibility.
void SynchronizeViews(bool iSynchronize)
void UpdateCurrentActorSelection(vtkObject *caller)
void SetCubeVisibility(const bool &a)
Set the cube visibility.
QVTKWidget * QvtkWidget_XZ
std::vector< vtkProp3D * > GetPlanesActors()
Get the plane actors.
void EnableVolumeRendering(const std::vector< vtkImageData * > &iImages, const std::vector< vtkPiecewiseFunction * > &iOpacities)
Creates a box in 3d view to allow multiple meshes selection.
virtual void setupUi(QWidget *parent)
Basic class to handle items such as images and polydatas visualization in 3D.
void InitializePlaneWidget()
virtual void Add2DPhantom(const unsigned int &i, vtkImageActor *input, vtkPolyData *in_bounds=NULL)
bool m_ShowAnnotations
Definition: QGoImageView.h:292
void hide()
void setMinimum(int)
vtkImplicitPlaneWidget * m_PlaneWidget
bool m_ShowSplinePlane
Definition: QGoImageView.h:293
virtual void SetInput(vtkImageData *input)
void SetTriPlanarRenderingOff()
virtual void SetSlice(int s)
Set/Get the current slice to display (depending on the orientation this can be in X...
QVTKWidget * QvtkWidget_YZ
void InitializeDistanceWidget()
Initializae the distance widget.
bool GetCurrentState()
Store the actor which is pointed by the cursor into &quot;m_CurrentProp&quot;.
void EnableSeedWidget(bool iEnable)
void SetSliceViewYZ(const int &)
QString SnapshotViewYZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-yz"))
const QSize & size() const
void setValue(int)
virtual void AddActor(const int &iId, vtkActor *iActor)
static vtkViewImage2D * New()
Convenient method to access the constructor.
virtual double * GetBackground(void)
QSplitter * VSplitter
QSlider * SliderXZ
QString SnapshotViewXY(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xy-"))
int GetSliceViewXZ() const
QWidget * LayOutWidget2
virtual void SetImage(vtkImageData *iImage)
Set the image to displaid.
void ActorPickingMode()
switch to contour picking mode
void SetFullScreenView(const int &iS)
vtkActor * m_CurrentActor
virtual void Render(void)
virtual void SetShowScalarBar(const bool &)
Show/Hide scalar bar.
QVTKWidget * QvtkWidget_XYZ
virtual std::vector< vtkActor * > AddContour(vtkPolyData *iDataset, vtkProperty *iProperty=NULL)
Add contour with given property into the visualization.
virtual void SetLookupTable(vtkLookupTable *)
void DisableVolumeRendering()
void PanMode()
Use the pan interactor style.
void ShowSplinePlane()
Invert visibility of the Spline Plane.
void UpdateOnFirstRender()
static vtkOrientedBoxWidget * New()
Convenient method to access the constructor.
QHBoxLayout * LayOut2
QString SnapshotViewXZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xz-"))
virtual vtkRenderWindowInteractor * GetInteractor()
void SliceViewYZChanged(int Slice)
void EnablePlaneWidget(bool)
Creates a box in 3d view to allow multiple meshes selection.
void setWindowTitle(const QString &)
QWidget(QWidget *parent, QFlags< Qt::WindowType > f)
unsigned int m_SnapshotId
Definition: QGoImageView.h:291
void InitializeAngleWidget()
Initializae the angle widget.
void EnablePanMode()
Start the Pan Mode.
QString SnapshotView(QVTKWidget *iWidget, const GoFigure::FileType &iType, const QString &iBaseName, const unsigned int &iSnapshotId)
virtual void SetViewConvention(int convention)
vtkOrientedBoxWidget * m_BoxWidget
vtkProperty * m_HighlightedContourProperty
vtkProp * GetCurrentProp()
Return the actor which is pointed by the cursor.
vtkViewImage2D * GetItem(int i)
Define the interactor behavior withing a vtkImage3D. 4 modes (Default, Zoom, Pan and Pick) ...
void show()
double GetWindow()
void VisibilityChanged()
virtual void resizeEvent(QResizeEvent *event)
QWidget * LayOutWidget4
static vtkViewImage3D * New()
Convenient method to access the constructor.
void ChangeCursorShape(QCursor iCursorShape)
void setMaximum(int)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void ZoomMode()
Use the zoom interactor style.
int GetSliceViewXY() const
float m_IntersectionLineWidth
Definition: QGoImageView.h:290
void SetExtraRenderWindow(vtkRenderWindow *win)
QByteArray saveState() const
QWidget * LayOutWidget1
QHBoxLayout * LayOut4
virtual void RemoveActor(const int &iId, vtkActor *iActor)
void SetSliceViewXY(const int &)
QVTKWidget * QvtkWidget_XY
void connectSlotsByName(QObject *object)
void DefaultMode()
Use the default interactor style.
vtkEventQtSlotConnect * VtkEventQtConnector
vtkViewImage2DCollection * m_Pool
Definition: QGoImageView.h:266
Basic class to handle 2D/3D items such as images and polydatas visualization in 2D.
virtual void ResetCamera(void)
Reset the camera.
virtual ~QGoImageView3D()
Destructor.