GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vtkViewImage.cxx
Go to the documentation of this file.
1 /*========================================================================
2  Copyright (c) INRIA - ASCLEPIOS Project (http://www-sop.inria.fr/asclepios).
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions are met:
7 
8  * Redistributions of source code must retain the above copyright notice,
9  this list of conditions and the following disclaimer.
10 
11  * Redistributions in binary form must reproduce the above copyright notice,
12  this list of conditions and the following disclaimer in the documentation
13  and/or other materials provided with the distribution.
14 
15  * Neither the name of INRIA or ASCLEPIOS, nor the names of any contributors
16  may be used to endorse or promote products derived from this software
17  without specific prior written permission.
18 
19  * Modified source versions must be plainly marked as such, and must not be
20  misrepresented as being the original software.
21 
22  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
23  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
26  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  =========================================================================*/
33 
34 /*=========================================================================
35  Modifications were made by the GoFigure Dev. Team.
36  while at Megason Lab, Systems biology, Harvard Medical school, 2009-11
37 
38  Copyright (c) 2009-11, President and Fellows of Harvard College.
39  All rights reserved.
40 
41  Redistribution and use in source and binary forms, with or without
42  modification, are permitted provided that the following conditions are met:
43 
44  Redistributions of source code must retain the above copyright notice,
45  this list of conditions and the following disclaimer.
46  Redistributions in binary form must reproduce the above copyright notice,
47  this list of conditions and the following disclaimer in the documentation
48  and/or other materials provided with the distribution.
49  Neither the name of the President and Fellows of Harvard College
50  nor the names of its contributors may be used to endorse or promote
51  products derived from this software without specific prior written
52  permission.
53 
54  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
55  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
56  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
57  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
58  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
59  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
60  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
61  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
62  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
63  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
64  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
65 
66  =========================================================================*/
67 
68 #include "vtkViewImage.h"
69 #include "vtkInformation.h"
70 
71 #include "vtkSmartPointer.h"
72 
73 #include "vtkCamera.h"
74 #include "vtkCommand.h"
75 #include "vtkImageActor.h"
76 #include "vtkImageData.h"
77 #include "vtkImageMapToWindowLevelColors.h"
78 #include "vtkInteractorStyleImage.h"
79 #include "vtkObjectFactory.h"
80 #include "vtkRenderWindow.h"
81 #include "vtkRenderWindowInteractor.h"
82 #include "vtkRenderer.h"
83 #include "vtkMatrix4x4.h"
84 #include "vtkScalarBarActor.h"
86 #include "vtkCornerAnnotation.h"
87 #include "vtkTextProperty.h"
88 #include "vtkLookupTable.h"
89 #include "vtkMath.h"
90 #include "vtkPlane.h"
91 #include "vtkCutter.h"
92 #include "vtkProperty.h"
93 #include "vtkActor.h"
94 #include "vtkPolyDataMapper.h"
95 #include "vtkPoints.h"
96 #include "vtkIdList.h"
97 #include "vtkOutlineSource.h"
98 #include "vtkMatrixToLinearTransform.h"
99 #include "vtkPointData.h"
100 #include "vtkUnsignedCharArray.h"
101 #include "vtkIntArray.h"
102 #include "vtkImageAccumulate.h"
103 #include "vtkInteractorStyleImage.h"
104 
105 #include <vector>
106 #include <string>
107 
108 vtkCxxRevisionMacro(vtkViewImage, "$Revision: 546 $");
109 //vtkStandardNewMacro(vtkViewImage);
110 
111 //----------------------------------------------------------------------------
113 {
114  this->OrientationMatrix = vtkMatrix4x4::New();
115  this->CornerAnnotation = vtkCornerAnnotation::New();
116  this->TextProperty = vtkTextProperty::New();
117  this->LookupTable = vtkLookupTable::New();
118  this->ScalarBarActor = vtkScalarBarActor::New();
119  this->OrientationTransform = vtkMatrixToLinearTransform::New();
120 
121  this->OrientationMatrix->Identity();
122  this->CornerAnnotation->SetNonlinearFontScaleFactor (0.35);
123  this->CornerAnnotation->SetTextProperty (this->TextProperty);
124 
125  this->ScalarBarActor->GetLabelTextProperty()->BoldOff();
126  this->ScalarBarActor->GetLabelTextProperty()->ItalicOff();
127  this->ScalarBarActor->SetNumberOfLabels (3);
128  this->ScalarBarActor->SetWidth (0.1);
129  this->ScalarBarActor->SetHeight (0.5);
130  this->ScalarBarActor->SetPosition (0.9, 0.3);
131  this->LookupTable->SetTableRange (0, 1);
132  this->LookupTable->SetSaturationRange (0, 0);
133  this->LookupTable->SetHueRange (0, 0);
134  this->LookupTable->SetValueRange (0, 1);
135  this->LookupTable->Build();
136 
137  this->ShowAnnotations = true;
138  this->ShowScalarBar = true;
139 
140  this->OrientationTransform->SetInput (this->OrientationMatrix);
141 
142  this->ScalarBarActor->SetLookupTable (this->LookupTable);
143 
144  this->Renderer->AddViewProp (this->CornerAnnotation);
145 
146  this->Renderer->AddViewProp (this->ScalarBarActor);
147 
148  this->IntersectionLineWidth = 1.;
149 
150  this->IsColor = false;
151 
152  this->Window = -1;
153  this->Level = -1;
154 
155  // default DirectionAnnotation
156  this->DirectionAnnotationMatrix[0][0] = "R";
157  this->DirectionAnnotationMatrix[0][1] = "L";
158  this->DirectionAnnotationMatrix[1][0] = "A";
159  this->DirectionAnnotationMatrix[1][1] = "P";
160  this->DirectionAnnotationMatrix[2][0] = "V";
161  this->DirectionAnnotationMatrix[2][1] = "D";
162 }
163 
164 //----------------------------------------------------------------------------
165 void vtkViewImage::SetInput(vtkImageData *in)
166 {
167  if ( in )
168  {
169  Superclass::SetInput(in);
170 
171  this->IsColor = ( in->GetNumberOfScalarComponents() > 1 );
172 
173  //multi channel
174  if ( this->IsColor )
175  {
176  this->ImageActor->SetInput(this->WindowLevel->GetOutput());
177  this->WindowLevel->SetLookupTable(NULL);
178  // because of rescaling
179  int type = in->GetScalarSize();
180  double threshold = pow((double)2, (int)8*type) - 1;
181  // reset window level in viewer!
182  this->WindowLevel->SetWindow(threshold);
183  this->WindowLevel->SetLevel(threshold/2);
184  this->ShowScalarBar = false;
185  this->ScalarBarActor->SetVisibility(this->ShowScalarBar);
186  }
187  // single channel
188  else
189  {
190  this->ImageActor->SetInput(this->WindowLevel->GetOutput());
191  this->WindowLevel->SetLookupTable(this->LookupTable);
192  this->WindowLevel->SetWindow(this->LookupTable->GetRange()[1] - this->LookupTable->GetRange()[0]);
193  this->WindowLevel->SetLevel(this->LookupTable->GetRange()[0] + (this->LookupTable->GetRange()[1]-this->LookupTable->GetRange()[0])/2);
194  this->SetWindow(this->LookupTable->GetRange()[0]);
195  this->SetLevel(this->LookupTable->GetRange()[1]);
196  }
197  }
198 }
199 
200 //----------------------------------------------------------------------------
202 {
203  this->OrientationTransform->SetInput(NULL);
204 
205  if ( this->OrientationMatrix )
206  {
207  this->OrientationMatrix->Delete();
208  }
209 
210  this->OrientationTransform->Delete();
211  this->TextProperty->Delete();
212  this->CornerAnnotation->Delete();
213  this->LookupTable->Delete();
214  this->ScalarBarActor->Delete();
215 }
216 
217 //----------------------------------------------------------------------------
218 void vtkViewImage::SetOrientationMatrix(vtkMatrix4x4 *matrix)
219 {
220  vtkSetObjectMacro2Body(OrientationMatrix, vtkMatrix4x4, matrix);
221  this->ImageActor->SetUserMatrix(this->OrientationMatrix);
222  this->OrientationTransform->SetInput(this->OrientationMatrix);
223 
224  this->UpdateOrientation();
225 }
226 
227 //----------------------------------------------------------------------------
228 void vtkViewImage::SetLookupTable(vtkLookupTable *lookuptable)
229 {
230  if ( lookuptable )
231  {
232  vtkSetObjectMacro2Body(LookupTable, vtkLookupTable, lookuptable);
233  this->WindowLevel->SetLookupTable(this->LookupTable);
234  this->ScalarBarActor->SetLookupTable(this->LookupTable);
235  }
236  else
237  {
238  this->ShowScalarBar = false;
239  this->ScalarBarActor->SetVisibility(this->ShowScalarBar);
240  }
241 }
242 
243 //----------------------------------------------------------------------------
244 void vtkViewImage::SetTextProperty(vtkTextProperty *textproperty)
245 {
246  vtkSetObjectMacro2Body (TextProperty, vtkTextProperty, textproperty);
247  this->CornerAnnotation->SetTextProperty (this->TextProperty);
248 }
249 
250 //----------------------------------------------------------------------------
252 {
253  double t = s;
254 
255  if ( t < 0. )
256  {
257  t = 1.;
258  }
259 
260  Superclass::SetColorWindow(t);
261 
262  if ( !this->IsColor )
263  {
264  double level = this->GetColorLevel();
265  t *= 0.5;
266  double v_min = level - t;
267  double v_max = level + t;
268  this->LookupTable->SetRange (v_min, v_max);
269  }
270  else
271  {
272  this->ShowScalarBar = false;
273  this->ScalarBarActor->SetVisibility(this->ShowScalarBar);
274  }
275 }
276 
277 //----------------------------------------------------------------------------
279 {
280  Superclass::SetColorLevel(s);
281 
282  if ( !this->IsColor )
283  {
284  double t = 0.5 * this->GetColorWindow();
285  double v_min = s - t;
286  double v_max = s + t;
287  this->LookupTable->SetRange(v_min, v_max);
288  }
289  else
290  {
291  this->ShowScalarBar = false;
292  this->ScalarBarActor->SetVisibility(this->ShowScalarBar);
293  }
294 }
295 
296 //----------------------------------------------------------------------------
297 void vtkViewImage::SetWorldCoordinates(const double & x,
298  const double & y, const double & z)
299 {
300  double pos[3] = { x, y, z };
301 
302  this->SetWorldCoordinates(pos);
303 }
304 
305 //----------------------------------------------------------------------------
306 double vtkViewImage::GetValueAtPosition(double worldcoordinates[3],
307  int component)
308 {
309 // by default, value = 0.0
310  double value = 0.0;
311 
312  if ( !this->GetInput() )
313  {
314  return value;
315  }
316 
317  int *indices =
318  this->GetImageCoordinatesFromWorldCoordinates(worldcoordinates);
319  vtkImageData *input = this->GetInput();
320 
321  int *extent = input->GetWholeExtent();
322 
323  if ( !( ( indices[0] < extent[0] ) || ( indices[0] > extent[1] )
324  || ( indices[1] < extent[2] ) || ( indices[1] > extent[3] )
325  || ( indices[2] < extent[4] ) || ( indices[2] > extent[5] ) ) )
326  {
327  value = input->GetScalarComponentAsDouble(indices[0], indices[1],
328  indices[2], component);
329  }
330  // have to free the indices array allocated by
331  // GetImageCoordinatesFromWorldCoordinates
332  delete[] indices;
333 
334  return value;
335 }
336 //----------------------------------------------------------------------------
337 
338 //----------------------------------------------------------------------------
340 {
341  vtkImageData *input = this->GetInput();
342 
343  if ( !input )
344  {
345  double *nullpos = new double[3];
346  nullpos[0] = 0.;
347  nullpos[1] = 0.;
348  nullpos[2] = 0.;
349  return nullpos;
350  }
351 
352  // Get information
353  double *spacing = input->GetSpacing();
354  double *origin = input->GetOrigin();
355 
356  double unorientedposition[4];
357  for ( unsigned int i = 0; i < 3; i++ )
358  {
359  unorientedposition[i] = origin[i] + spacing[i] * indices[i];
360  }
361  unorientedposition[3] = 1;
362 
363  // apply orientation matrix
364  double *position = new double[4];
365  this->GetOrientationMatrix()->MultiplyPoint(unorientedposition, position);
366 
367  return position;
368 }
369 
370 //----------------------------------------------------------------------------
371 
372 //----------------------------------------------------------------------------
375 {
376  vtkImageData *input = this->GetInput();
377 
378  if ( !input )
379  {
380  int *nullpos = new int[3];
381  nullpos[0] = 0;
382  nullpos[1] = 0;
383  nullpos[2] = 0;
384  return nullpos;
385  }
386 
387  // Get information
388  double unorientedposition[4] = { position[0], position[1], position[2], 1 };
389  double spacing[4] = { input->GetSpacing()[0],
390  input->GetSpacing()[1],
391  input->GetSpacing()[2],
392  0 };
393  double origin[4] = { input->GetOrigin()[0],
394  input->GetOrigin()[1],
395  input->GetOrigin()[2],
396  1 };
397 
398  // apply inverted orientation matrix to the world-coordinate position
399  vtkSmartPointer< vtkMatrix4x4 > inverse = vtkSmartPointer< vtkMatrix4x4 >::New();
400  vtkMatrix4x4::Invert (this->GetOrientationMatrix(), inverse);
401  inverse->MultiplyPoint (unorientedposition, unorientedposition);
402 
403  int *indices = new int[3];
404  for ( unsigned int i = 0; i < 3; i++ )
405  {
406  if ( fabs (spacing[i]) > 1e-5 )
407  {
408  indices[i] = vtkMath::Round( ( unorientedposition[i] - origin[i] ) / spacing[i] );
409  }
410  else
411  {
412  indices[i] = 0;
413  }
414  }
415  return indices;
416 }
417 
418 //----------------------------------------------------------------------------
419 void vtkViewImage::SetBackground(double rgb[3])
420 {
421  if ( this->Renderer )
422  {
423  this->Renderer->SetBackground(rgb);
424  }
425 }
426 
427 //----------------------------------------------------------------------------
428 void vtkViewImage::SetBackground(const double & r, const double & g, const double & b)
429 {
430  if ( this->Renderer )
431  {
432  this->Renderer->SetBackground(r, g, b);
433  }
434 }
435 
436 //----------------------------------------------------------------------------
438 {
439  if ( this->Renderer )
440  {
441  return this->Renderer->GetBackground();
442  }
443  else
444  {
445  return NULL;
446  }
447 }
448 
449 //----------------------------------------------------------------------------
451 {
452  vtkImageData *input = this->GetInput();
453 
454  if ( !input )
455  {
456  return;
457  }
458 
459  if ( !this->IsColor )
460  {
461  double *range = input->GetScalarRange();
462  double window = range[1] - range[0];
463  double level = 0.5 * ( range[1] + range[0] );
464 
465  this->SetColorWindow(window);
466  this->SetColorLevel(level);
467  }
468 }
469 
470 //----------------------------------------------------------------------------
472 {
473  if (this->IsColor)
474  return;
475 
476  if ( LookupTable )
477  {
478  double *range = LookupTable->GetRange();
479  double window = range[1] - range[0];
480  double level = 0.5 * ( range[1] + range[0] );
481 
482  this->SetColorWindow(window);
483  this->SetColorLevel(level);
484  }
485  else
486  {
487  this->SetColorWindow(0);
488  this->SetColorLevel(0);
489  }
490 }
491 
492 //----------------------------------------------------------------------------
494 {
495  if ( this->Renderer )
496  {
497  this->Renderer->ResetCamera();
498  }
499 }
500 
501 //----------------------------------------------------------------------------
503 {
504  this->Update();
505  this->ResetWindowLevel();
506  this->ResetCamera();
507 }
508 
509 //----------------------------------------------------------------------------
511 {
512  this->Interactor->Enable();
513 }
514 
515 //----------------------------------------------------------------------------
517 {
518  this->Interactor->Disable();
519 }
520 
521 //----------------------------------------------------------------------------
523 {
524  return ( this->Interactor->GetEnabled() == 1 );
525 }
526 
527 //----------------------------------------------------------------------------
528 void vtkViewImage::SetShowScalarBar(const bool & val)
529 {
530  if ( !this->IsColor )
531  {
532  this->ShowScalarBar = val;
533  this->ScalarBarActor->SetVisibility(val);
534  }
535  else
536  {
537  this->ShowScalarBar = false;
538  this->ScalarBarActor->SetVisibility(this->ShowScalarBar);
539  }
540 }
541 
542 //----------------------------------------------------------------------------
543 
544 //----------------------------------------------------------------------------
546 {
547  if ( this->RenderWindow && !this->RenderWindow->GetNeverRendered() )
548  {
549  if ( this->FirstRender )
550  {
551  this->ResetCamera();
552  this->FirstRender = 0;
553  }
554  }
555 
556  if ( this->GetInput() )
557  {
558  this->RenderWindow->Render();
559  }
560 }
561 
562 //----------------------------------------------------------------------------
563 vtkRenderWindowInteractor * vtkViewImage::GetInteractor()
564 {
565  return this->Interactor;
566 }
567 
568 //----------------------------------------------------------------------------
569 vtkRenderWindowInteractor * vtkViewImage::GetRenderWindowInteractor()
570 {
571  if ( this->GetRenderWindow() )
572  {
573  return this->GetRenderWindow()->GetInteractor();
574  }
575  else
576  {
577  return static_cast< vtkRenderWindowInteractor * >( 0x0 );
578  }
579 }
580 
581 //----------------------------------------------------------------------------
583 {
584  if ( this->Renderer )
585  {
586  vtkCamera *cam = this->Renderer->GetActiveCamera();
587  if ( cam )
588  {
589  cam->SetPosition (arg);
590  }
591  }
592 }
593 
595 {
596  if ( this->Renderer )
597  {
598  vtkCamera *cam = this->Renderer->GetActiveCamera();
599  if ( cam )
600  {
601  return cam->GetPosition ();
602  }
603  }
604 
605  return static_cast< double * >( 0x0 );
606 }
607 
608 //----------------------------------------------------------------------------
610 {
611  if ( this->Renderer )
612  {
613  vtkCamera *cam = this->Renderer->GetActiveCamera();
614  if ( cam )
615  {
616  cam->SetFocalPoint (arg);
617  }
618  }
619 }
620 
621 //----------------------------------------------------------------------------
623 {
624  if ( this->Renderer )
625  {
626  vtkCamera *cam = this->Renderer->GetActiveCamera();
627  if ( cam )
628  {
629  return cam->GetFocalPoint ();
630  }
631  }
632  return static_cast< double * >( 0x0 );
633 }
634 
635 //----------------------------------------------------------------------------
637 {
638  if ( this->Renderer )
639  {
640  vtkCamera *cam = this->Renderer->GetActiveCamera();
641  if ( cam )
642  {
643  cam->SetViewUp (arg);
644  }
645  }
646 }
647 
648 //----------------------------------------------------------------------------
650 {
651  if ( this->Renderer )
652  {
653  vtkCamera *cam = this->Renderer->GetActiveCamera();
654 
655  if ( cam )
656  {
657  return cam->GetViewUp();
658  }
659  }
660  return static_cast< double * >( 0x0 );
661 }
662 
663 //----------------------------------------------------------------------------
665 {
666  if ( this->Renderer )
667  {
668  vtkCamera *cam = this->Renderer->GetActiveCamera();
669 
670  if ( cam )
671  {
672  cam->SetParallelScale (arg);
673  }
674  }
675 }
676 
677 //----------------------------------------------------------------------------
679 {
680  if ( this->Renderer )
681  {
682  vtkCamera *cam = this->Renderer->GetActiveCamera();
683 
684  if ( cam )
685  {
686  return cam->GetParallelScale();
687  }
688  }
689 
690  return 0.;
691 }
692 
693 //----------------------------------------------------------------------------
694 void vtkViewImage::SetShowAnnotations(const int & iShowAnnotations)
695 {
696  this->ShowAnnotations = iShowAnnotations;
697  this->CornerAnnotation->SetVisibility (iShowAnnotations);
698 }
699 //----------------------------------------------------------------------------
700 void
701 vtkViewImage::SetWindow(double iWindow)
702 {
703  this->Window = iWindow;
704 }
705 
706 //----------------------------------------------------------------------------
707 double
709 {
710  return this->Window;
711 }
712 
713 //----------------------------------------------------------------------------
714 void
716 {
717  this->Level = iLevel;
718 }
719 
720 //----------------------------------------------------------------------------
721 double
723 {
724  return this->Level;
725 }
float IntersectionLineWidth
Definition: vtkViewImage.h:554
virtual void SetColorLevel(double s)
virtual void SetShowAnnotations(const int &iShowAnnotations)
Change the visibility of the annotations.
virtual bool GetEnabled(void)
Enable or Disable interaction on the view.
virtual double * GetWorldCoordinatesFromImageCoordinates(int indices[3])
Convert an indices coordinate point (image coordinates) into a world coordinate point.
vtkTextProperty * TextProperty
Definition: vtkViewImage.h:535
void SetLevel(double iLevel)
void SetWindow(double iWindow)
virtual double GetValueAtPosition(double worldcoordinates[3], int component=0)
Get the pixel value at a given world coordinate point in space, return zero if out of bounds...
void SetWorldCoordinates(const double &x, const double &y, const double &z)
Set the world coordinates.
virtual void Disable(void)
Enable or Disable interaction on the view.
virtual void ResetWindowLevel(void)
Reset the window level.
double * GetCameraPosition(void)
Get the camera position.
virtual int * GetImageCoordinatesFromWorldCoordinates(double position[3])
Convert a world coordinate point into an image indices coordinate point.
double GetLevel()
virtual void Enable(void)
Enable or Disable interaction on the view.
double GetCameraParallelScale(void)
Get the camera parallel scale.
std::string DirectionAnnotationMatrix[3][2]
Definition: vtkViewImage.h:552
vtkScalarBarActor * ScalarBarActor
Definition: vtkViewImage.h:545
void SetCameraPosition(double *arg)
Set the camera position.
virtual void SetLookupTable(vtkLookupTable *lookuptable)
virtual void SetBackground(double rgb[3])
Set the background color. Format is RGB, 0 <= R,G,B <=1 Example: SetBackground(0.9,0.9,0.9) for grey-white.
void SetCameraViewUp(double *arg)
Set the camera view up.
double * GetCameraFocalPoint(void)
Get the camera focal point.
virtual void SetOrientationMatrix(vtkMatrix4x4 *matrix)
virtual void SetInput(vtkImageData *input)
virtual vtkRenderWindowInteractor * GetRenderWindowInteractor()
This class is a top-level convenience class for displaying a scalar - or RGB image in a 2D or 3D scen...
Definition: vtkViewImage.h:183
virtual double * GetBackground(void)
virtual void Reset(void)
Reset position - zoom - window/level to default.
virtual void Update(void)
Definition: vtkViewImage.h:302
vtkMatrix4x4 * OrientationMatrix
Definition: vtkViewImage.h:523
virtual void Render(void)
virtual void SetTextProperty(vtkTextProperty *textproperty)
virtual void SetShowScalarBar(const bool &)
Show/Hide scalar bar.
vtkMatrixToLinearTransform * OrientationTransform
Definition: vtkViewImage.h:550
vtkCornerAnnotation * CornerAnnotation
Definition: vtkViewImage.h:530
virtual vtkRenderWindowInteractor * GetInteractor()
double * GetCameraViewUp(void)
Get the camera view up.
vtkLookupTable * LookupTable
Definition: vtkViewImage.h:540
double GetWindow()
void SetCameraFocalPoint(double *arg)
Set the camera focal point.
#define vtkSetObjectMacro2Body(object, type, _arg)
Definition: vtkViewImage.h:89
virtual void SetColorWindow(double s)
Set window and level for mapping pixels to colors.
vtkCxxRevisionMacro(vtkViewImage,"$Revision: 546 $")
void SetCameraParallelScale(double arg)
Set the camera parallel scale.
void UpdateWindowLevel()
virtual void ResetCamera(void)
Reset the camera.