]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/Visualization/MPRActors.cxx
async test
[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   return 0;
293 }
294
295 // -------------------------------------------------------------------------
296 void cpExtensions::Visualization::MPRActors::
297 SetLookupTableToWindowLevel( unsigned int i )
298 {
299   /*
300   // Check if the input has been configured
301   vtkImageData* image = this->_Image( i );
302   if( image == NULL )
303     return;
304
305   double r[ 2 ];
306   image->GetScalarRange( r );
307
308   vtkSmartPointer< vtkWindowLevelLookupTable > lut =
309     vtkSmartPointer< vtkWindowLevelLookupTable >::New( );
310   lut->SetScaleToLinear( );
311   lut->SetTableRange( r );
312   lut->Build( );
313
314   this->SetLookupTable( i, lut );
315   */
316 }
317
318 // -------------------------------------------------------------------------
319 double cpExtensions::Visualization::MPRActors::
320 GetMinWindow( unsigned int i ) const
321 {
322   return( 0 );
323 }
324
325 // -------------------------------------------------------------------------
326 double cpExtensions::Visualization::MPRActors::
327 GetMaxWindow( unsigned int i ) const
328 {
329   /*
330   // Check if the input has been configured
331   vtkImageData* image = this->_Image( i );
332   if( image == NULL )
333     return( double( 0 ) );
334
335   double r[ 2 ];
336   image->GetScalarRange( r );
337   return( r[ 1 ] - r[ 0 ] );
338   */
339   return 0;
340 }
341
342 // -------------------------------------------------------------------------
343 double cpExtensions::Visualization::MPRActors::
344 GetMinLevel( unsigned int i ) const
345 {
346   /*
347   // Check if the input has been configured
348   vtkImageData* image = this->_Image( i );
349   if( image == NULL )
350     return( double( 0 ) );
351
352   double r[ 2 ];
353   image->GetScalarRange( r );
354   return( r[ 0 ] );
355   */
356   return 0;
357 }
358
359 // -------------------------------------------------------------------------
360 double cpExtensions::Visualization::MPRActors::
361 GetMaxLevel( unsigned int i ) const
362 {
363   /*
364   // Check if the input has been configured
365   vtkImageData* image = this->_Image( i );
366   if( image == NULL )
367     return( double( 0 ) );
368
369   double r[ 2 ];
370   image->GetScalarRange( r );
371   return( r[ 1 ] );
372   */
373   return 0;
374 }
375
376 // -------------------------------------------------------------------------
377 double cpExtensions::Visualization::MPRActors::
378 GetWindow( unsigned int i ) const
379 {
380   /*
381   vtkWindowLevelLookupTable* lut =
382     dynamic_cast< vtkWindowLevelLookupTable* >( this->GetLookupTable( i ) );
383   if( lut != NULL )
384     return( lut->GetWindow( ) );
385   else
386     return( double( 0 ) );
387   */
388   return 0;
389 }
390
391 // -------------------------------------------------------------------------
392 double cpExtensions::Visualization::MPRActors::
393 GetLevel( unsigned int i ) const
394 {
395   /*
396   vtkWindowLevelLookupTable* lut =
397     dynamic_cast< vtkWindowLevelLookupTable* >( this->GetLookupTable( i ) );
398   if( lut != NULL )
399     return( lut->GetLevel( ) );
400   else
401     return( double( 0 ) );
402   */
403   return 0;
404 }
405
406 // -------------------------------------------------------------------------
407 void cpExtensions::Visualization::MPRActors::
408 SetWindow( unsigned int i, const double& w )
409 {
410   /*
411   vtkWindowLevelLookupTable* lut =
412     dynamic_cast< vtkWindowLevelLookupTable* >( this->GetLookupTable( i ) );
413   if( lut != NULL )
414   {
415     lut->SetWindow( w );
416     lut->Build( );
417     this->ImageMaps[ i ]->Modified( );
418     this->Modified( );
419
420   } // fi
421   */
422 }
423
424 // -------------------------------------------------------------------------
425 void cpExtensions::Visualization::MPRActors::
426 SetLevel( unsigned int i, const double& l )
427 {
428   /*
429   vtkWindowLevelLookupTable* lut =
430     dynamic_cast< vtkWindowLevelLookupTable* >( this->GetLookupTable( i ) );
431   if( lut != NULL )
432   {
433     lut->SetLevel( l );
434     lut->Build( );
435     this->ImageMaps[ i ]->Modified( );
436     this->Modified( );
437
438   } // fi
439   */
440 }
441
442 // -------------------------------------------------------------------------
443 void cpExtensions::Visualization::MPRActors::
444 SetWindowLevel( unsigned int i, const double& w, const double& l )
445 {
446   /*
447   vtkWindowLevelLookupTable* lut =
448     dynamic_cast< vtkWindowLevelLookupTable* >( this->GetLookupTable( i ) );
449   if( lut != NULL )
450   {
451     lut->SetWindow( w );
452     lut->SetLevel( l );
453     lut->Build( );
454     this->ImageMaps[ i ]->Modified( );
455
456     for( unsigned int j = 0; j < 3; ++j )
457       this->Slices[ 0 ][ j ]->UpdateText( w, l );
458
459     this->Modified( );
460
461   } // fi
462   */
463 }
464
465 // -------------------------------------------------------------------------
466 void cpExtensions::Visualization::MPRActors::
467 ResetWindowLevel( unsigned int i )
468 {
469   /*
470   vtkImageData* image = this->_Image( i );
471   vtkWindowLevelLookupTable* lut =
472     dynamic_cast< vtkWindowLevelLookupTable* >( this->GetLookupTable( i ) );
473   if( image != NULL && lut != NULL )
474   {
475     double r[ 2 ];
476     image->GetScalarRange( r );
477     lut->SetTableRange( r );
478     lut->SetWindow( r[ 1 ] - r[ 0 ] );
479     lut->SetLevel( ( r[ 1 ] + r[ 0 ] ) / double( 2 ) );
480     lut->Build( );
481     this->ImageMaps[ i ]->Modified( );
482     this->Modified( );
483
484   } // fi
485   */
486 }
487
488 // -------------------------------------------------------------------------
489 void cpExtensions::Visualization::MPRActors::
490 SetLookupTableToColor(
491   unsigned int i, const double& r, const double& g, const double& b
492   )
493 {
494   /*
495   static const double _0 = double( 0 );
496   static const double _1 = double( 1 );
497   static const double _2 = double( 2 );
498   static const double _4 = double( 4 );
499   static const double _6 = double( 6 );
500   static const double _OPACITY = double( 0.6 );
501
502   // Check if the input has been configured
503   vtkImageData* image = this->_Image( i );
504   if( image == NULL )
505     return;
506
507   double range[ 2 ];
508   image->GetScalarRange( range );
509
510   // Get HSV from display color
511   double cmax = ( r > g )? r: g; cmax = ( b > cmax )? b: cmax;
512   double cmin = ( r < g )? r: g; cmin = ( b < cmin )? b: cmin;
513   double d = cmax - cmin;
514
515   double saturation = ( std::fabs( cmax ) > _0 )? d / cmax: _0;
516   double value = cmax;
517   double hue = _0;
518   if( d > _0 )
519   {
520     if( r == cmax )
521       hue = std::fmod( ( g - b ) / d, _6 );
522     else if( g == cmax )
523       hue = ( ( b - r ) / d ) + _2;
524     else if( b == cmax )
525       hue = ( ( r - g ) / d ) + _4;
526     hue *= _1 / _6;
527
528   } // fi
529
530   // Define new lookup table
531   vtkSmartPointer< vtkLookupTable > lut =
532     vtkSmartPointer< vtkLookupTable >::New( );
533   lut->SetScaleToLinear( );
534   lut->SetNanColor( _0, _0, _0, _0 );
535   lut->SetTableRange( range[ 0 ], range[ 1 ] );
536   lut->SetAlphaRange( _0, _OPACITY );
537   lut->SetHueRange( _0, hue );
538   lut->SetSaturationRange( _0, saturation );
539   lut->SetValueRange( _0, value );
540   lut->Build( );
541
542   this->SetLookupTable( i, lut );
543   */
544 }
545
546 // -------------------------------------------------------------------------
547 int cpExtensions::Visualization::MPRActors::
548 GetSliceNumberMinValue( const int& axis ) const
549 {
550   return( this->Slices[ 0 ][ axis ]->GetSliceNumberMinValue( ) );
551 }
552
553 // -------------------------------------------------------------------------
554 int cpExtensions::Visualization::MPRActors::
555 GetSliceNumberMaxValue( const int& axis ) const
556 {
557   return( this->Slices[ 0 ][ axis ]->GetSliceNumberMaxValue( ) );
558 }
559
560 // -------------------------------------------------------------------------
561 int cpExtensions::Visualization::MPRActors::
562 GetSlice( const int& axis ) const
563 {
564   return( this->Slices[ 0 ][ axis ]->GetSliceNumber( ) );
565 }
566
567 // -------------------------------------------------------------------------
568 void cpExtensions::Visualization::MPRActors::
569 SetSlice( const int& axis, const int& slice )
570 {
571   vtkImageData* image = this->_Image( 0 );
572   if( image == NULL )
573     return;
574
575   // Get image data extent
576   int ext[ 6 ];
577   image->GetExtent( ext );
578
579   // Check if the slice is valid
580   int real = slice;
581   if( slice < ext[ axis << 1 ] )
582     real = ext[ axis << 1 ];
583   if( ext[ ( axis << 1 ) + 1 ] < slice )
584     real = ext[ ( axis << 1 ) + 1 ];
585
586   // Change slice
587   this->Slices[ 0 ][ axis ]->SetSliceNumber( real );
588   this->Slices[ 1 ][ axis ]->SetSliceNumber( real );
589   this->Modified( );
590 }
591
592 // -------------------------------------------------------------------------
593 void cpExtensions::Visualization::MPRActors::
594 SetSlice( const int& axis, const double& slice )
595 {
596   vtkImageData* image = this->_Image( 0 );
597   if( image == NULL )
598     return;
599
600   double x[ 3 ] = { double( 0 ) };
601   double pcoords[ 3 ];
602   int ijk[ 3 ];
603
604   x[ axis ] = slice;
605   image->ComputeStructuredCoordinates( x, ijk, pcoords );
606   this->SetSlice( axis, ijk[ axis ] );
607 }
608
609 // -------------------------------------------------------------------------
610 void cpExtensions::Visualization::MPRActors::
611 ResetSlices( )
612 {
613   for( unsigned int i = 0; i < 2; ++i )
614     for( unsigned int j = 0; j < 3; ++j )
615       this->Slices[ i ][ j ]->SetSliceNumber(
616         this->Slices[ i ][ j ]->GetSliceNumberMinValue( )
617         );
618 }
619
620 // -------------------------------------------------------------------------
621 cpExtensions::Visualization::MPRActors::
622 MPRActors( )
623   : Superclass( )
624 {
625   this->ImageOutlineActor = vtkSmartPointer< vtkActor >::New( );
626   for( unsigned int i = 0; i < 2; ++i )
627     for( unsigned int j = 0; j < 3; ++j )
628       this->Slices[ i ][ j ] = vtkSmartPointer< ImageSliceActors >::New( );
629
630   this->Slices[ 0 ][ 0 ]->AssociateSlice( this->Slices[ 1 ][ 0 ] );
631   this->Slices[ 0 ][ 1 ]->AssociateSlice( this->Slices[ 1 ][ 1 ] );
632   this->Slices[ 0 ][ 2 ]->AssociateSlice( this->Slices[ 1 ][ 2 ] );
633
634   this->Slices[ 0 ][ 0 ]->SetSlicesCommand( Self::_SetSlices, this );
635   this->Slices[ 0 ][ 1 ]->SetSlicesCommand( Self::_SetSlices, this );
636   this->Slices[ 0 ][ 2 ]->SetSlicesCommand( Self::_SetSlices, this );
637 }
638
639 // -------------------------------------------------------------------------
640 cpExtensions::Visualization::MPRActors::
641 ~MPRActors( )
642 {
643 }
644
645 // -------------------------------------------------------------------------
646 vtkImageData* cpExtensions::Visualization::MPRActors::
647 _Image( unsigned int i ) const
648 {
649   /*
650   if( i < this->ImageMaps.size( ) )
651   {
652     vtkAlgorithm* algo = this->ImageMaps[ i ]->GetInputAlgorithm( );
653     vtkInformation* info = algo->GetOutputInformation( 0 );
654     return(
655       vtkImageData::SafeDownCast(
656         info->Get( vtkDataObject::DATA_OBJECT( ) )
657         )
658       );
659   }
660   else
661   */
662   return( NULL );
663 }
664
665 // -------------------------------------------------------------------------
666 void cpExtensions::Visualization::MPRActors::
667 _Update( unsigned int i )
668 {
669   /*
670   // Check if the input has been configured
671   vtkImageData* image = this->_Image( i );
672   if( image == NULL )
673     return;
674   this->ImageMaps[ i ]->Update( );
675
676   for( int j = 0; j < 2; ++j )
677   {
678     for( int k = 0; k < 3; ++k )
679     {
680       this->Slices[ j ][ k ]->AddInputConnection(
681         this->ImageMaps[ i ]->GetOutputPort( ), k
682         );
683       this->Slices[ j ][ k ]->UpdateText( );
684
685       // Add all of slice's props
686       this->Slices[ j ][ k ]->InitTraversal( );
687       vtkProp* prop = this->Slices[ j ][ k ]->GetNextProp( );
688       while( prop != NULL )
689       {
690         this->AddItem( prop );
691         prop = this->Slices[ j ][ k ]->GetNextProp( );
692
693       } // elihw
694
695     } // rof
696
697   } // rof
698
699   if( i == 0 )
700   {
701     // Create 3D outline
702     double bb[ 6 ];
703     image->GetBounds( bb );
704
705     vtkSmartPointer< vtkOutlineSource > img_ol =
706       vtkSmartPointer< vtkOutlineSource >::New( );
707     img_ol->SetBounds( bb );
708
709     vtkSmartPointer< vtkPolyDataMapper > img_ol_mapper =
710       vtkSmartPointer< vtkPolyDataMapper >::New( );
711     img_ol_mapper->SetInputConnection( img_ol->GetOutputPort( ) );
712     this->ImageOutlineActor->SetMapper( img_ol_mapper );
713     this->ImageOutlineActor->GetProperty( )->SetColor( 1, 1, 1 );
714     this->ImageOutlineActor->GetProperty( )->SetLineWidth( 1 );
715
716     this->AddItem( this->ImageOutlineActor );
717
718   } // fi
719   */
720 }
721
722 // -------------------------------------------------------------------------
723 void cpExtensions::Visualization::MPRActors::
724 _SetSlices( double* pos, int axis, void* data )
725 {
726   MPRActors* actors = reinterpret_cast< MPRActors* >( data );
727   if( actors == NULL )
728     return;
729   for( unsigned int j = 0; j < 3; ++j )
730     if( actors->Slices[ 0 ][ j ]->GetAxis( ) != axis )
731       actors->Slices[ 0 ][ j ]->SetSlice( pos );
732   actors->Modified( );
733 }
734
735 // eof - $RCSfile$