GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGoImageView.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 #include "QGoImageView.h"
35 #include "QDebug"
36 
37 #include "QVTKWidget.h"
38 #include "vtkEventQtSlotConnect.h"
39 #include "vtkLookupTable.h"
40 #include "vtkRenderWindow.h"
41 #include "vtkRendererCollection.h"
42 #include "vtkImageData.h"
43 #include "vtkTextProperty.h"
46 #include "vtkViewImage2D.h"
47 
48 // For the seed widget
49 #include "vtkIntArray.h"
50 #include "vtkConstrainedPointHandleRepresentation.h"
51 #include "vtkSeedWidget.h"
52 #include "vtkImageActorPointPlacer.h"
53 #include "vtkProperty.h"
54 #include "vtkWidgetEvent.h"
55 #include "vtkWidgetEventTranslator.h"
56 #include "vtkEvent.h"
57 
58 // For the distance widget...
59 #include "vtkDistanceWidget.h"
60 
61 // For the angle widget...
62 #include "vtkAngleWidget.h"
63 
64 // For the contour widget...
65 #include "vtkContourWidget.h"
66 #include "vtkOrientedGlyphContourRepresentation.h"
67 #include "vtkPolyData.h"
68 
69 //--------------------------------------------------------------------------
75  m_Pool(0),
76  m_Image(0),
77  m_IntersectionLineWidth(1.),
78  m_SnapshotId(0),
79  m_ShowAnnotations(true),
80  m_ShowSplinePlane(true)
81 {
82  m_Image = vtkImageData::New();
84 }
85 
86 //--------------------------------------------------------------------------
89 {
90  if(m_Image)
91  {
92  m_Image->Delete();
93  m_Image = 0;
94  }
95 
96  if ( m_Pool )
97  {
98  m_Pool->Delete();
99  m_Pool = 0;
100  }
101 }
102 
103 //--------------------------------------------------------------------------
104 void QGoImageView::SetIntersectionLineWidth(const float & iWidth)
105 {
106  m_IntersectionLineWidth = iWidth;
107 }
108 
109 //--------------------------------------------------------------------------
110 void
112  double & g,
113  double & b)
114 {
115  double *rgb = this->GetBackgroundColor();
116 
117  r = rgb[0];
118  g = rgb[1];
119  b = rgb[2];
120 }
121 
122 //-------------------------------------------------------------------------
123 double *
125 {
126  return m_Pool->GetItem(0)->GetBackground();
127 }
128 
129 //-------------------------------------------------------------------------
130 void
132  const double & g,
133  const double & b)
134 {
135  double *current_rgb = this->GetBackgroundColor();
136 
137  if ( !(( current_rgb[0] == r )
138  && ( current_rgb[1] == g )
139  && ( current_rgb[2] == b )) )
140  {
141  double textcolor[3];
142 
143  if ( ( r != 0.5 ) && ( g != 0.5 ) && ( b != 0.5 ) )
144  {
145  textcolor[0] = 1. - r;
146  textcolor[1] = 1. - g;
147  textcolor[2] = 1. - b;
148  }
149  else
150  {
151  textcolor[0] = 1.;
152  textcolor[1] = 1.;
153  textcolor[2] = 0.;
154  }
155 
156  double rgb[3] = { r, g, b };
157 
159  int n = m_Pool->GetNumberOfItems();
160 
161  for ( int i = 0; i < n; i++ )
162  {
163  vtkTextProperty *tproperty =
164  m_Pool->GetItem(i)->GetTextProperty();
165  tproperty->SetFontFamilyToArial();
166  tproperty->SetFontSize(14);
167  tproperty->SetColor(textcolor);
168  }
169 
170  m_Pool->SyncRender();
171  }
172 }
173 
174 //--------------------------------------------------------------------------
175 void
177 {
178  this->SetBackgroundColor(rgb[0], rgb[1], rgb[2]);
179 }
180 
181 //--------------------------------------------------------------------------
182 
183 //--------------------------------------------------------------------------
184 void
186 {
187  qreal r, g, b;
188 
189  iColor.getRgbF(&r, &g, &b);
190 
191  this->SetBackgroundColor( static_cast< double >( r ),
192  static_cast< double >( g ),
193  static_cast< double >( b ) );
194 }
195 
196 //--------------------------------------------------------------------------
197 int *
199 {
200  vtkViewImage2D *View = m_Pool->GetItem(0);
201 
202  return View->GetImageCoordinatesFromWorldCoordinates(iPos);
203 }
204 
205 //--------------------------------------------------------------------------
206 
209 {
210  return m_Pool->GetItem(iId);
211 }
212 
213 //--------------------------------------------------------------------------
214 int
216 {
217  return m_Pool->GetNumberOfItems();
218 }
219 
220 //--------------------------------------------------------------------------
221 std::vector< vtkActor * >
222 QGoImageView::AddContour(vtkPolyData *iDataset, vtkProperty *iProperty)
223 {
224  int n = m_Pool->GetNumberOfItems();
225 
226  std::vector< vtkActor * > oActorVector(n, (vtkActor *)NULL);
227 
228  if ( iDataset )
229  {
230  #ifdef HAS_OPENMP
231  #pragma omp for
232  #endif
233  for ( int i = 0; i < n; i++ )
234  {
235  vtkViewImage2D *viewer = m_Pool->GetItem(i);
236  vtkActor * temp = viewer->AddDataSet(iDataset, iProperty);
237  oActorVector[i] = temp;
238  }
239  }
240 
241  return oActorVector;
242 }
243 
244 //--------------------------------------------------------------------------
245 
246 //--------------------------------------------------------------------------
247 void
248 QGoImageView::RemoveActor(const int & iId, vtkActor *iActor)
249 {
250  if ( ( iId >= 0 ) && ( iId < m_Pool->GetNumberOfItems() ) )
251  {
252  vtkViewImage2D *viewer = m_Pool->GetItem(iId);
253  viewer->GetRenderer()->RemoveActor(iActor);
254  }
255 }
256 
257 //--------------------------------------------------------------------------
258 
259 //--------------------------------------------------------------------------
260 void
261 QGoImageView::AddActor(const int & iId, vtkActor *iActor)
262 {
263  if ( ( iId >= 0 ) && ( iId < m_Pool->GetNumberOfItems() ) )
264  {
265  vtkViewImage2D *viewer = m_Pool->GetItem(iId);
266  viewer->GetRenderer()->AddActor(iActor);
267  }
268 }
269 
270 //--------------------------------------------------------------------------
271 void
273 {
274  //qDebug() << "Default Mode";
275  //Change cursor
276  ChangeCursorShape(Qt::ArrowCursor);
277 
278  // Change mode in the collection
280 }
281 
282 //--------------------------------------------------------------------------
283 void
285 {
286  //qDebug() << "Zoom Mode";
287  //Change cursors
288  QCursor zoomCursor(QPixmap( QString::fromUtf8(":/fig/zoom.png") ), -1, -1);
289 
290  ChangeCursorShape(zoomCursor);
291 
292  // Change mode in the collection
294 }
295 
296 //--------------------------------------------------------------------------
297 void
299 {
300  //qDebug() << "Pan Mode";
301  //Change cursor
302  ChangeCursorShape(Qt::OpenHandCursor);
303 
304  // Change mode in the collection
306 }
307 
308 //-------------------------------------------------------------------------
309 void
311 {
313 }
314 
315 //-------------------------------------------------------------------------
316 void
317 QGoImageView::SetLookupTable(vtkLookupTable *iLut)
318 {
319  if ( this->m_Image->GetNumberOfScalarComponents() == 1 )
320  {
321  m_Pool->SyncSetLookupTable(iLut);
323  m_Pool->SyncRender();
324  }
325 }
326 
327 //-------------------------------------------------------------------------
328 void
329 QGoImageView::ShowScalarBar(const bool & iShow)
330 {
331  if ( this->m_Image->GetNumberOfScalarComponents() == 1 )
332  {
333  m_Pool->SyncSetShowScalarBar(iShow);
334  m_Pool->SyncRender();
335  }
336 }
337 
338 //-------------------------------------------------------------------------
339 void
341 {
342  this->m_Pool->SyncRender();
343 }
344 
345 //-------------------------------------------------------------------------
346 void
348 {
350  this->m_Pool->SyncSetShowAnnotations(m_ShowAnnotations);
352 }
353 
354 //-------------------------------------------------------------------------
355 vtkImageActor *
357 {
358  int N = this->m_Pool->GetNumberOfItems();
359 
360  if ( ( iId < 0 ) || ( iId >= N ) )
361  {
362  return NULL;
363  }
364  else
365  {
366  return m_Pool->GetItem(iId)->GetImageActor();
367  }
368 }
369 
370 //-------------------------------------------------------------------------
371 
372 void
374 {
375  // Invert state of m_ShowPlane
378 }
379 
380 //--------------------------------------------------------------------------
381 void
383 {
384  m_Pool->SyncSetInterpolate(val);
385 }
386 
387 //-------------------------------------------------------------------------
388 void
390 {
391  //Change cursor
392  ChangeCursorShape(Qt::ArrowCursor);
393  // Change mode in the collection
395 }
396 
397 //-------------------------------------------------------------------------
398 vtkImageData *
400 {
401  return m_Image;
402 }
403 
404 //-------------------------------------------------------------------------
405 void
407 {
408  int N = this->m_Pool->GetNumberOfItems();
409 
410  for ( int i = 0; i < N; ++i )
411  {
412  this->m_Handle.push_back(vtkSmartPointer< vtkConstrainedPointHandleRepresentation >::New());
413  this->m_Handle.back()->GetProperty()->SetColor(1, 0, 0);
414 
415  this->m_SeedRep.push_back(vtkSmartPointer< vtkSeedRepresentation >::New());
416  this->m_SeedRep.back()->SetHandleRepresentation(this->m_Handle.back());
417 
418  this->m_SeedWidget.push_back(vtkSmartPointer< vtkSeedWidget >::New());
419  this->m_SeedWidget.back()->SetRepresentation(this->m_SeedRep.back());
420 
421  this->m_SeedWidget.back()->SetInteractor(
422  this->m_Pool->GetItem(i)->GetInteractor() );
423 
424  // to remove right click interaction in the one click widget
425  this->m_SeedWidget[i]->GetEventTranslator()->RemoveTranslation(
426  vtkCommand::RightButtonPressEvent);
427 
428  this->m_SeedWidget[i]->GetEventTranslator()->SetTranslation(
429  vtkCommand::KeyPressEvent, vtkEvent::NoModifier, 100, 0, "d", vtkWidgetEvent::Delete);
430  }
431 }
432 
433 //-------------------------------------------------------------------------
434 void
436 {
437  //qDebug() << "Seed ---Widget---" << iEnable;
438 
439  if ( iEnable )
440  {
441  DefaultMode();
442  }
443 
444  std::vector< vtkSmartPointer< vtkSeedWidget > >::iterator
445  it = m_SeedWidget.begin();
446  while ( it != m_SeedWidget.end() )
447  {
448  ( *it )->SetEnabled(iEnable);
449  ++it;
450  }
451 }
452 //-------------------------------------------------------------------------
453 
454 //-------------------------------------------------------------------------
455 void
457 GetSeeds(std::vector<vtkPoints*>& iPoints)
458 {
459  for ( unsigned int i = 0; i < 3; i++ )
460  {
461  double worldPosition[3];
462  int N = this->m_SeedRep[i]->GetNumberOfSeeds();
463 
464  for ( int j = 0; j < N; j++ )
465  {
466  // Get World position (may be not accurate if we are between 8 pixels
467  // (3D))
468  this->m_SeedRep[i]->GetSeedWorldPosition(j, worldPosition);
469 
470  iPoints[i]->InsertNextPoint(worldPosition);
471  }
472  }
473 }
474 //-------------------------------------------------------------------------
475 
476 //-------------------------------------------------------------------------
477 void
479 {
480  for ( unsigned int i = 0; i < this->m_SeedWidget.size(); i++ )
481  {
482  for ( int k = this->m_SeedRep[i]->GetNumberOfSeeds() - 1; k >= 0; --k )
483  {
484  this->m_SeedWidget[i]->DeleteSeed(k);
485  this->m_SeedRep[i]->RemoveHandle(k);
486  }
487  }
488  // automatically remove seeds from the visualization
489  this->UpdateRenderWindows();
490 }
491 
492 //-------------------------------------------------------------------------
493 void
495 {
496  int N = this->m_Pool->GetNumberOfItems();
497 
498  m_DistanceWidget.resize(N);
499  for ( int i = 0; i < N; ++i )
500  {
501  this->m_DistanceWidget[i] = vtkSmartPointer< vtkDistanceWidget >::New();
502  this->m_DistanceWidget[i]->SetInteractor( this->m_Pool->GetItem(i)->GetInteractor() );
503  this->m_DistanceWidget[i]->CreateDefaultRepresentation();
504 
505  this->m_DistanceWidget[i]->Off();
506  }
507 }
508 
509 //-------------------------------------------------------------------------
510 void
512 {
513  //qDebug() << "Distance ---Widget---" << iActive;
514 
515  if ( iActive )
516  {
517  DefaultMode();
518  }
519 
520  int N = this->m_Pool->GetNumberOfItems();
521  for ( int i = 0; i < N; i++ )
522  {
523  this->m_DistanceWidget[i]->SetEnabled(iActive);
524  }
525 }
526 
527 //-------------------------------------------------------------------------
528 void
530 {
531  int N = this->m_Pool->GetNumberOfItems();
532 
533  m_AngleWidget.resize(N);
534  for ( int i = 0; i < N; ++i )
535  {
536  this->m_AngleWidget[i] = vtkSmartPointer< vtkAngleWidget >::New();
537  this->m_AngleWidget[i]->SetInteractor( this->m_Pool->GetItem(i)->GetInteractor() );
538  this->m_AngleWidget[i]->CreateDefaultRepresentation();
539 
540  this->m_AngleWidget[i]->Off();
541  }
542 }
543 
544 //-------------------------------------------------------------------------
545 void
547 {
548  //qDebug() << "Angle ---Widget---" << iActive;
549 
550  if ( iActive )
551  {
552  DefaultMode();
553  }
554 
555  int N = this->m_Pool->GetNumberOfItems();
556  for ( int i = 0; i < N; i++ )
557  {
558  if ( iActive )
559  {
560  this->m_AngleWidget[i]->On();
561  }
562  else
563  {
564  this->m_AngleWidget[i]->Off();
565  }
566  }
567 }
568 
569 //-------------------------------------------------------------------------
570 void
572 {
573  int N = this->m_Pool->GetNumberOfItems();
574 
575  m_ContourWidget.resize(N);
576  m_ContourRepresentation.resize(N);
577 
578  // use while iterator
579  for ( int i = 0; i < N; ++i )
580  {
581  // Contour widget
583  vtkSmartPointer< vtkOrientedGlyphContourRepresentation >::New();
584  m_ContourRepresentation[i]->GetProperty()->SetColor(0., 1., 1.);
585  m_ContourRepresentation[i]->GetLinesProperty()->SetColor(1., 0., 1.);
586  m_ContourRepresentation[i]->GetActiveProperty()->SetColor(1., 1., 0.);
587 
588  m_ContourWidget[i] = vtkSmartPointer< vtkContourWidget >::New();
589  m_ContourWidget[i]->SetPriority(10.0);
590  m_ContourWidget[i]->SetInteractor( this->m_Pool->GetItem(i)->GetInteractor() );
591  m_ContourWidget[i]->Off();
592 
593  m_ContourWidget[i]->SetRepresentation(this->m_ContourRepresentation[i]);
594  }
595 }
596 
597 //-------------------------------------------------------------------------
598 void
600 {
601  if ( iActivate )
602  {
603  DefaultMode();
604  }
605 
606  std::vector< vtkSmartPointer< vtkContourWidget > >::iterator
607  it = m_ContourWidget.begin();
608  while ( it != m_ContourWidget.end() )
609  {
610  ( *it )->SetEnabled(iActivate);
611  ++it;
612  }
613 }
614 
615 //-------------------------------------------------------------------------
616 void
617 QGoImageView::InitializeContourWidgetNodes(int iDir, vtkPolyData *iNodes)
618 {
619  if ( ( iDir >= 0 ) && ( iDir < m_Pool->GetNumberOfItems() ) )
620  {
621  m_ContourWidget[iDir]->SetEnabled(1);
622  m_ContourWidget[iDir]->Initialize(iNodes);
623  }
624 }
625 
626 //-------------------------------------------------------------------------
627 void
629 {
630  int N = static_cast< int >( m_ContourWidget.size() );
631 
632 #ifdef HAS_OPENMP
633 #pragma omp for
634 #endif
635  for ( int i = 0; i < N; i++ )
636  {
638  }
639 }
640 
641 //-------------------------------------------------------------------------
642 void
644  QColor nodecolor, QColor activenodecolor)
645 {
646  m_LinesWidth = linewidth;
647  m_LinesColor = linecolor;
648  m_NodesColor = nodecolor;
649  m_ActiveNodesColor = activenodecolor;
650 
651  qreal rl, gl, bl;
652  linecolor.getRgbF(&rl, &gl, &bl);
653 
654  qreal rn, gn, bn;
655  nodecolor.getRgbF(&rn, &gn, &bn);
656 
657  qreal ra, ga, ba;
658  activenodecolor.getRgbF(&ra, &ga, &ba);
659 
660  std::vector< vtkSmartPointer< vtkOrientedGlyphContourRepresentation > >::iterator
661  it = m_ContourRepresentation.begin();
662  while ( it != m_ContourRepresentation.end() )
663  {
664  ( *it )->GetLinesProperty()->SetLineWidth(linewidth);
665  ( *it )->GetLinesProperty()->SetColor(
666  static_cast< double >( rl ),
667  static_cast< double >( gl ),
668  static_cast< double >( bl ) );
669 
670  ( *it )->GetProperty()->SetColor(
671  static_cast< double >( rn ),
672  static_cast< double >( gn ),
673  static_cast< double >( bn ) );
674 
675  ( *it )->GetActiveProperty()->SetColor(
676  static_cast< double >( ra ),
677  static_cast< double >( ga ),
678  static_cast< double >( ba ) );
679  ++it;
680  }
681 }
682 
683 //-------------------------------------------------------------------------
684 vtkPolyData *
686 {
687  return m_ContourRepresentation[iDir]->GetContourRepresentationAsPolyData();
688 }
689 
690 //-------------------------------------------------------------------------
691 vtkPolyData *
693 {
694  vtkPolyData *contour_nodes = vtkPolyData::New();
695 
696  m_ContourRepresentation[iDir]->GetNodePolyData(contour_nodes);
697 
698  return contour_nodes;
699 }
700 
701 //-------------------------------------------------------------------------
702 void
704 {
705  std::vector< vtkSmartPointer< vtkOrientedGlyphContourRepresentation > >::iterator
706  it = m_ContourRepresentation.begin();
707  int i = 0;
708 
709  while ( it != m_ContourRepresentation.end() )
710  {
711  vtkSmartPointer< vtkImageActorPointPlacer > point_placer =
712  vtkSmartPointer< vtkImageActorPointPlacer >::New();
713  point_placer->SetImageActor( GetImageActor(i) );
714 
715  ( *it )->SetPointPlacer(point_placer);
716  ++it;
717  ++i;
718  }
719 }
virtual void SyncResetWindowLevel(void)
Description: Synchronize reset window level between views.
vtkImageData * GetImage()
Get the displaid image.
void ResetWindowLevel()
Reset collection Window level.
double * GetBackgroundColor()
void UpdateContourRepresentationProperties(float linewidth, QColor linecolor, QColor nodecolor, QColor activenodecolor)
void SetIntersectionLineWidth(const float &iWidth)
void SetInterpolate(const int &val)
Interpolate the data for visualization.
vtkImageData * m_Image
Definition: QGoImageView.h:267
void UpdateRenderWindows()
Update only the visualization.
void InitializeSeedWidget()
Initializae the seed widget.
void ReinitializeContourWidget()
QColor m_LinesColor
Definition: QGoImageView.h:286
virtual void AddActor(const int &iId, vtkActor *iActor)
void ShowScalarBar(const bool &)
Show/hide the scalar bar in the collection.
void PanMode()
Use the pan interactor style.
vtkPolyData * GetContourRepresentationAsPolydata(int iDir)
void InitializeContourWidget()
Initializae the angle widget.
void getRgbF(qreal *r, qreal *g, qreal *b, qreal *a) const
void EnableContourPickingMode()
Use the contour picking mode.
void GetSeeds(std::vector< vtkPoints * > &iPoints)
virtual void SyncRender()
Description: Synchronize render between views.
virtual vtkActor * AddDataSet(vtkPolyData *polydata, vtkProperty *property=NULL, const bool &intersection=true, const bool &iDataVisibility=false)
Add a dataset to the view (has to be subclass of vtkPointSet). The dataset will be cut through the im...
void EnableContourPickingMode()
Change Interaction mode of the collection to ContourPickingMode()
vtkPolyData * GetContourRepresentationNodePolydata(int iDir)
void SetLookupTable(vtkLookupTable *iLut)
Set the lookup table in the collection.
virtual int * GetImageCoordinatesFromWorldCoordinates(double position[3])
Convert a world coordinate point into an image indices coordinate point.
vtkViewImage2D * GetImageViewer(const int &iId)
void EnableDistanceWidget(bool iEnable)
QString fromUtf8(const char *str, int size)
void SetSplinePlaneActorsVisibility(bool iVisibility)
Set the visibility of the plane actor.
void ZoomMode()
Use the zoom interactor style.
void EnableDefaultInteractionMode()
Change Interaction mode of the collection to DefaultMode()
QColor m_NodesColor
Definition: QGoImageView.h:287
std::vector< vtkSmartPointer< vtkContourWidget > > m_ContourWidget
Definition: QGoImageView.h:283
virtual void ChangeCursorShape(QCursor iCursorShape)=0
void ClearAllSeeds()
Clear all the seeds positions after using it.
bool m_ShowAnnotations
Definition: QGoImageView.h:292
bool m_ShowSplinePlane
Definition: QGoImageView.h:293
void InitializeContourWidgetNodes(int iDir, vtkPolyData *iNodes)
void InitializeDistanceWidget()
Initializae the distance widget.
void EnableSeedWidget(bool iEnable)
std::vector< vtkSmartPointer< vtkSeedWidget > > m_SeedWidget
Definition: QGoImageView.h:270
QGoImageView(QWidget *parent=0)
Default Constructor.
virtual double * GetBackground(void)
std::vector< vtkSmartPointer< vtkDistanceWidget > > m_DistanceWidget
Definition: QGoImageView.h:275
std::vector< vtkSmartPointer< vtkAngleWidget > > m_AngleWidget
Definition: QGoImageView.h:280
void EnableZoomInteractionMode()
Change Interaction mode of the collection to ZoomMode()
static vtkViewImage2DCollection * New()
Convenient method to access the constructor.
virtual std::vector< vtkActor * > AddContour(vtkPolyData *iDataset, vtkProperty *iProperty=NULL)
Add contour with given property into the visualization.
int * GetImageCoordinatesFromWorldCoordinates(double pos[3])
Get Image Coordinates from World Coordinates.
void ShowSplinePlane()
Invert visibility of the Spline Plane.
virtual vtkRenderWindowInteractor * GetInteractor()
float m_LinesWidth
Definition: QGoImageView.h:285
QColor m_ActiveNodesColor
Definition: QGoImageView.h:288
void InitializeAngleWidget()
Initializae the angle widget.
void EnableContourWidget(bool iActivate)
virtual ~QGoImageView()
Destructor.
std::vector< vtkSmartPointer< vtkSeedRepresentation > > m_SeedRep
Definition: QGoImageView.h:272
void EnablePanInteractionMode()
Change Interaction mode of the collection to ZoomMode()
vtkViewImage2D * GetItem(int i)
void EnableAngleWidget(bool iActive)
int GetNumberOfImageViewers()
std::vector< vtkSmartPointer< vtkConstrainedPointHandleRepresentation > > m_Handle
Definition: QGoImageView.h:271
vtkImageActor * GetImageActor(const int &iId)
Get the image actor.
float m_IntersectionLineWidth
Definition: QGoImageView.h:290
void SetBackgroundColor(const double &r, const double &g, const double &b)
Set background color for all views.
virtual void RemoveActor(const int &iId, vtkActor *iActor)
void DefaultMode()
Use the default interactor style.
vtkViewImage2DCollection * m_Pool
Definition: QGoImageView.h:266
Basic class to handle 2D/3D items such as images and polydatas visualization in 2D.
void ShowAnnotations()
Show annotations in the collection.
std::vector< vtkSmartPointer< vtkOrientedGlyphContourRepresentation > > m_ContourRepresentation
Definition: QGoImageView.h:284