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 # ------------------------------------------------------------------------ */
27 #include "vtkClipping3DDataViewer.h"
28 #include "vtkDataSetReader.h"
29 #include "vtkProperty.h"
31 vtkClipping3DDataViewer::vtkClipping3DDataViewer()
34 for (i=0; i<VTKMPRDATA_MAXTISSUE; i++)
36 _visibleTissue[i] = false;
37 _representationType[i] = true;
39 _visibleVolume = false;
42 _interpolation = false;
45 _volumerendererdata = VolumeRendererData::New();
46 _volumeMapper = vtkVolumeRayCastMapper::New();
47 _newvol = vtkVolume::New();
48 _volumeProperty = vtkVolumeProperty::New();
49 _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
50 _compositeFunctionMIP = vtkVolumeRayCastMIPFunction::New();
53 //-------------------------------------------------------------------
54 vtkClipping3DDataViewer::~vtkClipping3DDataViewer()
57 for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
59 _tissueStripper[i]->Delete();
60 _tissueMapper[i]->Delete();
61 _tissuePlanes[i]->Delete();
62 _tissueClipper[i]->Delete();
64 _outlineData->Delete();
65 _mapOutline->Delete();
70 _compositeFunction->Delete();
71 _volumeMapper->Delete();
72 _volumeProperty->Delete();
74 _volumePlanes->Delete();
76 for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
77 _tissue[i]-> Delete();
78 _observerS[i]-> Delete();
80 _observerV-> Delete();
82 //-------------------------------------------------------------------
83 vtkActor* vtkClipping3DDataViewer::GetOutlineActor()
87 //-------------------------------------------------------------------
88 vtkClipPolyData* vtkClipping3DDataViewer::GetTissueClipper(int id)
90 return this->_tissueClipper[id];
92 //-------------------------------------------------------------------
93 vtkPolyDataMapper* vtkClipping3DDataViewer::GetTissueMapper(int id)
95 return _tissueMapper[id];
97 //-------------------------------------------------------------------
98 vtkPlanes* vtkClipping3DDataViewer::GetTissuePlanes(int id)
100 return _tissuePlanes[id];
102 //-------------------------------------------------------------------
103 vtkStripper* vtkClipping3DDataViewer::GetTissueStripper(int id)
105 return _tissueStripper[id];
107 //-------------------------------------------------------------------
108 void vtkClipping3DDataViewer::Refresh()
110 // _volumeMapper->SetClippingPlanes(_volumePlanes);
112 // this->_volumeMapper->Update();
113 // this->_newvol->Update();
115 // _newvol->VisibilityOn();
118 // _volumeMapper = vtkVolumeRayCastMapper::New();
119 // _volumeMapper->SetInput( this->GetVtkMPRBaseData()->GetImageData() );
120 // _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
121 // _volumeMapper->SetClippingPlanes( _volumePlanes );
122 // _newvol->SetMapper(_volumeMapper );
126 //-------------------------------------------------------------------
127 void vtkClipping3DDataViewer::RefreshSurface()
130 for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
132 SetIsovalue(i, (int) (GetIsovalue(i)+1) );
133 // this->GetMCubes(i)->Update();
136 //-------------------------------------------------------------------
137 void vtkClipping3DDataViewer::SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata)
139 _vtkmprbasedata=vtkmprbasedata;
141 //-------------------------------------------------------------------
142 vtkMPRBaseData* vtkClipping3DDataViewer::GetVtkMPRBaseData()
144 return _vtkmprbasedata;
148 //-------------------------------------------------------------------
149 void vtkClipping3DDataViewer::SetVisibleTissue(int idTissue, bool visible)
151 _visibleTissue[idTissue]=visible;
153 //-------------------------------------------------------------------
154 bool vtkClipping3DDataViewer::GetVisibleTissue(int idTissue){
155 return _visibleTissue[idTissue];
157 //-------------------------------------------------------------------
158 void vtkClipping3DDataViewer::SetRepresentationType(int idTissue, bool representationType)
160 _representationType[idTissue]=representationType;
162 //-------------------------------------------------------------------
163 bool vtkClipping3DDataViewer::GetRepresentationType(int idTissue)
165 return _representationType[idTissue];
168 //-------------------------------------------------------------------
169 vtkActor* vtkClipping3DDataViewer::GetTissueActor(int id){
173 //-------------------------------------------------------------------
174 boxSurfaceObserver *vtkClipping3DDataViewer::GetObserverS(int idObserverS)
176 return _observerS[idObserverS];
178 //-------------------------------------------------------------------
179 boxSurfaceObserver *vtkClipping3DDataViewer::GetObserverV()
184 //-------------------------------------------------------------------
185 bool vtkClipping3DDataViewer::GetVisibleVolume()
187 return _visibleVolume;
189 //-------------------------------------------------------------------
190 void vtkClipping3DDataViewer::SetVisibleVolume(bool visiblevolume)
192 _visibleVolume = visiblevolume;
195 bool vtkClipping3DDataViewer::GetVisibleVolumeBox()
197 return _visibleVolumeBox;
199 //-------------------------------------------------------------------
200 void vtkClipping3DDataViewer::SetVisibleVolumeBox(bool visibleBox)
202 _visibleVolumeBox = visibleBox;
206 //-------------------------------------------------------------------
207 void vtkClipping3DDataViewer::SetImage()
210 vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
211 for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
213 _mCubes[i]->SetInput( imagedata );
215 _volumeMapper->SetInput( imagedata );
216 _volumerendererdata->SetImageData( imagedata );
219 //-------------------------------------------------------------------
220 void vtkClipping3DDataViewer::Configure_Tissue()
224 vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
225 imagedata->GetScalarRange( range );
226 for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
228 // Visualisation - original volume
229 _mCubes[i] = vtkMarchingCubes::New( );
230 _mCubes[i]->SetInput( imagedata );
231 _mCubes[i]->SetValue( 0, range[1]*(4+i) / 8 );
232 // _mCubes[i]->SetValue( 0, 1500 );
233 _tissueStripper[i] = vtkStripper::New();
234 _tissueStripper[i]->SetInput( _mCubes[i]->GetOutput( ) );
235 _tissuePlanes[i] = vtkPlanes::New();
236 int x1,x2,y1,y2,z1,z2;
237 imagedata->GetExtent(x1,x2,y1,y2,z1,z2);
238 _tissuePlanes[i]->SetBounds (x1,x2,y1,y2,z1,z2);
239 _tissueClipper[i] = vtkClipPolyData::New();
240 _tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() );
241 _tissueClipper[i]->SetClipFunction( _tissuePlanes[i] );
242 _tissueClipper[i]->InsideOutOn( );
243 _tissueMapper[i] = vtkPolyDataMapper::New( );
244 _tissueMapper[i]->SetInput( _tissueClipper[i]->GetOutput() );
245 _tissueMapper[i]->ScalarVisibilityOff( );
246 // _tissueMapper[i]->Update();
250 for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
252 _tissue[i] = vtkActor::New();
253 _tissue[i]->SetMapper( GetTissueMapper(i) );
254 float cr=1,cg=0.5,cb=0.5;
255 _tissue[i]->GetProperty()->SetDiffuseColor(cr/255, cg/255 , cb/255 );
256 _tissue[i]->GetProperty()->SetSpecular(.3);
257 _tissue[i]->GetProperty()->SetSpecularPower(20);
258 _tissue[i]->GetProperty()->SetOpacity(0.5);
259 if (i==0) _tissue[i]->GetProperty()->SetColor(0.85, 0.85 , 0.85 );
260 if (i==1) _tissue[i]->GetProperty()->SetColor(0, 0 , 1 );
261 if (i==2) _tissue[i]->GetProperty()->SetColor(0.85, 0.20 , 0.20 );
262 if (i==3) _tissue[i]->GetProperty()->SetColor(0, 1 , 0 );
265 for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
267 _observerS[i] = boxSurfaceObserver::New();
268 _observerS[i]->SetPlanes( GetTissuePlanes(i) );
269 _observerS[i]->SetActor( _tissue[i] );
274 //-----------------------------------------------------------------------------
276 void vtkClipping3DDataViewer::Configure_Volume()
280 /** if(_newvol != NULL)
283 _volumeMapper->Delete();
284 _volumeProperty->Delete();
287 _tfun = vtkPiecewiseFunction::New();
288 _ctfun = vtkColorTransferFunction::New();
291 this->_vtkmprbasedata->GetImageData()->GetScalarRange(range);
292 double max = range[1];
295 adding the poinst of the transference function
298 greyValuesTransferenceFVector.push_back(max * 0/2); // JPR ?? 0/2
299 greyValuesTransferenceFVector.push_back(max * 1/2); // JPR ?? division entiere?
300 greyValuesTransferenceFVector.push_back(max * 2/2);
302 intensityValuesTransferenceFVector.push_back(0.0);
303 intensityValuesTransferenceFVector.push_back(1.0);
304 intensityValuesTransferenceFVector.push_back(1.0);
306 _tfun->AddPoint(max * 0/2 , 0.0);
307 _tfun->AddPoint(max * 1/2 , 1.0);
308 _tfun->AddPoint(max * 2/2 , 1.0);
311 Adding the colors to the vectors
314 redColorsOfColorTransferenceFVector.push_back(0.0);
315 redColorsOfColorTransferenceFVector.push_back(1.0);
316 redColorsOfColorTransferenceFVector.push_back(0.0);
317 redColorsOfColorTransferenceFVector.push_back(0.0);
318 redColorsOfColorTransferenceFVector.push_back(0.0);
321 greenColorsOfColorTransferenceFVector.push_back(0.0);
322 greenColorsOfColorTransferenceFVector.push_back(0.0);
323 greenColorsOfColorTransferenceFVector.push_back(0.0);
324 greenColorsOfColorTransferenceFVector.push_back(1.0);
325 greenColorsOfColorTransferenceFVector.push_back(0.2);
328 blueColorsOfColorTransferenceFVector.push_back(0.0);
329 blueColorsOfColorTransferenceFVector.push_back(0.0);
330 blueColorsOfColorTransferenceFVector.push_back(1.0);
331 blueColorsOfColorTransferenceFVector.push_back(0.0);
332 blueColorsOfColorTransferenceFVector.push_back(0.0);
334 greyValueColorsOfColorTransferenceFVector.push_back(max*0/4);
335 greyValueColorsOfColorTransferenceFVector.push_back(max*1/4);
336 greyValueColorsOfColorTransferenceFVector.push_back(max*2/4);
337 greyValueColorsOfColorTransferenceFVector.push_back(max*3/4);
338 greyValueColorsOfColorTransferenceFVector.push_back(max*4/4);
340 _ctfun->AddRGBPoint( max*0/4 , 0.0, 0.0, 0.0);
341 _ctfun->AddRGBPoint( max*1/4 , 1.0, 0.0, 0.0);
342 _ctfun->AddRGBPoint( max*2/4 , 0.0, 0.0, 1.0);
343 _ctfun->AddRGBPoint( max*3/4 , 0.0, 1.0, 0.0);
344 _ctfun->AddRGBPoint( max*4/4 , 0.0, 0.2, 0.0);
346 _volumePlanes = vtkPlanes::New();
347 // int x1,x2,y1,y2,z1,z2;
348 // vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
349 // imagedata->GetExtent(x1,x2,y1,y2,z1,z2);
350 // _volumePlanes->SetBounds(x1,x2,y1,y2,z1,z2);
354 // _volumeMapper = vtkVolumeRayCastMapper::New();
355 _volumeMapper->SetInput( this->GetVtkMPRBaseData()->GetImageData() );
357 _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
359 // _volumeMapper->SetVolumeRayCastFunction(_compositeFunctionMIP);
362 _volumeMapper->SetClippingPlanes( _volumePlanes );
363 _volumeMapper->AutoAdjustSampleDistancesOn();
365 _volumeProperty->SetInterpolationTypeToNearest();
366 //_volumeProperty = vtkVolumeProperty::New();
367 _volumeProperty->SetColor(_ctfun);
368 _volumeProperty->SetScalarOpacity( _tfun );
371 _volumeProperty->DisableGradientOpacityOn();
374 // _volumeProperty->SetInterpolationTypeToNearest();
375 // _volumeProperty->ShadeOff();
376 // _volumeProperty->SetAmbient(0.3);
377 // _volumeProperty->SetDiffuse(0.1);
378 // _volumeProperty->SetSpecular(0.8);
379 // _volumeProperty->DisableGradientOpacityOn();
381 // _newvol = vtkVolume::New();
382 _newvol->SetMapper(_volumeMapper );
383 _newvol->SetProperty(_volumeProperty );
385 _observerV = boxSurfaceObserver::New();
386 _observerV->SetPlanes( _volumePlanes );
387 _observerV->SetActor( _newvol );
388 _observerV->SetvtkVolumeRayCastMapper( _volumeMapper );
391 //-----------------------------------------------------------------------------
393 void vtkClipping3DDataViewer::Configure_VolumeBox()
395 _volumerendererdata->SetImageData(_vtkmprbasedata->GetImageData());
398 vector<double> *gv = this->GetGreyValuesTransferenceFVector();
399 vector<double> *op = this->GetIntensityValuesTransferenceFVector();
401 _volumerendererdata->SetLookUpTable((vtkLookupTable*)(_ctfun));
402 _volumerendererdata->OpacityChanged(*gv, *op);
404 //_wxvtkclipping3Dview->VisibleVolumeActor( false );
405 //_volumerendererdata->ShowVolume(event.IsChecked() );
406 //_volumerendererdata->BoundingBoxChanged(event.IsChecked() );
409 //-----------------------------------------------------------------------------
411 void vtkClipping3DDataViewer::SetRenderer(vtkRenderer* renderer)
413 _volumerendererdata->SetRenderer(renderer);
417 //-----------------------------------------------------------------------------
418 void vtkClipping3DDataViewer::SetInteractor(vtkRenderWindowInteractor* interactor)
421 _volumerendererdata->SetInteractor(interactor);
425 //-----------------------------------------------------------------------------
426 void vtkClipping3DDataViewer::BoxActorChanged(bool changed)
428 vector<double> *gv = this->GetGreyValuesTransferenceFVector();
429 vector<double> *op = this->GetIntensityValuesTransferenceFVector();
431 _volumerendererdata->ShowVolume(changed);
432 _volumerendererdata->OpacityChanged(*gv, *op);
433 _volumerendererdata->BoundingBoxChanged(changed);
437 //-----------------------------------------------------------------------------
438 void vtkClipping3DDataViewer::UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun)
440 _volumerendererdata->SetLookUpTable((vtkLookupTable*)(ctfun));
441 _volumerendererdata->OpacityChanged(gf, vf);
445 //-----------------------------------------------------------------------------
446 void vtkClipping3DDataViewer::updateVolume()
451 _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
452 _volumerendererdata->changeCompositeMIPFunction(0);
456 _volumeMapper->SetVolumeRayCastFunction(_compositeFunctionMIP);
457 _volumerendererdata->changeCompositeMIPFunction(1);
462 _volumeProperty->SetInterpolationTypeToLinear();
466 _volumeProperty->SetInterpolationTypeToNearest();
471 _volumeProperty->ShadeOn();
475 _volumeProperty->ShadeOff();
480 //-------------------------------------------------------------------
481 void vtkClipping3DDataViewer::Configure()
485 Configure_VolumeBox();
486 // An outline provides context around the data.
488 _outlineData = vtkOutlineFilter::New();
489 _outlineData->SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() );
490 _mapOutline = vtkPolyDataMapper::New();
492 //EED 4 nov 2015 Estelle
493 // _mapOutline->SetInput(_outlineData->GetOutput());
495 _outline = vtkActor::New();
496 _outline->SetMapper(_mapOutline);
497 _outline->GetProperty()->SetColor(0,0,0);
501 //-------------------------------------------------------------------
502 void vtkClipping3DDataViewer::SetIsovalue(int idTissue, int isoValue)
504 _mCubes[idTissue]->SetValue(0, isoValue);
506 //-------------------------------------------------------------------
507 double vtkClipping3DDataViewer::GetIsovalue(int idTissue)
509 return _mCubes[idTissue]->GetValue(0);
511 //-------------------------------------------------------------------
512 vtkVolume* vtkClipping3DDataViewer::GetVolumeActor()
516 //-------------------------------------------------------------------
517 vtkVolumeRayCastMapper* vtkClipping3DDataViewer::GetVolumeMapper(){
518 return _volumeMapper;
520 //-------------------------------------------------------------------
521 vtkPlanes* vtkClipping3DDataViewer::GetVolumePlanes()
523 return _volumePlanes;
526 //-------------------------------------------------------------------
527 vtkMarchingCubes *vtkClipping3DDataViewer::GetMCubes(int idTissue)
529 return _mCubes[idTissue];
531 //--------------------------------------------------------------------
532 //-------------------
534 //-------------------
536 std::vector<double>* vtkClipping3DDataViewer::GetGreyValuesTransferenceFVector()
538 return &greyValuesTransferenceFVector;
540 //--------------------------------------------------------------------
541 std::vector<double>* vtkClipping3DDataViewer::GetIntensityValuesTransferenceFVector()
543 return &intensityValuesTransferenceFVector;
545 //--------------------------------------------------------------------
546 std::vector<double>* vtkClipping3DDataViewer::GetRedColorsOfColorTransferenceFVector()
548 return &redColorsOfColorTransferenceFVector;
550 //--------------------------------------------------------------------
551 std::vector<double>* vtkClipping3DDataViewer::GetGreenColorsOfColorTransferenceFVector()
553 return &greenColorsOfColorTransferenceFVector;
555 //--------------------------------------------------------------------
556 std::vector<double>* vtkClipping3DDataViewer::GetBlueColorsOfColorTransferenceFVector()
558 return &blueColorsOfColorTransferenceFVector;
560 //--------------------------------------------------------------------
561 std::vector<double>* vtkClipping3DDataViewer::GetGreyValueColorsOfColorTransferenceFVector()
563 return &greyValueColorsOfColorTransferenceFVector;
565 //--------------------------------------------------------------------
566 //--------------------------------------
567 //Getters transference function
568 //and color of the transference function
569 //---------------------------------------
570 vtkPiecewiseFunction* vtkClipping3DDataViewer::GetTransferencefunction()
574 //--------------------------------------------------------------------
575 vtkColorTransferFunction* vtkClipping3DDataViewer::GetColorTransferenceFunction()
580 //-------------------------------------------------------------------
582 void vtkClipping3DDataViewer::ReadVolumeFunctions()
585 int i=0,xi,yi,r,g,b,gValue;
586 vtkImageData *imagedata = this->_vtkmprbasedata->GetImageData();
588 HistogramDialog* hDlg=new HistogramDialog(NULL,_T("Histogram Dialog"),imagedata);
592 int tfSize=this->greyValuesTransferenceFVector.size();
596 hDlg->erasePointsTransferenceFunction();
599 double g=greyValuesTransferenceFVector[i];
600 double in=intensityValuesTransferenceFVector[i];
601 hDlg->addPointToTransferenceFunction(g,in*100);
607 int ctfSize=this->redColorsOfColorTransferenceFVector.size();
613 double gr=greyValueColorsOfColorTransferenceFVector[i];
614 double r=redColorsOfColorTransferenceFVector[i];
615 double g=greenColorsOfColorTransferenceFVector[i];
616 double b=blueColorsOfColorTransferenceFVector[i];
617 hDlg->addColorPoint(gr,r*255,g*255,b*255);
621 //If it is smooth activate next line
622 //hDlg->updatePlotter();
623 //setting variables if the user wants to do refresh
624 hDlg->setCTF(_ctfun);
628 // when the user had changed the transference Function
630 if(hDlg->ShowModal()== wxID_OK )
632 // -- vtkPiecewiseFunction --
633 this->_tfun->RemoveAllPoints();
634 greyValuesTransferenceFVector.clear();
635 intensityValuesTransferenceFVector.clear();
637 int nTFPoints=hDlg->getSizeTransferenceFunction();
641 hDlg->getTransferenceFunctionPoint(i,xi,yi);
642 this->_tfun->AddPoint( xi , yi/100.0 );
643 greyValuesTransferenceFVector.push_back(xi);
644 intensityValuesTransferenceFVector.push_back(yi/100.0);
647 // -- vtkColorTransferFunction --
648 this->_ctfun->RemoveAllPoints ();
650 redColorsOfColorTransferenceFVector.clear();
651 greenColorsOfColorTransferenceFVector.clear();
652 blueColorsOfColorTransferenceFVector.clear();
653 greyValueColorsOfColorTransferenceFVector.clear();
655 int nCTFpoints=hDlg->getSizeBarColor();
659 hDlg->getDataBarColorPoint(i,xi,r,g,b);
660 this->_ctfun->AddRGBPoint(xi,r/255.0,g/255.0,b/255.0 );
661 redColorsOfColorTransferenceFVector.push_back(r/255.0);
662 greenColorsOfColorTransferenceFVector.push_back(g/255.0);
663 blueColorsOfColorTransferenceFVector.push_back(b/255.0);
664 greyValueColorsOfColorTransferenceFVector.push_back(xi);
668 this->_volumeMapper->Update();
669 this->_newvol->Update();
675 if(hDlg->getRefreshed())
678 //--Transference Function----
679 this->_tfun->RemoveAllPoints();
681 size=greyValuesTransferenceFVector.size();
684 double grey1=greyValuesTransferenceFVector[i];
685 double in2=intensityValuesTransferenceFVector[i];
686 this->_tfun->AddPoint( grey1 , in2 );
689 // -- vtkColorTransferFunction --
690 _ctfun->RemoveAllPoints ();
693 size=greyValueColorsOfColorTransferenceFVector.size();
696 double grey2=(greyValueColorsOfColorTransferenceFVector)[i];
697 double red =(redColorsOfColorTransferenceFVector)[i];
698 double green =(greenColorsOfColorTransferenceFVector)[i];
699 double blue = (blueColorsOfColorTransferenceFVector)[i];
700 _ctfun->AddRGBPoint(grey2,red,green,blue);
702 this->_volumeMapper->Update();
703 this->_newvol->Update();
711 void vtkClipping3DDataViewer::ReadVolumeFunctions(char *namefile)
718 FILE *ff = fopen ( namefile ,"r");
722 if (strcmp(tmp,"MAX")==0)
724 vtkImageData *vtkimagedata = this->_vtkmprbasedata->GetImageData();
725 vtkimagedata->GetScalarRange(range);
726 max = (int) (range[1]);
731 fscanf(ff,"%s",tmp); // --
733 // -- vtkPiecewiseFunction --
734 this->_tfun->RemoveAllPoints();
736 while ( strcmp(tmp,"--")!=0 )
741 this->_tfun->AddPoint( x*max , val );
745 this->_ctfun->RemoveAllPoints ();
746 // -- vtkColorTransferFunction --
757 this->_ctfun->AddRGBPoint( x*max , r,g,b );
761 this->_volumeMapper->Update();
762 this->_newvol->Update();
769 //-------------------------------------------------------------------
771 void vtkClipping3DDataViewer::ReadMeshVTK(char *namefile)
773 vtkDataSetReader *reader = vtkDataSetReader::New();
774 reader->SetFileName(namefile);
776 _tissueStripper[3]->SetInput( reader->GetPolyDataOutput() );
779 void vtkClipping3DDataViewer::setColorTransferFunction(vtkColorTransferFunction* colortable){
781 _volumeProperty->SetColor(colortable);
786 void vtkClipping3DDataViewer::SetRayCasting(bool active)
788 _isRayCasting = active;
792 void vtkClipping3DDataViewer::SetMIPActive(bool active)
797 void vtkClipping3DDataViewer::SetInterpolation(bool active)
799 _interpolation = active;
802 void vtkClipping3DDataViewer::SetShade(bool active)