vtkSTLExtractor Class Reference

#include <vtkSTLExtractor.h>

List of all members.

Public Member Functions

 vtkSTLExtractor ()
virtual ~vtkSTLExtractor ()
void setVolume (vtkImageData *volume)
void setMarchingCubesLevel (double level)
void setSigmaLevel (double level)
double getMarchingCubesLevel ()
double getSigmaLevel ()
void calculate ()
vtkPolyData * getInnerSurface ()
vtkPolyData * getOuterSurface ()
void Delete ()

Private Attributes

double sigmaLevel
double marchingCubesLevel
vtkPolyData * innerSurface
vtkPolyData * outerSurface
vtkImageData * volume

Detailed Description

Definition at line 22 of file vtkSTLExtractor.h.


Constructor & Destructor Documentation

vtkSTLExtractor::vtkSTLExtractor (  ) 

Definition at line 10 of file vtkSTLExtractor.cpp.

References innerSurface, marchingCubesLevel, outerSurface, and sigmaLevel.

00010                                 {
00011         innerSurface = vtkPolyData::New();
00012         outerSurface = vtkPolyData::New();
00013         marchingCubesLevel = 128.0;
00014         sigmaLevel = 100.0;
00015 }

vtkSTLExtractor::~vtkSTLExtractor (  )  [virtual]

Definition at line 17 of file vtkSTLExtractor.cpp.

References innerSurface, and outerSurface.

00017                                  {
00018         innerSurface->Delete();
00019         outerSurface->Delete();
00020 }


Member Function Documentation

void vtkSTLExtractor::calculate (  ) 

Definition at line 56 of file vtkSTLExtractor.cpp.

References innerSurface, marchingCubesLevel, outerSurface, sigmaLevel, and volume.

Referenced by wxSTLWidget_02::generateSTLSurfaces(), wxPathologyWidget_01::generateSTLSurfaces(), and wxSTLWidget_03::generateSTLSurfaces().

00056                                {
00057 
00058         // ------------------------------------------------------------------------
00059                 //  1. CALCULATING THE INNER SURFACE
00060                 // ------------------------------------------------------------------------
00061             vtkImageGaussianSmooth *gaussFilter = vtkImageGaussianSmooth::New();
00062         gaussFilter->SetInput(volume);
00063         gaussFilter->SetDimensionality(3);
00064         gaussFilter->SetStandardDeviation(sigmaLevel);
00065     
00066         vtkMarchingCubes *cubesFilter = vtkMarchingCubes::New();
00067         cubesFilter->SetInput(gaussFilter->GetOutput());
00068         cubesFilter->SetValue(0,marchingCubesLevel);
00069                 cubesFilter->ComputeGradientsOn ();
00070         cubesFilter->ComputeScalarsOn ();
00071                 cubesFilter->SetNumberOfContours( 1 );
00072             
00073                 // Unir puntos duplicados y remover primitivas degeneradas
00074                 vtkCleanPolyData *cleanFilter = vtkCleanPolyData::New();
00075         cleanFilter->SetInput ( cubesFilter->GetOutput() );
00076                 
00077                 // crea poligonos triangulares
00078         vtkTriangleFilter *triangleFilter = vtkTriangleFilter::New();
00079         triangleFilter->SetInput( cleanFilter->GetOutput() );
00080         triangleFilter->Update();
00081 
00082                 innerSurface->DeepCopy(triangleFilter->GetOutput());
00083 
00084 
00085                 // ------------------------------------------------------------------------
00086                 //  2. CALCULATING THE OUTER SURFACE
00087                 // ------------------------------------------------------------------------
00088                 vtkImageContinuousDilate3D *dilateFilter = vtkImageContinuousDilate3D ::New();
00089         dilateFilter->SetInput (volume);
00090                 dilateFilter->SetKernelSize (3, 3, 3);
00091                 gaussFilter->SetInput( dilateFilter->GetOutput());
00092         triangleFilter->Update();
00093                 
00094             outerSurface->DeepCopy(triangleFilter->GetOutput());
00095 
00096                 // ------------------------------------------------------------------------
00097                 //  3. CLEANING UP
00098                 // ------------------------------------------------------------------------
00099 
00100                 gaussFilter->Delete();
00101                 cubesFilter->Delete();
00102                 cleanFilter->Delete();
00103             triangleFilter->Delete();
00104         dilateFilter->Delete();
00105 }

Here is the caller graph for this function:

void vtkSTLExtractor::Delete (  ) 
vtkPolyData * vtkSTLExtractor::getInnerSurface (  ) 

Definition at line 45 of file vtkSTLExtractor.cpp.

References innerSurface.

Referenced by wxSTLWidget_02::generateSTLSurfaces(), wxPathologyWidget_01::generateSTLSurfaces(), and wxSTLWidget_03::generateSTLSurfaces().

00045                                              {
00046         return innerSurface;
00047 }

Here is the caller graph for this function:

double vtkSTLExtractor::getMarchingCubesLevel (  ) 

Definition at line 36 of file vtkSTLExtractor.cpp.

References marchingCubesLevel.

00036                                              {
00037         return marchingCubesLevel;
00038 }

vtkPolyData * vtkSTLExtractor::getOuterSurface (  ) 

Definition at line 50 of file vtkSTLExtractor.cpp.

References outerSurface.

Referenced by wxSTLWidget_02::generateSTLSurfaces(), wxPathologyWidget_01::generateSTLSurfaces(), and wxSTLWidget_03::generateSTLSurfaces().

00050                                              {
00051         return outerSurface;
00052 }

Here is the caller graph for this function:

double vtkSTLExtractor::getSigmaLevel (  ) 

Definition at line 40 of file vtkSTLExtractor.cpp.

References sigmaLevel.

00040                                      {
00041         return sigmaLevel;
00042 }

void vtkSTLExtractor::setMarchingCubesLevel ( double  level  ) 

Definition at line 27 of file vtkSTLExtractor.cpp.

References marchingCubesLevel.

Referenced by wxSTLWidget_02::generateSTLSurfaces(), wxPathologyWidget_01::generateSTLSurfaces(), and wxSTLWidget_03::generateSTLSurfaces().

00027                                                        {
00028         this->marchingCubesLevel = level;
00029 }

Here is the caller graph for this function:

void vtkSTLExtractor::setSigmaLevel ( double  level  ) 

Definition at line 31 of file vtkSTLExtractor.cpp.

References sigmaLevel.

Referenced by wxSTLWidget_02::generateSTLSurfaces(), wxPathologyWidget_01::generateSTLSurfaces(), and wxSTLWidget_03::generateSTLSurfaces().

00031                                                {
00032         this->sigmaLevel = level;
00033 }

Here is the caller graph for this function:

void vtkSTLExtractor::setVolume ( vtkImageData *  volume  ) 

Definition at line 22 of file vtkSTLExtractor.cpp.

Referenced by wxSTLWidget_02::generateSTLSurfaces(), wxPathologyWidget_01::generateSTLSurfaces(), and wxSTLWidget_03::generateSTLSurfaces().

00022                                                    {
00023         this->volume = volume;
00024 }

Here is the caller graph for this function:


Member Data Documentation

vtkPolyData* vtkSTLExtractor::innerSurface [private]

Definition at line 41 of file vtkSTLExtractor.h.

Referenced by calculate(), getInnerSurface(), vtkSTLExtractor(), and ~vtkSTLExtractor().

vtkPolyData* vtkSTLExtractor::outerSurface [private]

Definition at line 42 of file vtkSTLExtractor.h.

Referenced by calculate(), getOuterSurface(), vtkSTLExtractor(), and ~vtkSTLExtractor().

double vtkSTLExtractor::sigmaLevel [private]

Definition at line 39 of file vtkSTLExtractor.h.

Referenced by calculate(), getSigmaLevel(), setSigmaLevel(), and vtkSTLExtractor().

vtkImageData* vtkSTLExtractor::volume [private]

Definition at line 43 of file vtkSTLExtractor.h.

Referenced by calculate().


The documentation for this class was generated from the following files:

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1