]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx
no message
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / vtkClipping3DDataViewer.cxx
1
2 #include "vtkClipping3DDataViewer.h"
3 #include "vtkDataSetReader.h"
4 #include "vtkProperty.h"
5
6 vtkClipping3DDataViewer::vtkClipping3DDataViewer()
7 {
8         int i;
9         for (i=0; i<VTKMPRDATA_MAXTISSUE; i++){
10                 _visibleTissue[i]               = false;
11                 _representationType[i]  = true;
12         }
13         _visibleVolume=false;
14 }
15 //-------------------------------------------------------------------
16 vtkClipping3DDataViewer::~vtkClipping3DDataViewer()
17 {
18         int i;
19         for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
20                 _mCubes[i]->Delete();
21                 _tissueStripper[i]->Delete();
22                 _tissueMapper[i]->Delete();
23                 _tissuePlanes[i]->Delete();
24                 _tissueClipper[i]->Delete();
25         }
26         _outlineData->Delete();
27         _mapOutline->Delete();
28         _outline->Delete();
29         // Volume
30         _tfun->Delete();
31         _ctfun->Delete();
32         _compositeFunction->Delete();
33         _volumeMapper->Delete();
34         _volumeProperty->Delete();
35         _newvol->Delete();
36         _volumePlanes->Delete();
37
38         for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
39                 _tissue[i]-> Delete();
40                 _observerS[i]-> Delete();
41         }
42         _observerV-> Delete();
43 }
44 //-------------------------------------------------------------------
45 vtkActor* vtkClipping3DDataViewer::GetOutlineActor()
46 {
47         return _outline;
48 }
49 //-------------------------------------------------------------------
50 vtkClipPolyData* vtkClipping3DDataViewer::GetTissueClipper(int id)
51 {
52         return this->_tissueClipper[id];
53 }
54 //-------------------------------------------------------------------
55 vtkPolyDataMapper* vtkClipping3DDataViewer::GetTissueMapper(int id)
56 {
57         return _tissueMapper[id];
58 }
59 //-------------------------------------------------------------------
60 vtkPlanes* vtkClipping3DDataViewer::GetTissuePlanes(int id)
61 {
62         return _tissuePlanes[id];
63 }
64 //-------------------------------------------------------------------
65 vtkStripper* vtkClipping3DDataViewer::GetTissueStripper(int id)
66 {
67         return _tissueStripper[id];
68 }
69 //-------------------------------------------------------------------
70 void vtkClipping3DDataViewer::Refresh()
71 {
72 //      _volumeMapper->SetClippingPlanes(_volumePlanes);
73
74 //      this->_volumeMapper->Update();
75 //      this->_newvol->Update();
76
77 //      _newvol->VisibilityOn();
78
79         
80 // _volumeMapper = vtkVolumeRayCastMapper::New();
81 //      _volumeMapper->SetInput( this->GetVtkMPRBaseData()->GetImageData() );
82 //      _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
83 //      _volumeMapper->SetClippingPlanes( _volumePlanes );
84 //      _newvol->SetMapper(_volumeMapper );
85
86
87 }
88 //-------------------------------------------------------------------
89 void vtkClipping3DDataViewer::RefreshSurface()
90 {
91         int i;
92         for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
93         {
94                 SetIsovalue(i, (int) (GetIsovalue(i)+1) );
95 //              this->GetMCubes(i)->Update();
96         }
97 }
98 //-------------------------------------------------------------------
99 void vtkClipping3DDataViewer::SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata)
100 {
101         _vtkmprbasedata=vtkmprbasedata;
102 }
103 //-------------------------------------------------------------------
104 vtkMPRBaseData* vtkClipping3DDataViewer::GetVtkMPRBaseData()
105 {
106         return _vtkmprbasedata;
107 }
108
109
110 //-------------------------------------------------------------------
111 void vtkClipping3DDataViewer::SetVisibleTissue(int idTissue, bool visible)
112 {
113         _visibleTissue[idTissue]=visible;
114 }
115 //-------------------------------------------------------------------
116 bool vtkClipping3DDataViewer::GetVisibleTissue(int idTissue){
117         return _visibleTissue[idTissue];
118 }
119 //-------------------------------------------------------------------
120 void vtkClipping3DDataViewer::SetRepresentationType(int idTissue, bool representationType)
121 {
122         _representationType[idTissue]=representationType;
123 }
124 //-------------------------------------------------------------------
125 bool vtkClipping3DDataViewer::GetRepresentationType(int idTissue)
126 {
127         return _representationType[idTissue];
128 }
129
130 //-------------------------------------------------------------------
131 vtkActor* vtkClipping3DDataViewer::GetTissueActor(int id){
132         return _tissue[id];
133 }
134
135 //-------------------------------------------------------------------
136 boxSurfaceObserver *vtkClipping3DDataViewer::GetObserverS(int idObserverS)
137 {
138         return _observerS[idObserverS];
139 }
140 //-------------------------------------------------------------------
141 boxSurfaceObserver *vtkClipping3DDataViewer::GetObserverV()
142 {
143         return _observerV;
144 }
145
146 //-------------------------------------------------------------------
147 bool vtkClipping3DDataViewer::GetVisibleVolume()
148 {
149         return _visibleVolume;
150 }
151 //-------------------------------------------------------------------
152 void vtkClipping3DDataViewer::SetVisibleVolume(bool visiblevolume)
153 {
154         _visibleVolume = visiblevolume;
155 }
156
157
158 //-------------------------------------------------------------------
159 void vtkClipping3DDataViewer::Configure_Tissue()
160 {
161
162         double range[2];
163         int i;
164         for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
165                 // Visualisation - original volume
166                 vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
167                 imagedata->GetScalarRange( range );
168                 _mCubes[i] = vtkMarchingCubes::New( );
169                 _mCubes[i]->SetInput( imagedata );
170
171                 _mCubes[i]->SetValue( 0, range[1]*(4+i) / 8 );
172 //              _mCubes[i]->SetValue( 0, 1500 );
173
174             _tissueStripper[i] = vtkStripper::New();
175             _tissueStripper[i]->SetInput( _mCubes[i]->GetOutput( ) );
176
177
178
179                 _tissuePlanes[i]  = vtkPlanes::New();
180    
181                 int x1,x2,y1,y2,z1,z2;
182                 imagedata->GetExtent(x1,x2,y1,y2,z1,z2);
183                 _tissuePlanes[i]->SetBounds  (x1,x2,y1,y2,z1,z2);
184                 
185                 _tissueClipper[i] = vtkClipPolyData::New();
186                 _tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() );
187                 _tissueClipper[i]->SetClipFunction( _tissuePlanes[i] );
188                 _tissueClipper[i]->InsideOutOn( );
189
190                 _tissueMapper[i] = vtkPolyDataMapper::New( );
191                 _tissueMapper[i]->SetInput( _tissueClipper[i]->GetOutput() );
192                 _tissueMapper[i]->ScalarVisibilityOff( );
193 //              _tissueMapper[i]->Update();
194
195         }
196                 
197
198
199         // vtkActor tissue
200         for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
201                 // tissue
202                 _tissue[i] = vtkActor::New();
203                 _tissue[i]->SetMapper( GetTissueMapper(i) );
204                 float cr=1,cg=0.5,cb=0.5;
205                 _tissue[i]->GetProperty()->SetDiffuseColor(cr/255, cg/255   , cb/255   );
206                 _tissue[i]->GetProperty()->SetSpecular(.3);
207                 _tissue[i]->GetProperty()->SetSpecularPower(20);
208                 _tissue[i]->GetProperty()->SetOpacity(0.5);
209                 if (i==0) _tissue[i]->GetProperty()->SetColor(0.85, 0.85   , 0.85   );
210                 if (i==1) _tissue[i]->GetProperty()->SetColor(0, 0  ,  1  );
211                 if (i==2) _tissue[i]->GetProperty()->SetColor(0.85, 0.20   , 0.20   );
212                 if (i==3) _tissue[i]->GetProperty()->SetColor(0, 1   , 0   );
213         }
214
215         for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
216         {
217                 _observerS[i] = boxSurfaceObserver::New();
218                 _observerS[i]->SetPlanes( GetTissuePlanes(i) );
219                 _observerS[i]->SetActor( _tissue[i] );
220         }
221
222 }
223
224 //-----------------------------------------------------------------------------
225
226 void vtkClipping3DDataViewer::Configure_Volume()
227 {
228   // Volume
229
230   _tfun = vtkPiecewiseFunction::New();
231   _ctfun = vtkColorTransferFunction::New();
232
233         double range[2];
234         this->_vtkmprbasedata->GetImageData()->GetScalarRange(range);
235         double max = range[1];
236
237         /*
238         adding the poinst of the transference function
239         */
240         //X
241         greyValuesTransferenceFVector.push_back(max * 0/2);  // JPR ?? 0/2
242         greyValuesTransferenceFVector.push_back(max * 1/2);  // JPR ?? division entiere?
243         greyValuesTransferenceFVector.push_back(max * 2/2);
244         //Y
245         intensityValuesTransferenceFVector.push_back(0.0);
246         intensityValuesTransferenceFVector.push_back(1.0);
247         intensityValuesTransferenceFVector.push_back(1.0);
248
249         _tfun->AddPoint(max * 0/2 , 0.0);
250         _tfun->AddPoint(max * 1/2 , 1.0);
251         _tfun->AddPoint(max * 2/2 , 1.0);
252
253         /*
254                 Adding the colors to the vectors        
255         */
256         //RED
257         redColorsOfColorTransferenceFVector.push_back(0.0);
258         redColorsOfColorTransferenceFVector.push_back(1.0);
259         redColorsOfColorTransferenceFVector.push_back(0.0);
260         redColorsOfColorTransferenceFVector.push_back(0.0);
261         redColorsOfColorTransferenceFVector.push_back(0.0);
262
263         //GREEN
264         greenColorsOfColorTransferenceFVector.push_back(0.0);
265         greenColorsOfColorTransferenceFVector.push_back(0.0);
266         greenColorsOfColorTransferenceFVector.push_back(0.0);
267         greenColorsOfColorTransferenceFVector.push_back(1.0);
268         greenColorsOfColorTransferenceFVector.push_back(0.2);
269         
270         //BLUE
271         blueColorsOfColorTransferenceFVector.push_back(0.0);
272         blueColorsOfColorTransferenceFVector.push_back(0.0);
273         blueColorsOfColorTransferenceFVector.push_back(1.0);
274         blueColorsOfColorTransferenceFVector.push_back(0.0);
275         blueColorsOfColorTransferenceFVector.push_back(0.0);
276         //GREY VALUE    
277         greyValueColorsOfColorTransferenceFVector.push_back(max*0/4);
278         greyValueColorsOfColorTransferenceFVector.push_back(max*1/4);
279         greyValueColorsOfColorTransferenceFVector.push_back(max*2/4);
280         greyValueColorsOfColorTransferenceFVector.push_back(max*3/4);
281         greyValueColorsOfColorTransferenceFVector.push_back(max*4/4);
282
283         _ctfun->AddRGBPoint( max*0/4 , 0.0, 0.0, 0.0);
284         _ctfun->AddRGBPoint( max*1/4 , 1.0, 0.0, 0.0);
285         _ctfun->AddRGBPoint( max*2/4 , 0.0, 0.0, 1.0);
286         _ctfun->AddRGBPoint( max*3/4 , 0.0, 1.0, 0.0);
287         _ctfun->AddRGBPoint( max*4/4 , 0.0, 0.2, 0.0);
288
289   _volumePlanes  = vtkPlanes::New();
290 //      int x1,x2,y1,y2,z1,z2;
291 //      vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
292 //      imagedata->GetExtent(x1,x2,y1,y2,z1,z2);
293 //      _volumePlanes->SetBounds(x1,x2,y1,y2,z1,z2);
294
295         // EED 13/03/2011
296         
297   _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
298         vtkVolumeRayCastMIPFunction* _compositeFunctionMIP = vtkVolumeRayCastMIPFunction::New();
299
300
301   _volumeMapper = vtkVolumeRayCastMapper::New();
302         _volumeMapper->SetInput( this->GetVtkMPRBaseData()->GetImageData() );
303         
304         _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
305 //      _volumeMapper->SetVolumeRayCastFunction(_compositeFunctionMIP);
306         
307         _volumeMapper->SetClippingPlanes( _volumePlanes );
308         _volumeMapper->AutoAdjustSampleDistancesOn();
309
310     _volumeProperty = vtkVolumeProperty::New();
311         _volumeProperty->SetColor(_ctfun);
312         _volumeProperty->SetScalarOpacity( _tfun );
313
314 // EED 31/03/2008
315         
316         _volumeProperty->DisableGradientOpacityOn();
317         
318         _volumeProperty->SetInterpolationTypeToLinear();
319 //      _volumeProperty->SetInterpolationTypeToNearest();
320         
321         _volumeProperty->ShadeOn();
322 //      _volumeProperty->ShadeOff();
323         
324         
325 //      _volumeProperty->SetInterpolationTypeToNearest();
326 //      _volumeProperty->ShadeOff();
327 //      _volumeProperty->SetAmbient(0.3);
328 //      _volumeProperty->SetDiffuse(0.1);
329 //      _volumeProperty->SetSpecular(0.8);
330 //      _volumeProperty->DisableGradientOpacityOn();
331
332   _newvol = vtkVolume::New();
333         _newvol->SetMapper(_volumeMapper );
334         _newvol->SetProperty(_volumeProperty );
335
336   _observerV = boxSurfaceObserver::New();
337         _observerV->SetPlanes( _volumePlanes );
338         _observerV->SetActor( _newvol );
339         _observerV->SetvtkVolumeRayCastMapper( _volumeMapper );
340 }
341
342
343 //-------------------------------------------------------------------
344 void vtkClipping3DDataViewer::Configure()
345 {
346         Configure_Tissue();
347         Configure_Volume();
348
349   // An outline provides context around the data.
350   //
351         _outlineData = vtkOutlineFilter::New();
352     _outlineData->SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() );
353         _mapOutline = vtkPolyDataMapper::New();
354     _mapOutline->SetInput(_outlineData->GetOutput());
355         _outline = vtkActor::New();
356     _outline->SetMapper(_mapOutline);
357     _outline->GetProperty()->SetColor(0,0,0);
358 }
359
360
361 //-------------------------------------------------------------------
362 void vtkClipping3DDataViewer::SetIsovalue(int idTissue, int isoValue)
363 {
364         _mCubes[idTissue]->SetValue(0, isoValue);
365 }
366 //-------------------------------------------------------------------
367 double vtkClipping3DDataViewer::GetIsovalue(int idTissue)
368 {
369         return _mCubes[idTissue]->GetValue(0);
370 }
371 //-------------------------------------------------------------------
372 vtkVolume* vtkClipping3DDataViewer::GetVolumeActor()
373 {
374    return _newvol;
375 }
376 //-------------------------------------------------------------------
377 vtkVolumeRayCastMapper* vtkClipping3DDataViewer::GetVolumeMapper(){
378         return _volumeMapper;
379 }
380 //-------------------------------------------------------------------
381 vtkPlanes* vtkClipping3DDataViewer::GetVolumePlanes()
382 {
383         return _volumePlanes;
384 }
385
386 //-------------------------------------------------------------------
387 vtkMarchingCubes *vtkClipping3DDataViewer::GetMCubes(int idTissue)
388 {
389         return _mCubes[idTissue];
390 }
391 //--------------------------------------------------------------------
392 //-------------------
393 //Getters Vectors
394 //-------------------
395
396 std::vector<double>*    vtkClipping3DDataViewer::GetGreyValuesTransferenceFVector()
397 {
398         return &greyValuesTransferenceFVector;
399 }
400 //--------------------------------------------------------------------
401 std::vector<double>*    vtkClipping3DDataViewer::GetIntensityValuesTransferenceFVector()
402 {
403         return &intensityValuesTransferenceFVector;
404 }
405 //--------------------------------------------------------------------
406 std::vector<double>*    vtkClipping3DDataViewer::GetRedColorsOfColorTransferenceFVector()
407 {
408         return &redColorsOfColorTransferenceFVector;
409 }
410 //--------------------------------------------------------------------
411 std::vector<double>*    vtkClipping3DDataViewer::GetGreenColorsOfColorTransferenceFVector()
412 {
413         return &greenColorsOfColorTransferenceFVector;
414 }
415 //--------------------------------------------------------------------
416 std::vector<double>*    vtkClipping3DDataViewer::GetBlueColorsOfColorTransferenceFVector()
417 {       
418         return &blueColorsOfColorTransferenceFVector;
419 }
420 //--------------------------------------------------------------------
421 std::vector<double>*    vtkClipping3DDataViewer::GetGreyValueColorsOfColorTransferenceFVector()
422 {
423         return &greyValueColorsOfColorTransferenceFVector;
424 }
425 //--------------------------------------------------------------------
426 //--------------------------------------
427 //Getters transference function
428 //and color of the transference function
429 //---------------------------------------
430 vtkPiecewiseFunction* vtkClipping3DDataViewer::GetTransferencefunction()
431 {
432         return this->_tfun;
433 }
434 //--------------------------------------------------------------------
435 vtkColorTransferFunction* vtkClipping3DDataViewer::GetColorTransferenceFunction()
436 {
437         return this->_ctfun;
438 }
439
440 //-------------------------------------------------------------------
441
442 void vtkClipping3DDataViewer::ReadVolumeFunctions()
443 {
444 /*
445         int i=0,xi,yi,r,g,b,gValue;
446         vtkImageData *imagedata = this->_vtkmprbasedata->GetImageData();
447         
448         HistogramDialog* hDlg=new HistogramDialog(NULL,_T("Histogram Dialog"),imagedata);
449         // 
450         // put in a method
451         //
452         int tfSize=this->greyValuesTransferenceFVector.size();
453                 if(tfSize>0)
454                 {
455                         int i=0,y;
456                         hDlg->erasePointsTransferenceFunction();
457                         while(i<tfSize)
458                         {
459                                 double g=greyValuesTransferenceFVector[i];
460                                 double in=intensityValuesTransferenceFVector[i];
461                                 hDlg->addPointToTransferenceFunction(g,in*100);
462                                 i++;
463                         }
464                         
465                 }
466
467         int ctfSize=this->redColorsOfColorTransferenceFVector.size();
468         if(ctfSize>0)
469         {
470                 int i=0,y;
471                         while(i<ctfSize)
472                         {
473                                 double gr=greyValueColorsOfColorTransferenceFVector[i];
474                                 double r=redColorsOfColorTransferenceFVector[i];
475                                 double g=greenColorsOfColorTransferenceFVector[i];
476                                 double b=blueColorsOfColorTransferenceFVector[i];
477                                 hDlg->addColorPoint(gr,r*255,g*255,b*255);
478                                 i++;
479                         }
480         }
481         //If it is smooth activate next line
482         //hDlg->updatePlotter();
483         //setting variables if the user wants to do refresh
484         hDlg->setCTF(_ctfun);
485         hDlg->setTF(_tfun);
486         
487         //
488         // when the user had changed the transference Function
489         //
490         if(hDlg->ShowModal()== wxID_OK )
491         {       
492                         // -- vtkPiecewiseFunction --
493                         this->_tfun->RemoveAllPoints();
494                         greyValuesTransferenceFVector.clear();
495                         intensityValuesTransferenceFVector.clear();
496                 
497                         int nTFPoints=hDlg->getSizeTransferenceFunction();
498                         i=0;
499                         while(i<nTFPoints)
500                         {
501                                 hDlg->getTransferenceFunctionPoint(i,xi,yi);
502                                 this->_tfun->AddPoint( xi , yi/100.0 );
503                                 greyValuesTransferenceFVector.push_back(xi);
504                                 intensityValuesTransferenceFVector.push_back(yi/100.0);
505                                 i++;
506                         }       
507                         // -- vtkColorTransferFunction  --
508                         this->_ctfun->RemoveAllPoints ();
509                         //clean colors
510                         redColorsOfColorTransferenceFVector.clear();
511                         greenColorsOfColorTransferenceFVector.clear();
512                         blueColorsOfColorTransferenceFVector.clear();
513                         greyValueColorsOfColorTransferenceFVector.clear();
514
515                         int nCTFpoints=hDlg->getSizeBarColor();
516                         i=0;    
517                         while(i<nCTFpoints)
518                         {
519                                 hDlg->getDataBarColorPoint(i,xi,r,g,b);
520                                 this->_ctfun->AddRGBPoint(xi,r/255.0,g/255.0,b/255.0 );
521                                 redColorsOfColorTransferenceFVector.push_back(r/255.0);
522                                 greenColorsOfColorTransferenceFVector.push_back(g/255.0);
523                                 blueColorsOfColorTransferenceFVector.push_back(b/255.0);
524                                 greyValueColorsOfColorTransferenceFVector.push_back(xi);
525                                 i++;
526                         }
527                         
528                         this->_volumeMapper->Update();
529                         this->_newvol->Update();
530         }
531         
532         else
533         {
534                 
535                 if(hDlg->getRefreshed())
536                 {
537                         int i=0,size;
538                         //--Transference Function----
539                         this->_tfun->RemoveAllPoints();
540                         i=0;
541                         size=greyValuesTransferenceFVector.size();
542                         for(i=0;i<size;i++)
543                         {
544                                 double grey1=greyValuesTransferenceFVector[i];
545                                 double  in2=intensityValuesTransferenceFVector[i];
546                                 this->_tfun->AddPoint( grey1 , in2 );
547                         }
548                         
549                         // -- vtkColorTransferFunction  --
550                         _ctfun->RemoveAllPoints ();
551                         
552                         i=0;
553                         size=greyValueColorsOfColorTransferenceFVector.size();          
554                         for(i=0;i<size;i++)
555                         {
556                                 double grey2=(greyValueColorsOfColorTransferenceFVector)[i];
557                                 double red =(redColorsOfColorTransferenceFVector)[i];
558                                 double green =(greenColorsOfColorTransferenceFVector)[i];
559                                 double blue = (blueColorsOfColorTransferenceFVector)[i];
560                                 _ctfun->AddRGBPoint(grey2,red,green,blue);
561                         }
562                         this->_volumeMapper->Update();
563                         this->_newvol->Update();
564                  }
565                  
566         }
567         hDlg->Destroy();
568 */
569 }
570 /*
571 void vtkClipping3DDataViewer::ReadVolumeFunctions(char *namefile)
572 {
573         char tmp[256];
574         short int       max;
575         double          range[2];
576         double          x,val,r,g,b;
577
578         FILE *ff = fopen ( namefile ,"r");
579
580         // --  MAX  --
581         fscanf(ff,"%s",tmp);
582         if (strcmp(tmp,"MAX")==0)
583         {
584                 vtkImageData *vtkimagedata              = this->_vtkmprbasedata->GetImageData();
585                 vtkimagedata->GetScalarRange(range);
586                 max = (int) (range[1]);
587         } else {
588                 max = atoi(tmp);
589         }
590
591         fscanf(ff,"%s",tmp);   // --
592
593         // -- vtkPiecewiseFunction --
594         this->_tfun->RemoveAllPoints();
595         fscanf(ff,"%s",tmp);   
596         while ( strcmp(tmp,"--")!=0 )
597         {
598                 x=atof(tmp);
599                 fscanf(ff,"%s",tmp);   
600                 val=atof(tmp);
601                 this->_tfun->AddPoint( x*max , val );
602                 fscanf(ff,"%s",tmp);   
603         }
604
605         this->_ctfun->RemoveAllPoints ();
606         // -- vtkColorTransferFunction  --
607         while ( !feof(ff))
608         {
609                 fscanf(ff,"%s",tmp);   
610                 x=atof(tmp);
611                 fscanf(ff,"%s",tmp);   
612                 r=atof(tmp);
613                 fscanf(ff,"%s",tmp);   
614                 g=atof(tmp);
615                 fscanf(ff,"%s",tmp);   
616                 b=atof(tmp);
617                 this->_ctfun->AddRGBPoint( x*max , r,g,b );                     
618         }
619
620
621         this->_volumeMapper->Update();
622         this->_newvol->Update();
623
624
625         fclose(ff);
626 }
627 */
628
629 //-------------------------------------------------------------------
630 // EED 23 Mai 2007
631 void vtkClipping3DDataViewer::ReadMeshVTK(char *namefile)
632 {
633         vtkDataSetReader *reader = vtkDataSetReader::New();
634         reader->SetFileName(namefile);
635         reader->Update();
636         _tissueStripper[3]->SetInput( reader->GetPolyDataOutput()  );
637 }
638
639 void vtkClipping3DDataViewer::setColorTransferFunction(vtkColorTransferFunction* colortable){
640         
641         _volumeProperty->SetColor(colortable);
642         
643 }