1 /*=========================================================================
4 Module: $RCSfile: vtk3DQuantSurfaceWidget.cxx,v $
6 Date: $Date: 2009/05/14 13:54:57 $
7 Version: $Revision: 1.1 $
9 Copyright: (c) 2002, 2003
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notice for more information.
16 =========================================================================*/
17 #include "vtk3DQuantSurfaceWidget.h"
18 #include <vtkPointPicker.h>
19 #include <vtkCamera.h>
20 #include <vtkWindowLevelLookupTable.h>
22 #include <vtkPolyLine.h>
23 #include <vtkPlaneSource.h>
27 //----------------------------------------------------------------------------
28 RectangleGuideVtk::RectangleGuideVtk(){
37 //----------------------------------------------------------------------------
38 RectangleGuideVtk::~RectangleGuideVtk(){
39 if( _grid ) _grid->Delete();
40 if( _actor ) _actor->Delete();
41 if( _points ) _points->Delete();
42 if( _mapper ) _mapper->Delete();
43 if( _poly_line ) _poly_line->Delete();
46 //----------------------------------------------------------------------------
47 //----------------------------------------------------------------------------
48 //----------------------------------------------------------------------------
49 //----------------------------------------------------------------------------
50 listContourVTK::listContourVTK(vtk3DQuantSurfaceWidget *quantSurfaceWidget){
54 _vtk3DQuantSurfaceWidget=quantSurfaceWidget;
56 //----------------------------------------------------------------------------
57 listContourVTK::~listContourVTK(){
58 EraseListContourActor();
60 //----------------------------------------------------------------------------
61 void listContourVTK::SetColour(int r,int g,int b){
66 //----------------------------------------------------------------------------
67 void listContourVTK::InitListContourActor(int nos){
68 EraseListContourActor();
71 _lst3DContoursVtkActor.push_back( NULL );
72 _lst3DContoursVtkUnstructuredGrid.push_back( NULL );
73 _lst3DContoursVtkDataSetMapper.push_back( NULL );
74 _lst3DContoursVtkPolyLine.push_back( NULL );
79 // vtkRenderWindow* pRenderWindow = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderWindow();
80 // pRenderWindow->Render( );
82 //----------------------------------------------------------------------------
83 void listContourVTK::EraseListContourActor(){
85 for (i=0;i<_lst3DContoursVtkActor.size();i++){
86 EraseSliceContourActor(i,false);
88 _lst3DContoursVtkActor.clear();
89 _lst3DContoursVtkUnstructuredGrid.clear();
90 _lst3DContoursVtkDataSetMapper.clear();
91 _lst3DContoursVtkPolyLine.clear();
93 //----------------------------------------------------------------------------
94 void listContourVTK::EraseSliceContourActor(int slice, bool refresh){
95 if (_lst3DContoursVtkActor[slice]!=NULL){
96 vtkRenderer *pRenderer = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderer();
97 if (_lst3DContoursVtkActor[slice]) pRenderer->RemoveActor(_lst3DContoursVtkActor[slice]);
98 if (_lst3DContoursVtkUnstructuredGrid[slice]) _lst3DContoursVtkUnstructuredGrid[slice]->Delete();
99 if (_lst3DContoursVtkDataSetMapper[slice]) _lst3DContoursVtkDataSetMapper[slice]->Delete();
100 if (_lst3DContoursVtkPolyLine[slice]) _lst3DContoursVtkPolyLine[slice]->Delete();
101 if (_lst3DContoursVtkActor[slice]) _lst3DContoursVtkActor[slice]->Delete();
102 _lst3DContoursVtkUnstructuredGrid[slice]=NULL;
103 _lst3DContoursVtkDataSetMapper[slice]=NULL;
104 _lst3DContoursVtkPolyLine[slice]=NULL;
105 _lst3DContoursVtkActor[slice]=NULL;
109 vtkRenderWindow* pRenderWindow = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderWindow();
110 pRenderWindow->Render( );
113 //----------------------------------------------------------------------------
114 void listContourVTK::Set3DContourActor( int slice, vtkPoints* contour3D, bool showActor){
116 EraseSliceContourActor(slice);
117 // generate new actor
118 int id,numberOfPoints;
119 numberOfPoints=contour3D->GetNumberOfPoints ();
120 _lst3DContoursVtkPolyLine[slice] = vtkPolyLine::New();
122 ( _lst3DContoursVtkPolyLine[slice]->GetPointIds() )->SetNumberOfIds(numberOfPoints);
123 for (id=0;id<numberOfPoints;id++){
124 ( _lst3DContoursVtkPolyLine[slice]->GetPointIds() )->SetId(id,id);
126 _lst3DContoursVtkUnstructuredGrid[slice]=vtkUnstructuredGrid::New();
127 _lst3DContoursVtkUnstructuredGrid[slice]->Allocate(1,1);
128 _lst3DContoursVtkUnstructuredGrid[slice]->InsertNextCell( _lst3DContoursVtkPolyLine[slice]->GetCellType() ,
129 _lst3DContoursVtkPolyLine[slice]->GetPointIds() );
130 _lst3DContoursVtkUnstructuredGrid[slice]->SetPoints( contour3D );
131 _lst3DContoursVtkDataSetMapper[slice] = vtkDataSetMapper::New();
132 _lst3DContoursVtkDataSetMapper[slice]->SetInput(_lst3DContoursVtkUnstructuredGrid[slice]);
133 _lst3DContoursVtkDataSetMapper[slice]->ImmediateModeRenderingOn();
134 _lst3DContoursVtkActor[slice]=vtkActor::New();
135 _lst3DContoursVtkActor[slice]->SetMapper(_lst3DContoursVtkDataSetMapper[slice]);
136 _lst3DContoursVtkActor[slice]->GetProperty()->BackfaceCullingOn();
137 _lst3DContoursVtkActor[slice]->GetProperty()->SetDiffuseColor(_r,_g,_b);
138 _lst3DContoursVtkActor[slice]->PickableOff( );
140 vtkRenderer *pRenderer = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderer();
141 vtkRenderWindow* pRenderWindow = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderWindow();
143 if (showActor==true){
144 pRenderer->AddActor( _lst3DContoursVtkActor[slice] );
147 pRenderWindow->Render( );
151 //----------------------------------------------------------------------------
152 void listContourVTK::Show3DContourActor( ){
153 vtkRenderer *pRenderer = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderer();
154 vtkRenderWindow* pRenderWindow = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderWindow();
156 for (i=0;i<_lst3DContoursVtkActor.size();i++){
157 if (_lst3DContoursVtkActor[i]!=NULL) pRenderer->AddActor( _lst3DContoursVtkActor[i] );
160 pRenderWindow->Render( );
162 //----------------------------------------------------------------------------
163 void listContourVTK::Hide3DContourActor( ){
164 vtkRenderer *pRenderer = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderer();
165 vtkRenderWindow* pRenderWindow = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderWindow();
167 for (i=0;i<_lst3DContoursVtkActor.size();i++){
168 if (_lst3DContoursVtkActor[i]!=NULL) pRenderer->RemoveActor( _lst3DContoursVtkActor[i] );
171 pRenderWindow->Render( );
175 //----------------------------------------------------------------------------
176 //----------------------------------------------------------------------------
177 //----------------------------------------------------------------------------
184 * Again wxVTK is an hybrid class, double click was done using wxWindows, simply
185 * because VTK doesn't provide such facility (as opposed to wheel support that is
186 * supposed to be merged in VTK trunk sooner or later:
188 * http://public.kitware.com/pipermail/vtkusers/2003-August/019548.html
189 * http://www.creatis.insa-lyon.fr/~malaterre/vtk/wheel.patch
192 //----------------------------------------------------------------------------
194 BEGIN_EVENT_TABLE( vtk3DQuantSurfaceWidget, vtk3DSurfaceWidget )
195 // EVT_LEFT_DCLICK( vtk3DQuantSurfaceWidget::OnLeftDClick )
196 // EVT_MOUSEWHEEL( vtk3DQuantSurfaceWidget::OnMouseWheel )
199 //----------------------------------------------------------------------------
200 vtk3DQuantSurfaceWidget::vtk3DQuantSurfaceWidget(
206 const wxString& name)
207 : vtk3DSurfaceWidget( parent, id, pos, size, style, name ){
208 _3DSliceMapper = NULL;
209 _3DSliceActor = NULL;
212 _hs_rectGuide = new RectangleGuideVtk();
213 _s1_rectGuide = new RectangleGuideVtk();
214 _s2_rectGuide = new RectangleGuideVtk();
215 _sA_rectGuide = new RectangleGuideVtk();
216 _sB_rectGuide = new RectangleGuideVtk();
218 _lstContVtk = new listContourVTK(this);
219 _lstContHealtyVtk = new listContourVTK(this);
220 _lstContVtk->SetColour(1,1,0);
221 _lstContHealtyVtk->SetColour(0,0,1);
225 vtk3DQuantSurfaceWidget::~vtk3DQuantSurfaceWidget()
227 if( _3DSliceActor ) _3DSliceActor ->Delete();
228 if( _3DSliceMapper) _3DSliceMapper ->Delete();
229 if( _bwlookup ) _bwlookup ->Delete();
230 if( _collookup ) _collookup ->Delete();
232 delete _hs_rectGuide;
233 delete _s1_rectGuide;
234 delete _s2_rectGuide;
235 delete _sA_rectGuide;
236 delete _sB_rectGuide;
239 delete _lstContHealtyVtk;
243 //----------------------------------------------------------------------------
244 void vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxe( marInterface* mar )
247 vtkPolyData *allData;
249 vtkProbeFilter *pFilter;
251 this->ShowMARACASData( mar );
252 this->ConfigureVTK();
254 _pRenderer->SetBackground( 0.35, 0.35, 0.35 );
257 _mar->_experiment->setAxis( 0 );
258 temp = _mar->_experiment->getAxis( ); // ??? getActualAxis ??
259 allData = temp->Draw( );
261 nos = _mar->_experiment->getNumberOfSlices( );
262 pFilter = _mar->_experiment->get3DSlice( (int) (nos-1)/2 );
264 _bwlookup = vtkWindowLevelLookupTable::New( );
265 _bwlookup->SetHueRange( 0 , 1 );
266 _bwlookup->SetNumberOfColors( (int)(_range[1] - _range[0] + 1) );
267 _bwlookup->SetTableRange( _range[0] , _range[1] );
268 _bwlookup->SetSaturationRange( 0 , 0 );
269 _bwlookup->SetValueRange( 0 , 1 );
270 _bwlookup->SetAlphaRange( 1 , 1 );
273 _collookup = vtkLookupTable::New( );
274 _collookup->SetNumberOfColors( 256 );
275 _collookup->SetTableRange( 0 , 255 );
276 _collookup->Build( );
277 _collookup->SetTableValue( 0 , 1 , 0 , 0 , 1 );
278 _collookup->SetTableValue(128 , 0 , 0 , 1 , 1 );
279 _collookup->SetTableValue(255 , 0 , 1 , 0 , 1 );
281 _3DSliceMapper = vtkDataSetMapper::New( );
282 _3DSliceMapper->SetInput(pFilter->GetOutput( ) );
283 _3DSliceMapper->SetLookupTable( _bwlookup );
284 _3DSliceMapper->SetScalarRange( _range );
285 _3DSliceMapper->ImmediateModeRenderingOn( );
287 _3DSliceActor = vtkActor::New( );
288 _3DSliceActor->SetMapper( _3DSliceMapper );
289 _pRenderer->AddActor( _3DSliceActor);
291 _lstContVtk->InitListContourActor(nos);
292 _lstContHealtyVtk->InitListContourActor(nos);
294 this->SetAxis( allData );
297 //----------------------------------------------------------------------------
299 //----------------------------------------------------------------------------
300 void vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxeCT( marInterfaceCT* mar )
303 vtkPolyData *allData;
305 vtkProbeFilter *pFilter;
307 this->ShowMARACASDataCT( mar );
308 this->ConfigureVTK();
310 _pRenderer->SetBackground( 0.75, 0.75, 0.75 );
313 _marCT->setAxis( 0 );
314 temp = _marCT->getAxis( ); // ??? getActualAxis ??
315 allData = temp->Draw( );
317 nos = _marCT->getNumberOfSlices( );
318 pFilter = _marCT->get3DSlice( (int) (nos-1)/2 );
320 _bwlookup = vtkWindowLevelLookupTable::New( );
321 _bwlookup->SetHueRange( 0 , 1 );
322 _bwlookup->SetNumberOfColors( (int)(_range[1] - _range[0] + 1) );
323 _bwlookup->SetTableRange( _range[0] , _range[1] );
324 _bwlookup->SetSaturationRange( 0 , 0 );
325 _bwlookup->SetValueRange( 0 , 1 );
326 _bwlookup->SetAlphaRange( 1 , 1 );
329 _collookup = vtkLookupTable::New( );
330 _collookup->SetNumberOfColors( 256 );
331 _collookup->SetTableRange( 0 , 255 );
332 _collookup->Build( );
333 _collookup->SetTableValue( 0 , 1 , 0 , 0 , 1 );
334 _collookup->SetTableValue(128 , 0 , 0 , 1 , 1 );
335 _collookup->SetTableValue(255 , 0 , 1 , 0 , 1 );
337 _3DSliceMapper = vtkDataSetMapper::New( );
338 _3DSliceMapper->SetInput(pFilter->GetOutput( ) );
339 _3DSliceMapper->SetLookupTable( _bwlookup );
340 _3DSliceMapper->SetScalarRange( _range );
341 _3DSliceMapper->ImmediateModeRenderingOn( );
343 _3DSliceActor = vtkActor::New( );
344 _3DSliceActor->SetMapper( _3DSliceMapper );
345 _pRenderer->AddActor( _3DSliceActor);
347 _lstContVtk->InitListContourActor(nos);
348 _lstContHealtyVtk->InitListContourActor(nos);
350 this->SetAxis( allData );
353 //----------------------------------------------------------------------------
355 void vtk3DQuantSurfaceWidget::SetBWLookUp(){
356 _3DSliceMapper->SetLookupTable( _bwlookup );
357 _pRenderWindow->Render( );
359 //----------------------------------------------------------------------------
360 void vtk3DQuantSurfaceWidget::SetColorLookUp(){
361 _3DSliceMapper->SetLookupTable( _collookup );
362 _pRenderWindow->Render( );
364 //----------------------------------------------------------------------------
365 void vtk3DQuantSurfaceWidget::SetImage( vtkProbeFilter* pFilter )
367 _3DSliceMapper->SetInput(pFilter->GetOutput( ) );
369 //----------------------------------------------------------------------------
370 void vtk3DQuantSurfaceWidget::Show3DSliceActor( )
372 _pRenderer->AddActor( _3DSliceActor );
373 _pRenderWindow->Render( );
375 //----------------------------------------------------------------------------
376 void vtk3DQuantSurfaceWidget::Hide3DSliceActor( )
378 _pRenderer->RemoveActor( _3DSliceActor );
379 _pRenderWindow->Render( );
381 //----------------------------------------------------------------------------
382 void vtk3DQuantSurfaceWidget::InitListContourActor(int type, int nos){
383 if ((type==0) || (type==-1)){ _lstContVtk->InitListContourActor(nos); }
384 if ((type==1) || (type==-1)){ _lstContHealtyVtk->InitListContourActor(nos); }
386 //----------------------------------------------------------------------------
387 void vtk3DQuantSurfaceWidget::Show3DContourActor( int type ){
388 if (type==0){ _lstContVtk->Show3DContourActor(); }
389 if (type==1){ _lstContHealtyVtk->Show3DContourActor(); }
391 //----------------------------------------------------------------------------
392 void vtk3DQuantSurfaceWidget::Hide3DContourActor( int type ){
393 if (type==0){ _lstContVtk->Hide3DContourActor(); }
394 if (type==1){ _lstContHealtyVtk->Hide3DContourActor(); }
396 //----------------------------------------------------------------------------
397 void vtk3DQuantSurfaceWidget::Set3DContourActor( int slice, vtkPoints* contour3D, bool showActor , int type){
398 if (type==0) { _lstContVtk->Set3DContourActor(slice,contour3D,showActor); }
399 if (type==1) { _lstContHealtyVtk->Set3DContourActor(slice,contour3D,showActor); }
401 //----------------------------------------------------------------------------
402 void vtk3DQuantSurfaceWidget::Erase3DContourActor( int slice){
403 _lstContVtk->EraseSliceContourActor(slice);
405 //----------------------------------------------------------------------------
406 void vtk3DQuantSurfaceWidget::Show3DHealthySliceActor( )
408 _pRenderer->AddActor( _hs_rectGuide->_actor );
409 _pRenderWindow->Render( );
411 //----------------------------------------------------------------------------
412 void vtk3DQuantSurfaceWidget::Hide3DHealthySliceActor( )
414 _pRenderer->RemoveActor( _hs_rectGuide->_actor );
415 _pRenderWindow->Render( );
417 //----------------------------------------------------------------------------
418 void vtk3DQuantSurfaceWidget::Set3DSliceActor( RectangleGuideVtk *_rectGuide ,float scale, int k,int r,int g,int b){
429 sizeIma = _mar->_experiment->getAxis( )->getParameters( )->getSizeIma( );
430 dimIma = _mar->_experiment->getAxis( )->getParameters( )->getDimIma( );
431 o = _mar->_experiment->getAxis( )->getSplinePoint(k);
432 c = _mar->_experiment->getAxis( )->getSplinePoint(k);
433 n = _mar->_experiment->getAxis( )->getNormal(k);
435 vtkPlaneSource* pSource = vtkPlaneSource::New( );
436 pSource->SetOrigin( o[0] , o[1], o[2] );
437 pSource->SetPoint1( o[0]+dimIma*scale - 1.0 , o[1], o[2] );
438 pSource->SetPoint2( o[0] , o[1], o[2]+dimIma*scale - 1.0 );
439 pSource->SetResolution( sizeIma - 1 , sizeIma - 1 );
441 pSource->SetCenter( c[ 0 ], c[ 1 ], c[ 2 ] );
442 pSource->SetNormal( n[ 0 ], n[ 1 ], n[ 2 ] );
444 pSource->GetOrigin( ori );
445 pSource->GetPoint1( p1 );
446 pSource->GetPoint2( p2 );
448 if (_rectGuide->_actor) _pRenderer->RemoveActor(_rectGuide->_actor);
449 if (_rectGuide->_grid) _rectGuide->_grid->Delete();
450 if (_rectGuide->_actor) _rectGuide->_actor->Delete();
451 if (_rectGuide->_points) _rectGuide->_points->Delete();
452 if (_rectGuide->_mapper) _rectGuide->_mapper->Delete();
453 if (_rectGuide->_poly_line) _rectGuide->_poly_line->Delete();
455 _rectGuide->_poly_line = vtkPolyLine::New();
456 ( _rectGuide->_poly_line->GetPointIds() )->SetNumberOfIds(8);
457 ( _rectGuide->_poly_line->GetPointIds() )->SetId(0,0);
458 ( _rectGuide->_poly_line->GetPointIds() )->SetId(1,1);
459 ( _rectGuide->_poly_line->GetPointIds() )->SetId(2,2);
460 ( _rectGuide->_poly_line->GetPointIds() )->SetId(3,3);
461 ( _rectGuide->_poly_line->GetPointIds() )->SetId(4,4);
462 ( _rectGuide->_poly_line->GetPointIds() )->SetId(5,5);
463 ( _rectGuide->_poly_line->GetPointIds() )->SetId(6,6);
464 ( _rectGuide->_poly_line->GetPointIds() )->SetId(7,7);
466 _rectGuide->_points=vtkPoints::New();
467 _rectGuide->_points->InsertNextPoint( ori[0] , ori[1] , ori[2] );
468 _rectGuide->_points->InsertNextPoint( p1[0] , p1[1] , p1[2] );
469 _rectGuide->_points->InsertNextPoint( p2[0]+p1[0]-ori[0], p2[1]+p1[1]-ori[1] , p2[2]+p1[2]-ori[2]);
470 _rectGuide->_points->InsertNextPoint( p2[0] , p2[1] , p2[2] );
471 _rectGuide->_points->InsertNextPoint( ori[0] , ori[1] , ori[2] );
472 _rectGuide->_points->InsertNextPoint( p2[0]+p1[0]-ori[0], p2[1]+p1[1]-ori[1] , p2[2]+p1[2]-ori[2]);
473 _rectGuide->_points->InsertNextPoint( p1[0] , p1[1] , p1[2] );
474 _rectGuide->_points->InsertNextPoint( p2[0] , p2[1] , p2[2] );
476 _rectGuide->_grid=vtkUnstructuredGrid::New();
477 _rectGuide->_grid->Allocate(1,1);
478 _rectGuide->_grid->InsertNextCell( _rectGuide->_poly_line->GetCellType() , _rectGuide->_poly_line->GetPointIds() );
479 _rectGuide->_grid->SetPoints( _rectGuide->_points );
481 _rectGuide->_mapper = vtkDataSetMapper::New();
482 _rectGuide->_mapper->SetInput(_rectGuide->_grid);
483 _rectGuide->_mapper->ImmediateModeRenderingOn();
485 _rectGuide->_actor=vtkActor::New();
486 _rectGuide->_actor->SetMapper(_rectGuide->_mapper);
487 _rectGuide->_actor->GetProperty()->BackfaceCullingOn();
488 _rectGuide->_actor->GetProperty()->SetDiffuseColor(r,g,b);
489 _rectGuide->_actor->PickableOff( );
490 _rectGuide->_iSlice = k;
492 //----------------------------------------------------------------------------
493 void vtk3DQuantSurfaceWidget::Set3DHealthySliceActor( ){
494 int k = _mar->_experiment->getAxis( )->getHealthySlice();
495 Set3DSliceActor( _hs_rectGuide , 1.0 , k ,0,0,1);
498 //----------------------------------------------------------------------------
499 void vtk3DQuantSurfaceWidget::Set3DRegionSliceActor( int type , int k1, int k2 ){
500 Set3DStartRegionSliceActor(type, k1);
501 Set3DEndRegionSliceActor(type, k2);
503 //----------------------------------------------------------------------------
504 void vtk3DQuantSurfaceWidget::Set3DStartRegionSliceActor( int type , int k ){
506 Set3DSliceActor( _s1_rectGuide , 0.3 , k ,1,0,0);
507 _mar->_experiment->getAxis()->setStartQuant(k);
510 Set3DSliceActor( _sA_rectGuide , 0.3 , k ,1,1,0);
513 //----------------------------------------------------------------------------
514 void vtk3DQuantSurfaceWidget::Set3DEndRegionSliceActor( int type , int k ){
516 Set3DSliceActor( _s2_rectGuide , 0.3 , k ,1,0,0);
517 _mar->_experiment->getAxis()->setFinishQuant(k);
520 Set3DSliceActor( _sB_rectGuide , 0.3 , k ,1,1,0);
523 //----------------------------------------------------------------------------
524 void vtk3DQuantSurfaceWidget::Show3DRegionSliceActor( int type ){
525 Show3DStartRegionSliceActor(type);
526 Show3DEndRegionSliceActor(type);
528 //----------------------------------------------------------------------------
529 void vtk3DQuantSurfaceWidget::Show3DStartRegionSliceActor( int type ){
530 if ((type==0) && (_s1_rectGuide->_iSlice!=-1)){
531 _pRenderer->AddActor( _s1_rectGuide->_actor );
532 _s1_rectGuide->_showActor=true;
534 if ((type==1) && (_sA_rectGuide->_iSlice!=-1)){
535 _pRenderer->AddActor( _sA_rectGuide->_actor );
536 _sA_rectGuide->_showActor=true;
538 _pRenderWindow->Render( );
540 //----------------------------------------------------------------------------
541 void vtk3DQuantSurfaceWidget::Show3DEndRegionSliceActor( int type ){
542 if ((type==0) && (_s2_rectGuide->_iSlice!=-1)){
543 _pRenderer->AddActor( _s2_rectGuide->_actor );
544 _s2_rectGuide->_showActor=true;
546 if ((type==1) && (_sB_rectGuide->_iSlice!=-1)){
547 _pRenderer->AddActor( _sB_rectGuide->_actor );
548 _sB_rectGuide->_showActor=true;
550 _pRenderWindow->Render( );
552 //----------------------------------------------------------------------------
553 void vtk3DQuantSurfaceWidget::Hide3DRegionSliceActor( int type ){
554 Hide3DStartRegionSliceActor(type );
555 Hide3DEndRegionSliceActor(type );
557 //----------------------------------------------------------------------------
558 void vtk3DQuantSurfaceWidget::Hide3DStartRegionSliceActor( int type ){
560 if (_s1_rectGuide->_showActor==true){
561 _pRenderer->RemoveActor( _s1_rectGuide->_actor );
562 _s1_rectGuide->_showActor=false;
566 if (_sA_rectGuide->_showActor==true){
567 _pRenderer->RemoveActor( _sA_rectGuide->_actor );
568 _sA_rectGuide->_showActor=false;
571 _pRenderWindow->Render( );
573 //----------------------------------------------------------------------------
574 void vtk3DQuantSurfaceWidget::Hide3DEndRegionSliceActor( int type ){
576 if (_s2_rectGuide->_showActor==true){
577 _pRenderer->RemoveActor( _s2_rectGuide->_actor );
578 _s2_rectGuide->_showActor=false;
582 if (_sB_rectGuide->_showActor==true){
583 _pRenderer->RemoveActor( _sB_rectGuide->_actor );
584 _sB_rectGuide->_showActor=false;
587 _pRenderWindow->Render( );
589 //----------------------------------------------------------------------------
590 void vtk3DQuantSurfaceWidget::GetSliceLimites(int type, int &sliceStart,int &sliceEnd){
592 sliceStart = _s1_rectGuide->_iSlice;
593 sliceEnd = _s2_rectGuide->_iSlice;
596 sliceStart = _sA_rectGuide->_iSlice;
597 sliceEnd = _sB_rectGuide->_iSlice;
600 //--------------------------------------------------------------------
601 int vtk3DQuantSurfaceWidget::GetAnalysisTypeStenosis(){
602 return _analysisTypeStenosis;
604 //--------------------------------------------------------------------
605 void vtk3DQuantSurfaceWidget::SetAnalysisTypeStenosis(int analysisTypeStenosis){
606 _analysisTypeStenosis=analysisTypeStenosis;