1 #include "VolumeActors.h"
5 #include <vtkAlgorithmOutput.h>
6 #include <vtkImageData.h>
7 #include <vtkInformation.h>
8 #include <vtkLookupTable.h>
10 #include <vtkProperty.h>
11 #include <vtkRenderer.h>
12 #include <vtkRendererCollection.h>
13 #include <vtkRenderWindow.h>
14 #include <vtkRenderWindowInteractor.h>
15 #include <vtkStreamingDemandDrivenPipeline.h>
16 #include <vtkTextProperty.h>
18 #include <vtkOrientedGlyphContourRepresentation.h>
19 #include <vtkContourWidget.h>
22 // -------------------------------------------------------------------------
23 idms::VolumeActors::SliceActor::
26 this->SliceMapper = vtkSmartPointer< vtkImageSliceMapper >::New( );
27 this->PlaneSource = vtkSmartPointer< vtkPlaneSource >::New( );
28 this->PlaneMapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
29 this->PlaneActor = vtkSmartPointer< vtkActor >::New( );
30 this->ImageActor = vtkSmartPointer< vtkImageActor >::New( );
31 this->TextActor = vtkSmartPointer< vtkTextActor >::New( );
32 this->RegionCutterPlane = vtkSmartPointer< vtkPlane >::New( );
34 this->PlaneSource->SetXResolution( 1 );
35 this->PlaneSource->SetYResolution( 1 );
37 SetInputConnection( this->PlaneSource->GetOutputPort( ) );
38 this->PlaneActor->SetMapper( this->PlaneMapper );
40 this->TextActor->SetTextScaleModeToNone( );
41 vtkTextProperty* textprop = this->TextActor->GetTextProperty( );
42 textprop->SetColor( 1, 1, 1 );
43 textprop->SetFontFamilyToCourier( );
44 textprop->SetFontSize( 18 );
46 textprop->ItalicOff( );
47 textprop->ShadowOff( );
48 textprop->SetJustificationToLeft( );
49 textprop->SetVerticalJustificationToBottom( );
50 vtkCoordinate* coord = this->TextActor->GetPositionCoordinate( );
51 coord->SetCoordinateSystemToNormalizedViewport( );
52 coord->SetValue( 0.01, 0.01 );
55 // -------------------------------------------------------------------------
56 void idms::VolumeActors::SliceActor::
57 Configure( vtkAlgorithmOutput* aout, int axis )
59 this->SliceMapper->SetInputConnection( aout );
60 this->SliceMapper->SetOrientation( axis );
61 this->ImageActor->SetMapper( this->SliceMapper );
62 this->ImageActor->Modified( );
65 // -------------------------------------------------------------------------
66 void idms::VolumeActors::SliceActor::
67 ConfigureRegion( vtkAlgorithmOutput* aout )
69 this->RegionCutter = vtkSmartPointer< vtkCutter >::New( );
70 this->RegionCutterMapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
71 this->RegionCutterActor = vtkSmartPointer< vtkActor >::New( );
73 this->RegionCutter->SetInputConnection( aout );
74 this->RegionCutter->SetCutFunction( this->RegionCutterPlane );
75 this->RegionCutterMapper->
76 SetInputConnection( this->RegionCutter->GetOutputPort( ) );
77 this->RegionCutterActor->SetMapper( this->RegionCutterMapper );
78 this->RegionCutterActor->GetProperty( )->SetColor( 0, 0, 1 );
81 // -------------------------------------------------------------------------
82 void idms::VolumeActors::SliceActor::
83 SetSegmentation( vtkAlgorithmOutput* aout )
85 this->SegmentationSliceMapper =
86 vtkSmartPointer< vtkImageSliceMapper >::New( );
87 this->SegmentationSliceMapper->SetInputConnection( aout );
88 this->SegmentationSliceMapper->
89 SetOrientation( this->SliceMapper->GetOrientation( ) );
90 this->SegmentationSliceMapper->
91 SetSliceNumber( this->SliceMapper->GetSliceNumber( ) );
93 this->SegmentationActor = vtkSmartPointer< vtkImageActor >::New( );
94 this->SegmentationActor->SetMapper( this->SegmentationSliceMapper );
95 this->SegmentationActor->Modified( );
98 // -------------------------------------------------------------------------
99 void idms::VolumeActors::SliceActor::
100 SetSliceNumber( const int& slice )
102 this->SliceMapper->SetSliceNumber( slice );
103 this->SliceMapper->Update( );
104 if( this->SegmentationSliceMapper.GetPointer( ) != NULL )
106 this->SegmentationSliceMapper->SetSliceNumber( slice );
107 this->SegmentationSliceMapper->Update( );
112 vtkAlgorithm* algo = this->SliceMapper->GetInputAlgorithm( );
113 vtkInformation* info = algo->GetOutputInformation( 0 );
115 double ori[ 3 ], spac[ 3 ], pos[ 3 ];
116 info->Get( vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT( ), ext );
117 info->Get( vtkDataObject::ORIGIN( ), ori );
118 info->Get( vtkDataObject::SPACING( ), spac );
119 this->SliceMapper->GetSlicePlane( )->GetOrigin( pos );
121 // Prevent obscuring voxels by offsetting the plane geometry
124 ori[ 0 ] + ( spac[ 0 ] * double( ext[ 0 ] ) ),
125 ori[ 0 ] + ( spac[ 0 ] * double( ext[ 1 ] ) )
129 ori[ 1 ] + ( spac[ 1 ] * double( ext[ 2 ] ) ),
130 ori[ 1 ] + ( spac[ 1 ] * double( ext[ 3 ] ) )
134 ori[ 2 ] + ( spac[ 2 ] * double( ext[ 4 ] ) ),
135 ori[ 2 ] + ( spac[ 2 ] * double( ext[ 5 ] ) )
138 if( spac[ 0 ] < double( 0 ) )
140 double t = xbnds[ 0 ];
141 xbnds[ 0 ] = xbnds[ 1 ];
145 if( spac[ 1 ] < double( 0 ) )
147 double t = ybnds[ 0 ];
148 ybnds[ 0 ] = ybnds[ 1 ];
152 if( spac[ 2 ] < double( 0 ) )
154 double t = zbnds[ 0 ];
155 zbnds[ 0 ] = zbnds[ 1 ];
160 int axis = this->SliceMapper->GetOrientation( );
161 this->PlaneActor->GetProperty( )->SetRepresentationToWireframe( );
162 this->PlaneActor->GetProperty( )->SetLineWidth( 2 );
163 if( axis == 0 ) // YZ, x-normal
165 this->PlaneSource->SetOrigin( pos[ 0 ], ybnds[ 0 ], zbnds[ 0 ]);
166 this->PlaneSource->SetPoint1( pos[ 0 ], ybnds[ 1 ], zbnds[ 0 ] );
167 this->PlaneSource->SetPoint2( pos[ 0 ], ybnds[ 0 ], zbnds[ 1 ] );
168 this->PlaneActor->GetProperty( )->SetColor( 1, 0, 0 );
170 this->RegionCutterPlane->SetOrigin( pos[ 0 ], ybnds[ 0 ], zbnds[ 0 ]);
171 this->RegionCutterPlane->SetNormal( 1, 0, 0 );
173 else if( axis == 1 ) // ZX, y-normal
175 this->PlaneSource->SetOrigin( xbnds[ 0 ], pos[ 1 ], zbnds[ 0 ] );
176 this->PlaneSource->SetPoint1( xbnds[ 0 ], pos[ 1 ], zbnds[ 1 ] );
177 this->PlaneSource->SetPoint2( xbnds[ 1 ], pos[ 1 ], zbnds[ 0 ] );
178 this->PlaneActor->GetProperty( )->SetColor( 0, 1, 0 );
180 this->RegionCutterPlane->SetOrigin( xbnds[ 0 ], pos[ 1 ], zbnds[ 0 ] );
181 this->RegionCutterPlane->SetNormal( 0, 1, 0 );
185 this->PlaneSource->SetOrigin( xbnds[ 0 ], ybnds[ 0 ], pos[ 2 ] );
186 this->PlaneSource->SetPoint1( xbnds[ 1 ], ybnds[ 0 ], pos[ 2 ] );
187 this->PlaneSource->SetPoint2( xbnds[ 0 ], ybnds[ 1 ], pos[ 2 ] );
188 this->PlaneActor->GetProperty( )->SetColor( 0, 0, 1 );
190 this->RegionCutterPlane->SetOrigin( xbnds[ 0 ], ybnds[ 0 ], pos[ 2 ] );
191 this->RegionCutterPlane->SetNormal( 0, 0, 1 );
195 this->RegionCutter->Modified( );
196 this->RegionCutterMapper->Modified( );
197 this->RegionCutterActor->Modified( );
200 // -------------------------------------------------------------------------
201 void idms::VolumeActors::SliceActor::
202 UpdateText( const double& w, const double& l )
205 if ( this->SliceMapper->GetOrientation( ) == 0 ) axis = 'X';
206 else if( this->SliceMapper->GetOrientation( ) == 1 ) axis = 'Y';
207 else if( this->SliceMapper->GetOrientation( ) == 2 ) axis = 'Z';
210 this->TextBuffer, "Axis: %c (%d)\nWin/Lev: %.2f/%.2f",
211 axis, this->SliceMapper->GetSliceNumber( ), w, l
213 this->TextActor->SetInput( this->TextBuffer );
214 this->TextActor->Modified( );
217 // -------------------------------------------------------------------------
218 idms::VolumeActors* idms::VolumeActors::
221 return( new Self( ) );
224 // -------------------------------------------------------------------------
225 void idms::VolumeActors::
228 vtkRenderWindowInteractor* xi,
229 vtkRenderWindowInteractor* yi,
230 vtkRenderWindowInteractor* zi
233 if( image == NULL || xi == NULL || yi == NULL || zi == NULL )
234 vtkErrorMacro( "At least one object is \"NULL\"" );
237 this->Interactors[ 0 ] = xi;
238 this->Interactors[ 1 ] = yi;
239 this->Interactors[ 2 ] = zi;
241 this->ImageToWindowLevel->SetInputData( this->Image );
242 this->ResetWindowLevel( );
243 this->ImageToWindowLevel->Update( );
246 this->ImageOutlineSource =
247 vtkSmartPointer< vtkOutlineSource >::New( );
248 vtkSmartPointer< vtkPolyDataMapper > img_ol_mapper =
249 vtkSmartPointer< vtkPolyDataMapper >::New( );
250 this->ImageOutlineSource->SetBounds( this->Image->GetBounds( ) );
251 img_ol_mapper->SetInputConnection(
252 this->ImageOutlineSource->GetOutputPort( )
254 this->ImageOutlineIndex = this->GetNumberOfItems( );
255 vtkSmartPointer< vtkActor > img_ol_actor =
256 vtkSmartPointer< vtkActor >::New( );
257 img_ol_actor->SetMapper( img_ol_mapper );
258 img_ol_actor->GetProperty( )->SetColor( 1, 1, 1 );
259 img_ol_actor->GetProperty( )->SetLineWidth( 1 );
260 this->AddItem( img_ol_actor );
264 image->GetSpacing( spac );
265 double radius = spac[ 0 ];
266 radius = ( spac[ 1 ] < radius )? spac[ 1 ]: radius;
267 radius = ( spac[ 2 ] < radius )? spac[ 2 ]: radius;
268 radius *= double( 6 );
269 this->Cursor->SetRadius( radius );
270 this->CursorMapper->Modified( );
271 this->CursorActor->Modified( );
274 for( int a = 0; a < 3; ++a )
277 this->Planes[ a ].Configure( this->ImageToWindowLevel->GetOutputPort( ), a );
278 this->Planes[ a ].ConfigureRegion( this->Region->GetOutputPort( ) );
279 this->Planes[ a ].UpdateText( this->GetWindow( ), this->GetLevel( ) );
281 // Add them to renderer
282 vtkRenderer* ren = this->Interactors[ a ]->GetRenderWindow( )->
283 GetRenderers( )->GetFirstRenderer( );
285 vtkErrorMacro( "At least one interactor doesn't have a valid renderer" );
286 ren->AddActor( this->Planes[ a ].ImageActor );
287 ren->AddActor( this->Planes[ a ].TextActor );
289 for( int i = 0; i < 3; ++i )
290 this->Interactors[ a ]->GetRenderWindow( )->
291 GetRenderers( )->GetFirstRenderer( )->
292 AddActor( this->Planes[ i ].PlaneActor );
296 // Keep track into collection
298 this->XPlaneIndex = this->GetNumberOfItems( );
299 this->AddItem( this->Planes[ 0 ].ImageActor.GetPointer( ) );
300 this->XTextIndex = this->GetNumberOfItems( );
301 this->AddItem( this->Planes[ 0 ].TextActor.GetPointer( ) );
302 this->XBoundsIndex = this->GetNumberOfItems( );
303 this->AddItem( this->Planes[ 0 ].PlaneActor.GetPointer( ) );
305 this->YPlaneIndex = this->GetNumberOfItems( );
306 this->AddItem( this->Planes[ 1 ].ImageActor.GetPointer( ) );
307 this->YTextIndex = this->GetNumberOfItems( );
308 this->AddItem( this->Planes[ 1 ].TextActor.GetPointer( ) );
309 this->YBoundsIndex = this->GetNumberOfItems( );
310 this->AddItem( this->Planes[ 1 ].PlaneActor.GetPointer( ) );
312 this->ZPlaneIndex = this->GetNumberOfItems( );
313 this->AddItem( this->Planes[ 2 ].ImageActor.GetPointer( ) );
314 this->ZTextIndex = this->GetNumberOfItems( );
315 this->AddItem( this->Planes[ 2 ].TextActor.GetPointer( ) );
316 this->ZBoundsIndex = this->GetNumberOfItems( );
317 this->AddItem( this->Planes[ 2 ].PlaneActor.GetPointer( ) );
319 // Initialize slice visualization
320 this->ResetSlices( );
323 #error CONTOUR_WIDGET <- ACA VOY
324 static vtkSmartPointer<vtkOrientedGlyphContourRepresentation> contourRep =
325 vtkSmartPointer<vtkOrientedGlyphContourRepresentation>::New();
326 static vtkSmartPointer<vtkContourWidget> contourWidget =
327 vtkSmartPointer<vtkContourWidget>::New();
328 contourWidget->SetInteractor( zi );
329 contourWidget->SetRepresentation( contourRep );
330 contourWidget->On( );
343 // -------------------------------------------------------------------------
344 void idms::VolumeActors::
345 SetSegmentation( vtkImageData* segmentation )
348 this->Segmentation = segmentation;
349 this->Segmentation->GetScalarRange( range );
351 vtkSmartPointer< vtkLookupTable > lut =
352 vtkSmartPointer< vtkLookupTable >::New( );
353 lut->SetNumberOfTableValues( 2 );
354 lut->SetTableRange( range );
355 lut->SetTableValue( 0, 0, 0, 0, 0 );
356 lut->SetTableValue( 1, 1, 0, 0, 0.4 );
358 this->SegmentationToColors->SetInputData( this->Segmentation );
359 this->SegmentationToColors->SetLookupTable( lut );
360 this->SegmentationToColors->Update( );
362 for( unsigned int a = 0; a < 3; ++a )
364 this->Planes[ a ].SetSegmentation(
365 this->SegmentationToColors->GetOutputPort( )
367 vtkRenderer* ren = this->Interactors[ a ]->GetRenderWindow( )->
368 GetRenderers( )->GetFirstRenderer( );
369 ren->AddActor( this->Planes[ a ].SegmentationActor );
375 // -------------------------------------------------------------------------
376 void idms::VolumeActors::
377 AddAuxiliaryInteractor( vtkRenderWindowInteractor* i )
381 this->AuxiliaryInteractors.insert( i );
387 // -------------------------------------------------------------------------
388 double idms::VolumeActors::
389 GetMinWindow( ) const
391 return( double( 0.01 ) );
394 // -------------------------------------------------------------------------
395 double idms::VolumeActors::
396 GetMaxWindow( ) const
398 if( this->Image == NULL )
399 return( double( 0 ) );
402 this->Image->GetScalarRange( range );
403 return( range[ 1 ] - range[ 0 ] );
406 // -------------------------------------------------------------------------
407 double idms::VolumeActors::
410 if( this->Image == NULL )
411 return( double( 0 ) );
414 this->Image->GetScalarRange( range );
415 return( range[ 0 ] );
418 // -------------------------------------------------------------------------
419 double idms::VolumeActors::
422 if( this->Image == NULL )
423 return( double( 0 ) );
426 this->Image->GetScalarRange( range );
427 return( range[ 1 ] );
430 // -------------------------------------------------------------------------
431 double idms::VolumeActors::
434 return( this->ImageToWindowLevel->GetWindow( ) );
437 // -------------------------------------------------------------------------
438 double idms::VolumeActors::
441 return( this->ImageToWindowLevel->GetLevel( ) );
444 // -------------------------------------------------------------------------
445 void idms::VolumeActors::
446 SetWindow( const double& w )
448 this->ImageToWindowLevel->SetWindow( w );
451 // -------------------------------------------------------------------------
452 void idms::VolumeActors::
453 SetLevel( const double& l )
455 this->ImageToWindowLevel->SetLevel( l );
458 // -------------------------------------------------------------------------
459 void idms::VolumeActors::
460 SetWindowLevel( const double& w, const double& l )
462 this->ImageToWindowLevel->SetWindow( w );
463 this->ImageToWindowLevel->SetLevel( l );
464 for( int a = 0; a < 3; ++a )
465 this->Planes[ a ].UpdateText( w, l );
468 // -------------------------------------------------------------------------
469 void idms::VolumeActors::
473 this->Image->GetScalarRange( range );
474 this->SetWindowLevel(
475 range[ 1 ] - range[ 0 ],
476 ( ( range[ 1 ] + range[ 0 ] ) / double( 2 ) ) + range[ 0 ]
480 // -------------------------------------------------------------------------
481 vtkPlane* idms::VolumeActors::
482 GetSlicePlane( const int& axis ) const
484 return( this->Planes[ axis ].SliceMapper->GetSlicePlane( ) );
487 // -------------------------------------------------------------------------
488 int idms::VolumeActors::
489 GetSliceNumberMinValue( const int& axis ) const
491 return( this->Planes[ axis ].SliceMapper->GetSliceNumberMinValue( ) );
494 // -------------------------------------------------------------------------
495 int idms::VolumeActors::
496 GetSliceNumberMaxValue( const int& axis ) const
498 return( this->Planes[ axis ].SliceMapper->GetSliceNumberMaxValue( ) );
501 // -------------------------------------------------------------------------
502 int idms::VolumeActors::
503 GetSlice( const int& axis ) const
505 return( this->Planes[ axis ].SliceMapper->GetSliceNumber( ) );
508 // -------------------------------------------------------------------------
509 void idms::VolumeActors::
510 SetSlice( const int& axis, const int& slice )
512 this->Planes[ axis ].SetSliceNumber( slice );
513 this->Planes[ axis ].UpdateText( this->GetWindow( ), this->GetLevel( ) );
514 this->RenderAuxiliaryInteractors( );
517 // -------------------------------------------------------------------------
518 void idms::VolumeActors::
519 SetSlice( const int& axis, const double& slice )
522 this->Planes[ axis ].SliceMapper->GetInputAlgorithm( );
523 vtkInformation* info = algo->GetOutputInformation( 0 );
525 double ori[ 3 ], spac[ 3 ];
526 info->Get( vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT( ), ext );
527 info->Get( vtkDataObject::ORIGIN( ), ori );
528 info->Get( vtkDataObject::SPACING( ), spac );
531 int( ( slice - ori[ axis ] ) / spac[ axis ] ) + ext[ axis << 1 ]
535 // -------------------------------------------------------------------------
536 void idms::VolumeActors::
539 for( int a = 0; a < 3; ++a )
540 this->SetSlice( a, this->GetSliceNumberMinValue( a ) );
544 // -------------------------------------------------------------------------
545 void idms::VolumeActors::
546 AddSeed( int idx[ 3 ] )
548 this->Seeds.push_back( std::vector< int >( idx, idx + 3 ) );
552 // -------------------------------------------------------------------------
553 void idms::VolumeActors::
554 AddSeed( double pos[ 3 ] )
557 this->Seeds.push_back( std::vector< double >( pos, pos + 3 ) );
562 // -------------------------------------------------------------------------
563 unsigned int idms::VolumeActors::
564 GetNumberOfSeeds( ) const
566 return( this->Seeds.size( ) );
569 // -------------------------------------------------------------------------
570 void idms::VolumeActors::
571 GetSeed( unsigned int i, int idx[ 3 ] ) const
573 if( i < this->Seeds.size( ) )
575 idx[ 0 ] = this->Seeds[ i ][ 0 ];
576 idx[ 1 ] = this->Seeds[ i ][ 1 ];
577 idx[ 2 ] = this->Seeds[ i ][ 2 ];
582 // -------------------------------------------------------------------------
583 void idms::VolumeActors::
584 SetCursorPosition( double pos[ 3 ] )
586 this->Cursor->SetCenter( pos );
589 // -------------------------------------------------------------------------
590 void idms::VolumeActors::
593 vtkRenderer* ren = this->Interactors[ a ]->GetRenderWindow( )->
594 GetRenderers( )->GetFirstRenderer( );
595 ren->AddActor( this->Planes[ a ].RegionCutterActor );
598 // -------------------------------------------------------------------------
599 void idms::VolumeActors::
602 vtkRenderer* ren = this->Interactors[ a ]->GetRenderWindow( )->
603 GetRenderers( )->GetFirstRenderer( );
604 ren->RemoveActor( this->Planes[ a ].RegionCutterActor );
607 // -------------------------------------------------------------------------
608 void idms::VolumeActors::
609 SetRegionPosition( double pos[ 3 ] )
611 this->Region->SetCenter( pos );
614 // -------------------------------------------------------------------------
615 void idms::VolumeActors::
616 SetRegionRadius( double pos[ 3 ] )
620 this->Region->GetCenter( rpos );
621 double x = pos[ 0 ] - rpos[ 0 ];
622 double y = pos[ 1 ] - rpos[ 1 ];
623 double z = pos[ 2 ] - rpos[ 2 ];
624 double d = ( x * x ) + ( y * y ) + ( z * z );
625 if( double( 0 ) < d )
629 this->Region->SetRadius( d );
630 this->Planes[ 0 ].RegionCutter->Modified( );
631 this->Planes[ 1 ].RegionCutter->Modified( );
632 this->Planes[ 2 ].RegionCutter->Modified( );
633 this->Planes[ 0 ].RegionCutterMapper->Modified( );
634 this->Planes[ 1 ].RegionCutterMapper->Modified( );
635 this->Planes[ 2 ].RegionCutterMapper->Modified( );
636 this->Planes[ 0 ].RegionCutterActor->Modified( );
637 this->Planes[ 1 ].RegionCutterActor->Modified( );
638 this->Planes[ 2 ].RegionCutterActor->Modified( );
642 // -------------------------------------------------------------------------
643 void idms::VolumeActors::
644 GetImageBounds( double bounds[ 6 ] ) const
646 if( this->Image != NULL )
647 this->Image->GetBounds( bounds );
650 // -------------------------------------------------------------------------
651 void idms::VolumeActors::
654 for( int a = 0; a < 3; ++a )
655 if( this->Interactors[ a ] != NULL )
656 this->Interactors[ a ]->Render( );
659 // -------------------------------------------------------------------------
660 void idms::VolumeActors::
661 RenderAuxiliaryInteractors( )
664 TInteractors::iterator iIt = this->AuxiliaryInteractors.begin( );
665 iIt != this->AuxiliaryInteractors.end( );
671 // -------------------------------------------------------------------------
672 void idms::VolumeActors::
676 this->GetImageBounds( b );
677 for( int a = 0; a < 3; ++a )
679 if( this->Interactors[ a ] == NULL )
681 vtkRenderer* ren = this->Interactors[ a ]->GetRenderWindow( )->
682 GetRenderers( )->GetFirstRenderer( );
683 if( ren != NULL ) ren->ResetCamera( b );
688 // -------------------------------------------------------------------------
695 for( int a = 0; a < 3; ++a )
696 this->Interactors[ a ] = NULL;
698 this->ImageToWindowLevel =
699 vtkSmartPointer< vtkImageMapToWindowLevelColors >::New( );
700 this->ImageToWindowLevel->SetOutputFormatToLuminance( );
701 this->SegmentationToColors =
702 vtkSmartPointer< vtkImageMapToColors >::New( );
704 this->Cursor = vtkSmartPointer< vtkSphereSource >::New( );
705 this->CursorMapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
706 this->CursorActor = vtkSmartPointer< vtkActor >::New( );
708 this->Cursor->SetPhiResolution( 36 );
709 this->Cursor->SetThetaResolution( 36 );
710 this->CursorMapper->SetInputConnection( this->Cursor->GetOutputPort( ) );
711 this->CursorActor->SetMapper( this->CursorMapper );
712 this->CursorActor->GetProperty( )->SetColor( 1, 1, 0 );
713 this->CursorIndex = this->GetNumberOfItems( );
714 this->AddItem( this->CursorActor );
716 this->Region = vtkSmartPointer< vtkSphereSource >::New( );
717 this->RegionMapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
718 this->RegionActor = vtkSmartPointer< vtkActor >::New( );
720 this->Region->SetPhiResolution( 36 );
721 this->Region->SetThetaResolution( 36 );
722 this->RegionMapper->SetInputConnection( this->Region->GetOutputPort( ) );
723 this->RegionActor->SetMapper( this->RegionMapper );
724 this->RegionActor->GetProperty( )->SetColor( 0, 0, 1 );
725 this->RegionActor->GetProperty( )->SetOpacity( 0 );
726 this->RegionIndex = this->GetNumberOfItems( );
727 this->AddItem( this->RegionActor );
729 this->XPlaneIndex = this->GetNumberOfItems( );
730 this->AddItem( this->Planes[ 0 ].ImageActor.GetPointer( ) );
731 this->XTextIndex = this->GetNumberOfItems( );
732 this->AddItem( this->Planes[ 0 ].TextActor.GetPointer( ) );
733 this->XBoundsIndex = this->GetNumberOfItems( );
734 this->AddItem( this->Planes[ 0 ].PlaneActor.GetPointer( ) );
736 this->YPlaneIndex = this->GetNumberOfItems( );
737 this->AddItem( this->Planes[ 1 ].ImageActor.GetPointer( ) );
738 this->YTextIndex = this->GetNumberOfItems( );
739 this->AddItem( this->Planes[ 1 ].TextActor.GetPointer( ) );
740 this->YBoundsIndex = this->GetNumberOfItems( );
741 this->AddItem( this->Planes[ 1 ].PlaneActor.GetPointer( ) );
743 this->ZPlaneIndex = this->GetNumberOfItems( );
744 this->AddItem( this->Planes[ 2 ].ImageActor.GetPointer( ) );
745 this->ZTextIndex = this->GetNumberOfItems( );
746 this->AddItem( this->Planes[ 2 ].TextActor.GetPointer( ) );
747 this->ZBoundsIndex = this->GetNumberOfItems( );
748 this->AddItem( this->Planes[ 2 ].PlaneActor.GetPointer( ) );
751 // -------------------------------------------------------------------------