1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
26 /*=========================================================================
29 Module: $RCSfile: vtk3DQuantSurfaceWidget.cxx,v $
31 Date: $Date: 2012/11/15 14:15:17 $
32 Version: $Revision: 1.2 $
34 Copyright: (c) 2002, 2003
37 This software is distributed WITHOUT ANY WARRANTY; without even
38 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
39 PURPOSE. See the above copyright notice for more information.
41 =========================================================================*/
42 #include "vtk3DQuantSurfaceWidget.h"
43 #include <vtkPointPicker.h>
44 #include <vtkCamera.h>
45 #include <vtkWindowLevelLookupTable.h>
47 #include <vtkPolyLine.h>
48 #include <vtkPlaneSource.h>
52 //----------------------------------------------------------------------------
53 RectangleGuideVtk::RectangleGuideVtk(){
62 //----------------------------------------------------------------------------
63 RectangleGuideVtk::~RectangleGuideVtk(){
64 if( _grid ) _grid->Delete();
65 if( _actor ) _actor->Delete();
66 if( _points ) _points->Delete();
67 if( _mapper ) _mapper->Delete();
68 if( _poly_line ) _poly_line->Delete();
71 //----------------------------------------------------------------------------
72 //----------------------------------------------------------------------------
73 //----------------------------------------------------------------------------
74 //----------------------------------------------------------------------------
75 listContourVTK::listContourVTK(vtk3DQuantSurfaceWidget *quantSurfaceWidget){
79 _vtk3DQuantSurfaceWidget=quantSurfaceWidget;
81 //----------------------------------------------------------------------------
82 listContourVTK::~listContourVTK(){
83 EraseListContourActor();
85 //----------------------------------------------------------------------------
86 void listContourVTK::SetColour(int r,int g,int b){
91 //----------------------------------------------------------------------------
92 void listContourVTK::InitListContourActor(int nos){
93 EraseListContourActor();
96 _lst3DContoursVtkActor.push_back( NULL );
97 _lst3DContoursVtkUnstructuredGrid.push_back( NULL );
98 _lst3DContoursVtkDataSetMapper.push_back( NULL );
99 _lst3DContoursVtkPolyLine.push_back( NULL );
104 // vtkRenderWindow* pRenderWindow = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderWindow();
105 // pRenderWindow->Render( );
107 //----------------------------------------------------------------------------
108 void listContourVTK::EraseListContourActor(){
110 for (i=0;i<_lst3DContoursVtkActor.size();i++){
111 EraseSliceContourActor(i,false);
113 _lst3DContoursVtkActor.clear();
114 _lst3DContoursVtkUnstructuredGrid.clear();
115 _lst3DContoursVtkDataSetMapper.clear();
116 _lst3DContoursVtkPolyLine.clear();
118 //----------------------------------------------------------------------------
119 void listContourVTK::EraseSliceContourActor(int slice, bool refresh){
120 if (_lst3DContoursVtkActor[slice]!=NULL){
121 vtkRenderer *pRenderer = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderer();
122 if (_lst3DContoursVtkActor[slice]) pRenderer->RemoveActor(_lst3DContoursVtkActor[slice]);
123 if (_lst3DContoursVtkUnstructuredGrid[slice]) _lst3DContoursVtkUnstructuredGrid[slice]->Delete();
124 if (_lst3DContoursVtkDataSetMapper[slice]) _lst3DContoursVtkDataSetMapper[slice]->Delete();
125 if (_lst3DContoursVtkPolyLine[slice]) _lst3DContoursVtkPolyLine[slice]->Delete();
126 if (_lst3DContoursVtkActor[slice]) _lst3DContoursVtkActor[slice]->Delete();
127 _lst3DContoursVtkUnstructuredGrid[slice]=NULL;
128 _lst3DContoursVtkDataSetMapper[slice]=NULL;
129 _lst3DContoursVtkPolyLine[slice]=NULL;
130 _lst3DContoursVtkActor[slice]=NULL;
134 vtkRenderWindow* pRenderWindow = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderWindow();
135 pRenderWindow->Render( );
138 //----------------------------------------------------------------------------
139 void listContourVTK::Set3DContourActor( int slice, vtkPoints* contour3D, bool showActor){
141 EraseSliceContourActor(slice);
142 // generate new actor
143 int id,numberOfPoints;
144 numberOfPoints=contour3D->GetNumberOfPoints ();
145 _lst3DContoursVtkPolyLine[slice] = vtkPolyLine::New();
147 ( _lst3DContoursVtkPolyLine[slice]->GetPointIds() )->SetNumberOfIds(numberOfPoints);
148 for (id=0;id<numberOfPoints;id++){
149 ( _lst3DContoursVtkPolyLine[slice]->GetPointIds() )->SetId(id,id);
151 _lst3DContoursVtkUnstructuredGrid[slice]=vtkUnstructuredGrid::New();
152 _lst3DContoursVtkUnstructuredGrid[slice]->Allocate(1,1);
153 _lst3DContoursVtkUnstructuredGrid[slice]->InsertNextCell( _lst3DContoursVtkPolyLine[slice]->GetCellType() ,
154 _lst3DContoursVtkPolyLine[slice]->GetPointIds() );
155 _lst3DContoursVtkUnstructuredGrid[slice]->SetPoints( contour3D );
156 _lst3DContoursVtkDataSetMapper[slice] = vtkDataSetMapper::New();
157 _lst3DContoursVtkDataSetMapper[slice]->SetInput(_lst3DContoursVtkUnstructuredGrid[slice]);
158 _lst3DContoursVtkDataSetMapper[slice]->ImmediateModeRenderingOn();
159 _lst3DContoursVtkActor[slice]=vtkActor::New();
160 _lst3DContoursVtkActor[slice]->SetMapper(_lst3DContoursVtkDataSetMapper[slice]);
161 _lst3DContoursVtkActor[slice]->GetProperty()->BackfaceCullingOn();
162 _lst3DContoursVtkActor[slice]->GetProperty()->SetDiffuseColor(_r,_g,_b);
163 _lst3DContoursVtkActor[slice]->PickableOff( );
165 vtkRenderer *pRenderer = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderer();
166 vtkRenderWindow* pRenderWindow = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderWindow();
168 if (showActor==true){
169 pRenderer->AddActor( _lst3DContoursVtkActor[slice] );
172 pRenderWindow->Render( );
176 //----------------------------------------------------------------------------
177 void listContourVTK::Show3DContourActor( ){
178 vtkRenderer *pRenderer = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderer();
179 vtkRenderWindow* pRenderWindow = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderWindow();
181 for (i=0;i<_lst3DContoursVtkActor.size();i++){
182 if (_lst3DContoursVtkActor[i]!=NULL) pRenderer->AddActor( _lst3DContoursVtkActor[i] );
185 pRenderWindow->Render( );
187 //----------------------------------------------------------------------------
188 void listContourVTK::Hide3DContourActor( ){
189 vtkRenderer *pRenderer = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderer();
190 vtkRenderWindow* pRenderWindow = _vtk3DQuantSurfaceWidget->QuantSurfaceWidget_GetRenderWindow();
192 for (i=0;i<_lst3DContoursVtkActor.size();i++){
193 if (_lst3DContoursVtkActor[i]!=NULL) pRenderer->RemoveActor( _lst3DContoursVtkActor[i] );
196 pRenderWindow->Render( );
200 //----------------------------------------------------------------------------
201 //----------------------------------------------------------------------------
202 //----------------------------------------------------------------------------
209 * Again wxVTK is an hybrid class, double click was done using wxWindows, simply
210 * because VTK doesn't provide such facility (as opposed to wheel support that is
211 * supposed to be merged in VTK trunk sooner or later:
213 * http://public.kitware.com/pipermail/vtkusers/2003-August/019548.html
214 * http://www.creatis.insa-lyon.fr/~malaterre/vtk/wheel.patch
217 //----------------------------------------------------------------------------
219 BEGIN_EVENT_TABLE( vtk3DQuantSurfaceWidget, vtk3DSurfaceWidget )
220 // EVT_LEFT_DCLICK( vtk3DQuantSurfaceWidget::OnLeftDClick )
221 // EVT_MOUSEWHEEL( vtk3DQuantSurfaceWidget::OnMouseWheel )
224 //----------------------------------------------------------------------------
225 vtk3DQuantSurfaceWidget::vtk3DQuantSurfaceWidget(
231 const wxString& name)
232 : vtk3DSurfaceWidget( parent, id, pos, size, style, name ){
233 _3DSliceMapper = NULL;
234 _3DSliceActor = NULL;
237 _hs_rectGuide = new RectangleGuideVtk();
238 _s1_rectGuide = new RectangleGuideVtk();
239 _s2_rectGuide = new RectangleGuideVtk();
240 _sA_rectGuide = new RectangleGuideVtk();
241 _sB_rectGuide = new RectangleGuideVtk();
243 _lstContVtk = new listContourVTK(this);
244 _lstContHealtyVtk = new listContourVTK(this);
245 _lstContVtk->SetColour(1,1,0);
246 _lstContHealtyVtk->SetColour(0,0,1);
250 vtk3DQuantSurfaceWidget::~vtk3DQuantSurfaceWidget()
252 if( _3DSliceActor ) _3DSliceActor ->Delete();
253 if( _3DSliceMapper) _3DSliceMapper ->Delete();
254 if( _bwlookup ) _bwlookup ->Delete();
255 if( _collookup ) _collookup ->Delete();
257 delete _hs_rectGuide;
258 delete _s1_rectGuide;
259 delete _s2_rectGuide;
260 delete _sA_rectGuide;
261 delete _sB_rectGuide;
264 delete _lstContHealtyVtk;
268 //----------------------------------------------------------------------------
269 void vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxe( marInterface* mar )
272 vtkPolyData *allData;
274 vtkProbeFilter *pFilter;
276 this->ShowMARACASData( mar );
277 this->ConfigureVTK();
279 _pRenderer->SetBackground( 0.35, 0.35, 0.35 );
282 _mar->_experiment->setAxis( 0 );
283 temp = _mar->_experiment->getAxis( ); // ??? getActualAxis ??
284 allData = temp->Draw( );
286 nos = _mar->_experiment->getNumberOfSlices( );
287 pFilter = _mar->_experiment->get3DSlice( (int) (nos-1)/2 );
289 _bwlookup = vtkWindowLevelLookupTable::New( );
290 _bwlookup->SetHueRange( 0 , 1 );
291 _bwlookup->SetNumberOfColors( (int)(_range[1] - _range[0] + 1) );
292 _bwlookup->SetTableRange( _range[0] , _range[1] );
293 _bwlookup->SetSaturationRange( 0 , 0 );
294 _bwlookup->SetValueRange( 0 , 1 );
295 _bwlookup->SetAlphaRange( 1 , 1 );
298 _collookup = vtkLookupTable::New( );
299 _collookup->SetNumberOfColors( 256 );
300 _collookup->SetTableRange( 0 , 255 );
301 _collookup->Build( );
302 _collookup->SetTableValue( 0 , 1 , 0 , 0 , 1 );
303 _collookup->SetTableValue(128 , 0 , 0 , 1 , 1 );
304 _collookup->SetTableValue(255 , 0 , 1 , 0 , 1 );
306 _3DSliceMapper = vtkDataSetMapper::New( );
307 _3DSliceMapper->SetInput(pFilter->GetOutput( ) );
308 _3DSliceMapper->SetLookupTable( _bwlookup );
309 _3DSliceMapper->SetScalarRange( _range );
310 _3DSliceMapper->ImmediateModeRenderingOn( );
312 _3DSliceActor = vtkActor::New( );
313 _3DSliceActor->SetMapper( _3DSliceMapper );
314 _pRenderer->AddActor( _3DSliceActor);
316 _lstContVtk->InitListContourActor(nos);
317 _lstContHealtyVtk->InitListContourActor(nos);
319 this->SetAxis( allData );
322 //----------------------------------------------------------------------------
324 //----------------------------------------------------------------------------
325 void vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxeCT( marInterfaceCT* mar )
328 vtkPolyData *allData;
330 vtkProbeFilter *pFilter;
332 this->ShowMARACASDataCT( mar );
333 this->ConfigureVTK();
335 _pRenderer->SetBackground( 0.75, 0.75, 0.75 );
338 _marCT->setAxis( 0 );
339 temp = _marCT->getAxis( ); // ??? getActualAxis ??
340 allData = temp->Draw( );
342 nos = _marCT->getNumberOfSlices( );
343 pFilter = _marCT->get3DSlice( (int) (nos-1)/2 );
345 _bwlookup = vtkWindowLevelLookupTable::New( );
346 _bwlookup->SetHueRange( 0 , 1 );
347 _bwlookup->SetNumberOfColors( (int)(_range[1] - _range[0] + 1) );
348 _bwlookup->SetTableRange( _range[0] , _range[1] );
349 _bwlookup->SetSaturationRange( 0 , 0 );
350 _bwlookup->SetValueRange( 0 , 1 );
351 _bwlookup->SetAlphaRange( 1 , 1 );
354 _collookup = vtkLookupTable::New( );
355 _collookup->SetNumberOfColors( 256 );
356 _collookup->SetTableRange( 0 , 255 );
357 _collookup->Build( );
358 _collookup->SetTableValue( 0 , 1 , 0 , 0 , 1 );
359 _collookup->SetTableValue(128 , 0 , 0 , 1 , 1 );
360 _collookup->SetTableValue(255 , 0 , 1 , 0 , 1 );
362 _3DSliceMapper = vtkDataSetMapper::New( );
363 _3DSliceMapper->SetInput(pFilter->GetOutput( ) );
364 _3DSliceMapper->SetLookupTable( _bwlookup );
365 _3DSliceMapper->SetScalarRange( _range );
366 _3DSliceMapper->ImmediateModeRenderingOn( );
368 _3DSliceActor = vtkActor::New( );
369 _3DSliceActor->SetMapper( _3DSliceMapper );
370 _pRenderer->AddActor( _3DSliceActor);
372 _lstContVtk->InitListContourActor(nos);
373 _lstContHealtyVtk->InitListContourActor(nos);
375 this->SetAxis( allData );
378 //----------------------------------------------------------------------------
380 void vtk3DQuantSurfaceWidget::SetBWLookUp(){
381 _3DSliceMapper->SetLookupTable( _bwlookup );
382 _pRenderWindow->Render( );
384 //----------------------------------------------------------------------------
385 void vtk3DQuantSurfaceWidget::SetColorLookUp(){
386 _3DSliceMapper->SetLookupTable( _collookup );
387 _pRenderWindow->Render( );
389 //----------------------------------------------------------------------------
390 void vtk3DQuantSurfaceWidget::SetImage( vtkProbeFilter* pFilter )
392 _3DSliceMapper->SetInput(pFilter->GetOutput( ) );
394 //----------------------------------------------------------------------------
395 void vtk3DQuantSurfaceWidget::Show3DSliceActor( )
397 _pRenderer->AddActor( _3DSliceActor );
398 _pRenderWindow->Render( );
400 //----------------------------------------------------------------------------
401 void vtk3DQuantSurfaceWidget::Hide3DSliceActor( )
403 _pRenderer->RemoveActor( _3DSliceActor );
404 _pRenderWindow->Render( );
406 //----------------------------------------------------------------------------
407 void vtk3DQuantSurfaceWidget::InitListContourActor(int type, int nos){
408 if ((type==0) || (type==-1)){ _lstContVtk->InitListContourActor(nos); }
409 if ((type==1) || (type==-1)){ _lstContHealtyVtk->InitListContourActor(nos); }
411 //----------------------------------------------------------------------------
412 void vtk3DQuantSurfaceWidget::Show3DContourActor( int type ){
413 if (type==0){ _lstContVtk->Show3DContourActor(); }
414 if (type==1){ _lstContHealtyVtk->Show3DContourActor(); }
416 //----------------------------------------------------------------------------
417 void vtk3DQuantSurfaceWidget::Hide3DContourActor( int type ){
418 if (type==0){ _lstContVtk->Hide3DContourActor(); }
419 if (type==1){ _lstContHealtyVtk->Hide3DContourActor(); }
421 //----------------------------------------------------------------------------
422 void vtk3DQuantSurfaceWidget::Set3DContourActor( int slice, vtkPoints* contour3D, bool showActor , int type){
423 if (type==0) { _lstContVtk->Set3DContourActor(slice,contour3D,showActor); }
424 if (type==1) { _lstContHealtyVtk->Set3DContourActor(slice,contour3D,showActor); }
426 //----------------------------------------------------------------------------
427 void vtk3DQuantSurfaceWidget::Erase3DContourActor( int slice){
428 _lstContVtk->EraseSliceContourActor(slice);
430 //----------------------------------------------------------------------------
431 void vtk3DQuantSurfaceWidget::Show3DHealthySliceActor( )
433 _pRenderer->AddActor( _hs_rectGuide->_actor );
434 _pRenderWindow->Render( );
436 //----------------------------------------------------------------------------
437 void vtk3DQuantSurfaceWidget::Hide3DHealthySliceActor( )
439 _pRenderer->RemoveActor( _hs_rectGuide->_actor );
440 _pRenderWindow->Render( );
442 //----------------------------------------------------------------------------
443 void vtk3DQuantSurfaceWidget::Set3DSliceActor( RectangleGuideVtk *_rectGuide ,float scale, int k,int r,int g,int b){
454 sizeIma = _mar->_experiment->getAxis( )->getParameters( )->getSizeIma( );
455 dimIma = _mar->_experiment->getAxis( )->getParameters( )->getDimIma( );
456 o = _mar->_experiment->getAxis( )->getSplinePoint(k);
457 c = _mar->_experiment->getAxis( )->getSplinePoint(k);
458 n = _mar->_experiment->getAxis( )->getNormal(k);
460 vtkPlaneSource* pSource = vtkPlaneSource::New( );
461 pSource->SetOrigin( o[0] , o[1], o[2] );
462 pSource->SetPoint1( o[0]+dimIma*scale - 1.0 , o[1], o[2] );
463 pSource->SetPoint2( o[0] , o[1], o[2]+dimIma*scale - 1.0 );
464 pSource->SetResolution( sizeIma - 1 , sizeIma - 1 );
466 pSource->SetCenter( c[ 0 ], c[ 1 ], c[ 2 ] );
467 pSource->SetNormal( n[ 0 ], n[ 1 ], n[ 2 ] );
469 pSource->GetOrigin( ori );
470 pSource->GetPoint1( p1 );
471 pSource->GetPoint2( p2 );
473 if (_rectGuide->_actor) _pRenderer->RemoveActor(_rectGuide->_actor);
474 if (_rectGuide->_grid) _rectGuide->_grid->Delete();
475 if (_rectGuide->_actor) _rectGuide->_actor->Delete();
476 if (_rectGuide->_points) _rectGuide->_points->Delete();
477 if (_rectGuide->_mapper) _rectGuide->_mapper->Delete();
478 if (_rectGuide->_poly_line) _rectGuide->_poly_line->Delete();
480 _rectGuide->_poly_line = vtkPolyLine::New();
481 ( _rectGuide->_poly_line->GetPointIds() )->SetNumberOfIds(8);
482 ( _rectGuide->_poly_line->GetPointIds() )->SetId(0,0);
483 ( _rectGuide->_poly_line->GetPointIds() )->SetId(1,1);
484 ( _rectGuide->_poly_line->GetPointIds() )->SetId(2,2);
485 ( _rectGuide->_poly_line->GetPointIds() )->SetId(3,3);
486 ( _rectGuide->_poly_line->GetPointIds() )->SetId(4,4);
487 ( _rectGuide->_poly_line->GetPointIds() )->SetId(5,5);
488 ( _rectGuide->_poly_line->GetPointIds() )->SetId(6,6);
489 ( _rectGuide->_poly_line->GetPointIds() )->SetId(7,7);
491 _rectGuide->_points=vtkPoints::New();
492 _rectGuide->_points->InsertNextPoint( ori[0] , ori[1] , ori[2] );
493 _rectGuide->_points->InsertNextPoint( p1[0] , p1[1] , p1[2] );
494 _rectGuide->_points->InsertNextPoint( p2[0]+p1[0]-ori[0], p2[1]+p1[1]-ori[1] , p2[2]+p1[2]-ori[2]);
495 _rectGuide->_points->InsertNextPoint( p2[0] , p2[1] , p2[2] );
496 _rectGuide->_points->InsertNextPoint( ori[0] , ori[1] , ori[2] );
497 _rectGuide->_points->InsertNextPoint( p2[0]+p1[0]-ori[0], p2[1]+p1[1]-ori[1] , p2[2]+p1[2]-ori[2]);
498 _rectGuide->_points->InsertNextPoint( p1[0] , p1[1] , p1[2] );
499 _rectGuide->_points->InsertNextPoint( p2[0] , p2[1] , p2[2] );
501 _rectGuide->_grid=vtkUnstructuredGrid::New();
502 _rectGuide->_grid->Allocate(1,1);
503 _rectGuide->_grid->InsertNextCell( _rectGuide->_poly_line->GetCellType() , _rectGuide->_poly_line->GetPointIds() );
504 _rectGuide->_grid->SetPoints( _rectGuide->_points );
506 _rectGuide->_mapper = vtkDataSetMapper::New();
507 _rectGuide->_mapper->SetInput(_rectGuide->_grid);
508 _rectGuide->_mapper->ImmediateModeRenderingOn();
510 _rectGuide->_actor=vtkActor::New();
511 _rectGuide->_actor->SetMapper(_rectGuide->_mapper);
512 _rectGuide->_actor->GetProperty()->BackfaceCullingOn();
513 _rectGuide->_actor->GetProperty()->SetDiffuseColor(r,g,b);
514 _rectGuide->_actor->PickableOff( );
515 _rectGuide->_iSlice = k;
517 //----------------------------------------------------------------------------
518 void vtk3DQuantSurfaceWidget::Set3DHealthySliceActor( ){
519 int k = _mar->_experiment->getAxis( )->getHealthySlice();
520 Set3DSliceActor( _hs_rectGuide , 1.0 , k ,0,0,1);
523 //----------------------------------------------------------------------------
524 void vtk3DQuantSurfaceWidget::Set3DRegionSliceActor( int type , int k1, int k2 ){
525 Set3DStartRegionSliceActor(type, k1);
526 Set3DEndRegionSliceActor(type, k2);
528 //----------------------------------------------------------------------------
529 void vtk3DQuantSurfaceWidget::Set3DStartRegionSliceActor( int type , int k ){
531 Set3DSliceActor( _s1_rectGuide , 0.3 , k ,1,0,0);
532 _mar->_experiment->getAxis()->setStartQuant(k);
535 Set3DSliceActor( _sA_rectGuide , 0.3 , k ,1,1,0);
538 //----------------------------------------------------------------------------
539 void vtk3DQuantSurfaceWidget::Set3DEndRegionSliceActor( int type , int k ){
541 Set3DSliceActor( _s2_rectGuide , 0.3 , k ,1,0,0);
542 _mar->_experiment->getAxis()->setFinishQuant(k);
545 Set3DSliceActor( _sB_rectGuide , 0.3 , k ,1,1,0);
548 //----------------------------------------------------------------------------
549 void vtk3DQuantSurfaceWidget::Show3DRegionSliceActor( int type ){
550 Show3DStartRegionSliceActor(type);
551 Show3DEndRegionSliceActor(type);
553 //----------------------------------------------------------------------------
554 void vtk3DQuantSurfaceWidget::Show3DStartRegionSliceActor( int type ){
555 if ((type==0) && (_s1_rectGuide->_iSlice!=-1)){
556 _pRenderer->AddActor( _s1_rectGuide->_actor );
557 _s1_rectGuide->_showActor=true;
559 if ((type==1) && (_sA_rectGuide->_iSlice!=-1)){
560 _pRenderer->AddActor( _sA_rectGuide->_actor );
561 _sA_rectGuide->_showActor=true;
563 _pRenderWindow->Render( );
565 //----------------------------------------------------------------------------
566 void vtk3DQuantSurfaceWidget::Show3DEndRegionSliceActor( int type ){
567 if ((type==0) && (_s2_rectGuide->_iSlice!=-1)){
568 _pRenderer->AddActor( _s2_rectGuide->_actor );
569 _s2_rectGuide->_showActor=true;
571 if ((type==1) && (_sB_rectGuide->_iSlice!=-1)){
572 _pRenderer->AddActor( _sB_rectGuide->_actor );
573 _sB_rectGuide->_showActor=true;
575 _pRenderWindow->Render( );
577 //----------------------------------------------------------------------------
578 void vtk3DQuantSurfaceWidget::Hide3DRegionSliceActor( int type ){
579 Hide3DStartRegionSliceActor(type );
580 Hide3DEndRegionSliceActor(type );
582 //----------------------------------------------------------------------------
583 void vtk3DQuantSurfaceWidget::Hide3DStartRegionSliceActor( int type ){
585 if (_s1_rectGuide->_showActor==true){
586 _pRenderer->RemoveActor( _s1_rectGuide->_actor );
587 _s1_rectGuide->_showActor=false;
591 if (_sA_rectGuide->_showActor==true){
592 _pRenderer->RemoveActor( _sA_rectGuide->_actor );
593 _sA_rectGuide->_showActor=false;
596 _pRenderWindow->Render( );
598 //----------------------------------------------------------------------------
599 void vtk3DQuantSurfaceWidget::Hide3DEndRegionSliceActor( int type ){
601 if (_s2_rectGuide->_showActor==true){
602 _pRenderer->RemoveActor( _s2_rectGuide->_actor );
603 _s2_rectGuide->_showActor=false;
607 if (_sB_rectGuide->_showActor==true){
608 _pRenderer->RemoveActor( _sB_rectGuide->_actor );
609 _sB_rectGuide->_showActor=false;
612 _pRenderWindow->Render( );
614 //----------------------------------------------------------------------------
615 void vtk3DQuantSurfaceWidget::GetSliceLimites(int type, int &sliceStart,int &sliceEnd){
617 sliceStart = _s1_rectGuide->_iSlice;
618 sliceEnd = _s2_rectGuide->_iSlice;
621 sliceStart = _sA_rectGuide->_iSlice;
622 sliceEnd = _sB_rectGuide->_iSlice;
625 //--------------------------------------------------------------------
626 int vtk3DQuantSurfaceWidget::GetAnalysisTypeStenosis(){
627 return _analysisTypeStenosis;
629 //--------------------------------------------------------------------
630 void vtk3DQuantSurfaceWidget::SetAnalysisTypeStenosis(int analysisTypeStenosis){
631 _analysisTypeStenosis=analysisTypeStenosis;