]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/Visualization/MPRActors.cxx
Widget integration (step 5/6): Just one step leftgit shortlog !
[cpPlugins.git] / lib / cpExtensions / Visualization / MPRActors.cxx
1 #include <cpExtensions/Visualization/MPRActors.h>
2
3 #include <vtkImageData.h>
4 #include <vtkRenderer.h>
5 #include <vtkRendererCollection.h>
6 #include <vtkRenderWindow.h>
7
8 // -------------------------------------------------------------------------
9 cpExtensions::Visualization::MPRActors*
10 cpExtensions::Visualization::MPRActors::
11 New( )
12 {
13   return( new Self( ) );
14 }
15
16 // -------------------------------------------------------------------------
17 cpExtensions::Visualization::
18 ImageSliceActors* cpExtensions::Visualization::MPRActors::
19 GetSliceActors( const int& i ) const
20 {
21   if( i < 3 )
22     return( this->Slices[ 0 ][ i ] );
23   else
24     return( NULL );
25 }
26
27 // -------------------------------------------------------------------------
28 int cpExtensions::Visualization::MPRActors::
29 AddInputConnection(
30   vtkAlgorithmOutput* aout, ImageSliceActors::LUTType lut
31   )
32 {
33   int N = this->Slices[ 0 ][ 0 ]->GetNumberOfImageActors( );
34   if( N == 0 )
35   {
36     this->Slices[ 0 ][ 0 ]->AddInputConnection( aout, 0, lut );
37     vtkImageMapToColors* imap = this->Slices[ 0 ][ 0 ]->GetImageMap( 0 );
38     for( unsigned int i = 0; i < 2; ++i )
39       for( unsigned int j = 0; j < 3; ++j )
40         if( i != 0 || j != 0 )
41           this->Slices[ i ][ j ]->AddInputConnection(
42             ( ( imap != NULL )? imap->GetOutputPort( ): aout ), j,
43             ImageSliceActors::LUTType_None
44             );
45   }
46   else
47   {
48     /*
49     // Check if the image share the same space
50     vtkImageData* ref_image = this->_Image( 0 );
51     vtkImageData* new_image =
52       vtkImageData::SafeDownCast(
53         aout->GetProducer( )->GetOutputInformation( 0 )->
54         Get( vtkDataObject::DATA_OBJECT( ) )
55         );
56     int ref_ext[ 6 ], new_ext[ 6 ];
57     ref_image->GetExtent( ref_ext );
58     new_image->GetExtent( new_ext );
59     if(
60       ref_ext[ 0 ] == new_ext[ 0 ] && ref_ext[ 1 ] == new_ext[ 1 ] &&
61       ref_ext[ 2 ] == new_ext[ 2 ] && ref_ext[ 3 ] == new_ext[ 3 ] &&
62       ref_ext[ 4 ] == new_ext[ 4 ] && ref_ext[ 5 ] == new_ext[ 5 ]
63       )
64     {
65       this->ImageMaps.push_back(
66         vtkSmartPointer< vtkImageMapToColors >::New( )
67         );
68       this->ImageMaps[ N ]->SetInputConnection( aout );
69       this->SetLookupTableToColor(
70         N, double( 1 ), double( 0 ), double( 0 )
71         );
72       this->_Update( N );
73       return( N );
74     }
75     else
76     N = -1;
77   */
78
79   } // fi
80   return( N );
81 }
82
83 // -------------------------------------------------------------------------
84 int cpExtensions::Visualization::MPRActors::
85 AddInputData( vtkImageData* image, ImageSliceActors::LUTType lut )
86 {
87   int N = this->Slices[ 0 ][ 0 ]->GetNumberOfImageActors( );
88   if( N == 0 )
89   {
90     this->Slices[ 0 ][ 0 ]->AddInputData( image, 0, lut );
91     vtkImageMapToColors* imap = this->Slices[ 0 ][ 0 ]->GetImageMap( 0 );
92     for( unsigned int i = 0; i < 2; ++i )
93       for( unsigned int j = 0; j < 3; ++j )
94         if( i != 0 || j != 0 )
95         {
96           if( imap != NULL )
97             this->Slices[ i ][ j ]->AddInputConnection(
98               imap->GetOutputPort( ), j,
99               ImageSliceActors::LUTType_None
100               );
101           else
102             this->Slices[ i ][ j ]->AddInputData(
103               image, j,
104               ImageSliceActors::LUTType_None
105               );
106         } // fi
107   }
108   else
109   {
110   } // fi
111   return( N );
112   /*
113   int N = this->ImageMaps.size( );
114   if( N == 0 )
115   {
116     this->ImageMaps.push_back(
117       vtkSmartPointer< vtkImageMapToColors >::New( )
118       );
119     this->ImageMaps[ 0 ]->SetInputData( image );
120     this->SetLookupTableToWindowLevel( 0 );
121     this->_Update( 0 );
122     this->ResetWindowLevel( 0 );
123     return( 0 );
124   }
125   else
126   {
127     // Check if the image share the same space
128     vtkImageData* ref_image = this->_Image( 0 );
129     vtkImageData* new_image = image;
130     int ref_ext[ 6 ], new_ext[ 6 ];
131     ref_image->GetExtent( ref_ext );
132     new_image->GetExtent( new_ext );
133     if(
134       ref_ext[ 0 ] == new_ext[ 0 ] && ref_ext[ 1 ] == new_ext[ 1 ] &&
135       ref_ext[ 2 ] == new_ext[ 2 ] && ref_ext[ 3 ] == new_ext[ 3 ] &&
136       ref_ext[ 4 ] == new_ext[ 4 ] && ref_ext[ 5 ] == new_ext[ 5 ]
137       )
138     {
139       this->ImageMaps.push_back(
140         vtkSmartPointer< vtkImageMapToColors >::New( )
141         );
142       this->ImageMaps[ N ]->SetInputData( image );
143       this->SetLookupTableToColor(
144         N, double( 1 ), double( 0 ), double( 0 )
145         );
146       this->_Update( N );
147       return( N );
148     }
149     else
150       return( -1 );
151
152   } // fi
153   */
154 }
155
156 // -------------------------------------------------------------------------
157 void cpExtensions::Visualization::MPRActors::
158 PushActorsInto(
159   vtkRenderWindow* x, vtkRenderWindow* y, vtkRenderWindow* z,
160   vtkRenderWindow* w
161   )
162 {
163   this->Slices[ 0 ][ 0 ]->PushActorsInto( x, true );
164   this->Slices[ 0 ][ 1 ]->PushActorsInto( y, true );
165   this->Slices[ 0 ][ 2 ]->PushActorsInto( z, true );
166
167   vtkRenderer* wren =
168     ( w != NULL )? w->GetRenderers( )->GetFirstRenderer( ): NULL;
169   vtkRenderer* rends[ ] =
170     {
171       ( x != NULL )? x->GetRenderers( )->GetFirstRenderer( ): NULL,
172       ( y != NULL )? y->GetRenderers( )->GetFirstRenderer( ): NULL,
173       ( z != NULL )? z->GetRenderers( )->GetFirstRenderer( ): NULL
174     };
175   for( int i = 0; i < 3; ++i )
176   {
177     if( rends[ i ] != NULL )
178       for( int j = 0; j < 3; ++j )
179         if( i != j )
180           rends[ i ]->AddActor( this->Slices[ 0 ][ j ]->GetPlaneActor( ) );
181     if( wren != NULL )
182     {
183       for(
184         unsigned int k = 0;
185         k < this->Slices[ 1 ][ i ]->GetNumberOfImageActors( );
186         ++k
187         )
188         wren->AddActor( this->Slices[ 1 ][ i ]->GetImageActor( k ) );
189       wren->AddActor( this->Slices[ 1 ][ i ]->GetPlaneActor( ) );
190
191     } // fi
192
193   } // rof
194   if( wren != NULL )
195     wren->AddActor( this->ImageOutlineActor );
196
197   for( unsigned int j = 0; j < 3; ++j )
198   {
199     ImageInteractorStyle* st =
200       dynamic_cast< ImageInteractorStyle* >( this->Slices[ 0 ][ j ]->GetStyle( ) );
201     if( w != NULL )
202       st->AssociateInteractor( w->GetInteractor( ) );
203     for( unsigned int l = 0; l < 3; ++l )
204       if( j != l )
205         st->AssociateInteractor(
206           this->Slices[ 0 ][ l ]->GetStyle( )->GetInteractor( )
207           );
208
209   } // rof
210 }
211
212 // -------------------------------------------------------------------------
213 void cpExtensions::Visualization::MPRActors::
214 PopDataFrom(
215   vtkRenderer* x,
216   vtkRenderer* y,
217   vtkRenderer* z,
218   vtkRenderer* w
219   )
220 {
221   /*
222   vtkRenderer* rends[] = { x, y, z };
223   for( int i = 0; i < 3; ++i )
224   {
225     if( rends[ i ] != NULL )
226     {
227       for(
228         unsigned int k = 0;
229         k < this->Slices[ 0 ][ i ]->GetNumberOfImageActors( );
230         ++k
231         )
232         rends[ i ]->RemoveActor( this->Slices[ 0 ][ i ]->GetImageActor( k ) );
233       rends[ i ]->RemoveActor( this->Slices[ 0 ][ i ]->GetTextActor( ) );
234       for( int j = 0; j < 3; ++j )
235         rends[ i ]->RemoveActor( this->Slices[ 0 ][ j ]->GetPlaneActor( ) );
236
237     } // fi
238     if( w != NULL )
239     {
240       for(
241         unsigned int k = 0;
242         k < this->Slices[ 1 ][ i ]->GetNumberOfImageActors( );
243         ++k
244         )
245         w->RemoveActor( this->Slices[ 1 ][ i ]->GetImageActor( k ) );
246       w->RemoveActor( this->Slices[ 1 ][ i ]->GetPlaneActor( ) );
247
248     } // fi
249
250   } // rof
251   if( w != NULL )
252     w->RemoveActor( this->ImageOutlineActor );
253   */
254 }
255
256 // -------------------------------------------------------------------------
257   /*
258 void cpExtensions::Visualization::MPRActors::
259 LinkInteractors( )
260 {
261   this->_Update( 0 );
262   this->_Update( 1 );
263   this->_Update( 2 );
264 }
265   */
266
267 // -------------------------------------------------------------------------
268 void cpExtensions::Visualization::MPRActors::
269 SetLookupTable( unsigned int i, vtkScalarsToColors* lut )
270 {
271   /*
272   if( i < this->ImageMaps.size( ) )
273   {
274     this->ImageMaps[ i ]->SetLookupTable( lut );
275     this->ImageMaps[ i ]->Update( );
276     this->Modified( );
277
278   } // fi
279   */
280 }
281
282 // -------------------------------------------------------------------------
283 vtkScalarsToColors* cpExtensions::Visualization::MPRActors::
284 GetLookupTable( unsigned int i ) const
285 {
286   /*
287   if( i < this->ImageMaps.size( ) )
288     return( this->ImageMaps[ i ]->GetLookupTable( ) );
289   else
290     return( NULL );
291     */
292 }
293
294 // -------------------------------------------------------------------------
295 void cpExtensions::Visualization::MPRActors::
296 SetLookupTableToWindowLevel( unsigned int i )
297 {
298   /*
299   // Check if the input has been configured
300   vtkImageData* image = this->_Image( i );
301   if( image == NULL )
302     return;
303
304   double r[ 2 ];
305   image->GetScalarRange( r );
306
307   vtkSmartPointer< vtkWindowLevelLookupTable > lut =
308     vtkSmartPointer< vtkWindowLevelLookupTable >::New( );
309   lut->SetScaleToLinear( );
310   lut->SetTableRange( r );
311   lut->Build( );
312
313   this->SetLookupTable( i, lut );
314   */
315 }
316
317 // -------------------------------------------------------------------------
318 double cpExtensions::Visualization::MPRActors::
319 GetMinWindow( unsigned int i ) const
320 {
321   return( 0 );
322 }
323
324 // -------------------------------------------------------------------------
325 double cpExtensions::Visualization::MPRActors::
326 GetMaxWindow( unsigned int i ) const
327 {
328   /*
329   // Check if the input has been configured
330   vtkImageData* image = this->_Image( i );
331   if( image == NULL )
332     return( double( 0 ) );
333
334   double r[ 2 ];
335   image->GetScalarRange( r );
336   return( r[ 1 ] - r[ 0 ] );
337   */
338 }
339
340 // -------------------------------------------------------------------------
341 double cpExtensions::Visualization::MPRActors::
342 GetMinLevel( unsigned int i ) const
343 {
344   /*
345   // Check if the input has been configured
346   vtkImageData* image = this->_Image( i );
347   if( image == NULL )
348     return( double( 0 ) );
349
350   double r[ 2 ];
351   image->GetScalarRange( r );
352   return( r[ 0 ] );
353   */
354 }
355
356 // -------------------------------------------------------------------------
357 double cpExtensions::Visualization::MPRActors::
358 GetMaxLevel( unsigned int i ) const
359 {
360   /*
361   // Check if the input has been configured
362   vtkImageData* image = this->_Image( i );
363   if( image == NULL )
364     return( double( 0 ) );
365
366   double r[ 2 ];
367   image->GetScalarRange( r );
368   return( r[ 1 ] );
369   */
370 }
371
372 // -------------------------------------------------------------------------
373 double cpExtensions::Visualization::MPRActors::
374 GetWindow( unsigned int i ) const
375 {
376   /*
377   vtkWindowLevelLookupTable* lut =
378     dynamic_cast< vtkWindowLevelLookupTable* >( this->GetLookupTable( i ) );
379   if( lut != NULL )
380     return( lut->GetWindow( ) );
381   else
382     return( double( 0 ) );
383   */
384 }
385
386 // -------------------------------------------------------------------------
387 double cpExtensions::Visualization::MPRActors::
388 GetLevel( unsigned int i ) const
389 {
390   /*
391   vtkWindowLevelLookupTable* lut =
392     dynamic_cast< vtkWindowLevelLookupTable* >( this->GetLookupTable( i ) );
393   if( lut != NULL )
394     return( lut->GetLevel( ) );
395   else
396     return( double( 0 ) );
397   */
398 }
399
400 // -------------------------------------------------------------------------
401 void cpExtensions::Visualization::MPRActors::
402 SetWindow( unsigned int i, const double& w )
403 {
404   /*
405   vtkWindowLevelLookupTable* lut =
406     dynamic_cast< vtkWindowLevelLookupTable* >( this->GetLookupTable( i ) );
407   if( lut != NULL )
408   {
409     lut->SetWindow( w );
410     lut->Build( );
411     this->ImageMaps[ i ]->Modified( );
412     this->Modified( );
413
414   } // fi
415   */
416 }
417
418 // -------------------------------------------------------------------------
419 void cpExtensions::Visualization::MPRActors::
420 SetLevel( unsigned int i, const double& l )
421 {
422   /*
423   vtkWindowLevelLookupTable* lut =
424     dynamic_cast< vtkWindowLevelLookupTable* >( this->GetLookupTable( i ) );
425   if( lut != NULL )
426   {
427     lut->SetLevel( l );
428     lut->Build( );
429     this->ImageMaps[ i ]->Modified( );
430     this->Modified( );
431
432   } // fi
433   */
434 }
435
436 // -------------------------------------------------------------------------
437 void cpExtensions::Visualization::MPRActors::
438 SetWindowLevel( unsigned int i, const double& w, const double& l )
439 {
440   /*
441   vtkWindowLevelLookupTable* lut =
442     dynamic_cast< vtkWindowLevelLookupTable* >( this->GetLookupTable( i ) );
443   if( lut != NULL )
444   {
445     lut->SetWindow( w );
446     lut->SetLevel( l );
447     lut->Build( );
448     this->ImageMaps[ i ]->Modified( );
449
450     for( unsigned int j = 0; j < 3; ++j )
451       this->Slices[ 0 ][ j ]->UpdateText( w, l );
452
453     this->Modified( );
454
455   } // fi
456   */
457 }
458
459 // -------------------------------------------------------------------------
460 void cpExtensions::Visualization::MPRActors::
461 ResetWindowLevel( unsigned int i )
462 {
463   /*
464   vtkImageData* image = this->_Image( i );
465   vtkWindowLevelLookupTable* lut =
466     dynamic_cast< vtkWindowLevelLookupTable* >( this->GetLookupTable( i ) );
467   if( image != NULL && lut != NULL )
468   {
469     double r[ 2 ];
470     image->GetScalarRange( r );
471     lut->SetTableRange( r );
472     lut->SetWindow( r[ 1 ] - r[ 0 ] );
473     lut->SetLevel( ( r[ 1 ] + r[ 0 ] ) / double( 2 ) );
474     lut->Build( );
475     this->ImageMaps[ i ]->Modified( );
476     this->Modified( );
477
478   } // fi
479   */
480 }
481
482 // -------------------------------------------------------------------------
483 void cpExtensions::Visualization::MPRActors::
484 SetLookupTableToColor(
485   unsigned int i, const double& r, const double& g, const double& b
486   )
487 {
488   /*
489   static const double _0 = double( 0 );
490   static const double _1 = double( 1 );
491   static const double _2 = double( 2 );
492   static const double _4 = double( 4 );
493   static const double _6 = double( 6 );
494   static const double _OPACITY = double( 0.6 );
495
496   // Check if the input has been configured
497   vtkImageData* image = this->_Image( i );
498   if( image == NULL )
499     return;
500
501   double range[ 2 ];
502   image->GetScalarRange( range );
503
504   // Get HSV from display color
505   double cmax = ( r > g )? r: g; cmax = ( b > cmax )? b: cmax;
506   double cmin = ( r < g )? r: g; cmin = ( b < cmin )? b: cmin;
507   double d = cmax - cmin;
508
509   double saturation = ( std::fabs( cmax ) > _0 )? d / cmax: _0;
510   double value = cmax;
511   double hue = _0;
512   if( d > _0 )
513   {
514     if( r == cmax )
515       hue = std::fmod( ( g - b ) / d, _6 );
516     else if( g == cmax )
517       hue = ( ( b - r ) / d ) + _2;
518     else if( b == cmax )
519       hue = ( ( r - g ) / d ) + _4;
520     hue *= _1 / _6;
521
522   } // fi
523
524   // Define new lookup table
525   vtkSmartPointer< vtkLookupTable > lut =
526     vtkSmartPointer< vtkLookupTable >::New( );
527   lut->SetScaleToLinear( );
528   lut->SetNanColor( _0, _0, _0, _0 );
529   lut->SetTableRange( range[ 0 ], range[ 1 ] );
530   lut->SetAlphaRange( _0, _OPACITY );
531   lut->SetHueRange( _0, hue );
532   lut->SetSaturationRange( _0, saturation );
533   lut->SetValueRange( _0, value );
534   lut->Build( );
535
536   this->SetLookupTable( i, lut );
537   */
538 }
539
540 // -------------------------------------------------------------------------
541 int cpExtensions::Visualization::MPRActors::
542 GetSliceNumberMinValue( const int& axis ) const
543 {
544   return( this->Slices[ 0 ][ axis ]->GetSliceNumberMinValue( ) );
545 }
546
547 // -------------------------------------------------------------------------
548 int cpExtensions::Visualization::MPRActors::
549 GetSliceNumberMaxValue( const int& axis ) const
550 {
551   return( this->Slices[ 0 ][ axis ]->GetSliceNumberMaxValue( ) );
552 }
553
554 // -------------------------------------------------------------------------
555 int cpExtensions::Visualization::MPRActors::
556 GetSlice( const int& axis ) const
557 {
558   return( this->Slices[ 0 ][ axis ]->GetSliceNumber( ) );
559 }
560
561 // -------------------------------------------------------------------------
562 void cpExtensions::Visualization::MPRActors::
563 SetSlice( const int& axis, const int& slice )
564 {
565   vtkImageData* image = this->_Image( 0 );
566   if( image == NULL )
567     return;
568
569   // Get image data extent
570   int ext[ 6 ];
571   image->GetExtent( ext );
572
573   // Check if the slice is valid
574   int real = slice;
575   if( slice < ext[ axis << 1 ] )
576     real = ext[ axis << 1 ];
577   if( ext[ ( axis << 1 ) + 1 ] < slice )
578     real = ext[ ( axis << 1 ) + 1 ];
579
580   // Change slice
581   this->Slices[ 0 ][ axis ]->SetSliceNumber( real );
582   this->Slices[ 1 ][ axis ]->SetSliceNumber( real );
583   this->Modified( );
584 }
585
586 // -------------------------------------------------------------------------
587 void cpExtensions::Visualization::MPRActors::
588 SetSlice( const int& axis, const double& slice )
589 {
590   vtkImageData* image = this->_Image( 0 );
591   if( image == NULL )
592     return;
593
594   double x[ 3 ] = { double( 0 ) };
595   double pcoords[ 3 ];
596   int ijk[ 3 ];
597
598   x[ axis ] = slice;
599   image->ComputeStructuredCoordinates( x, ijk, pcoords );
600   this->SetSlice( axis, ijk[ axis ] );
601 }
602
603 // -------------------------------------------------------------------------
604 void cpExtensions::Visualization::MPRActors::
605 ResetSlices( )
606 {
607   for( unsigned int i = 0; i < 2; ++i )
608     for( unsigned int j = 0; j < 3; ++j )
609       this->Slices[ i ][ j ]->SetSliceNumber(
610         this->Slices[ i ][ j ]->GetSliceNumberMinValue( )
611         );
612 }
613
614 // -------------------------------------------------------------------------
615 cpExtensions::Visualization::MPRActors::
616 MPRActors( )
617   : Superclass( )
618 {
619   this->ImageOutlineActor = vtkSmartPointer< vtkActor >::New( );
620   for( unsigned int i = 0; i < 2; ++i )
621     for( unsigned int j = 0; j < 3; ++j )
622       this->Slices[ i ][ j ] = vtkSmartPointer< ImageSliceActors >::New( );
623
624   this->Slices[ 0 ][ 0 ]->AssociateSlice( this->Slices[ 1 ][ 0 ] );
625   this->Slices[ 0 ][ 1 ]->AssociateSlice( this->Slices[ 1 ][ 1 ] );
626   this->Slices[ 0 ][ 2 ]->AssociateSlice( this->Slices[ 1 ][ 2 ] );
627
628   this->Slices[ 0 ][ 0 ]->SetSlicesCommand( Self::_SetSlices, this );
629   this->Slices[ 0 ][ 1 ]->SetSlicesCommand( Self::_SetSlices, this );
630   this->Slices[ 0 ][ 2 ]->SetSlicesCommand( Self::_SetSlices, this );
631 }
632
633 // -------------------------------------------------------------------------
634 cpExtensions::Visualization::MPRActors::
635 ~MPRActors( )
636 {
637 }
638
639 // -------------------------------------------------------------------------
640 vtkImageData* cpExtensions::Visualization::MPRActors::
641 _Image( unsigned int i ) const
642 {
643   /*
644   if( i < this->ImageMaps.size( ) )
645   {
646     vtkAlgorithm* algo = this->ImageMaps[ i ]->GetInputAlgorithm( );
647     vtkInformation* info = algo->GetOutputInformation( 0 );
648     return(
649       vtkImageData::SafeDownCast(
650         info->Get( vtkDataObject::DATA_OBJECT( ) )
651         )
652       );
653   }
654   else
655   */
656   return( NULL );
657 }
658
659 // -------------------------------------------------------------------------
660 void cpExtensions::Visualization::MPRActors::
661 _Update( unsigned int i )
662 {
663   /*
664   // Check if the input has been configured
665   vtkImageData* image = this->_Image( i );
666   if( image == NULL )
667     return;
668   this->ImageMaps[ i ]->Update( );
669
670   for( int j = 0; j < 2; ++j )
671   {
672     for( int k = 0; k < 3; ++k )
673     {
674       this->Slices[ j ][ k ]->AddInputConnection(
675         this->ImageMaps[ i ]->GetOutputPort( ), k
676         );
677       this->Slices[ j ][ k ]->UpdateText( );
678
679       // Add all of slice's props
680       this->Slices[ j ][ k ]->InitTraversal( );
681       vtkProp* prop = this->Slices[ j ][ k ]->GetNextProp( );
682       while( prop != NULL )
683       {
684         this->AddItem( prop );
685         prop = this->Slices[ j ][ k ]->GetNextProp( );
686
687       } // elihw
688
689     } // rof
690
691   } // rof
692
693   if( i == 0 )
694   {
695     // Create 3D outline
696     double bb[ 6 ];
697     image->GetBounds( bb );
698
699     vtkSmartPointer< vtkOutlineSource > img_ol =
700       vtkSmartPointer< vtkOutlineSource >::New( );
701     img_ol->SetBounds( bb );
702
703     vtkSmartPointer< vtkPolyDataMapper > img_ol_mapper =
704       vtkSmartPointer< vtkPolyDataMapper >::New( );
705     img_ol_mapper->SetInputConnection( img_ol->GetOutputPort( ) );
706     this->ImageOutlineActor->SetMapper( img_ol_mapper );
707     this->ImageOutlineActor->GetProperty( )->SetColor( 1, 1, 1 );
708     this->ImageOutlineActor->GetProperty( )->SetLineWidth( 1 );
709
710     this->AddItem( this->ImageOutlineActor );
711
712   } // fi
713   */
714 }
715
716 // -------------------------------------------------------------------------
717 void cpExtensions::Visualization::MPRActors::
718 _SetSlices( double* pos, int axis, void* data )
719 {
720   MPRActors* actors = reinterpret_cast< MPRActors* >( data );
721   if( actors == NULL )
722     return;
723   for( unsigned int j = 0; j < 3; ++j )
724     if( actors->Slices[ 0 ][ j ]->GetAxis( ) != axis )
725       actors->Slices[ 0 ][ j ]->SetSlice( pos );
726   actors->Modified( );
727 }
728
729 // eof - $RCSfile$