Previous

Section

<<<

Isosurface Generation Using VTK

Next

Section

>>>

VTK Basics

 

 

3.5.1.4. Creating the Pipeline: vtkPolyDataMapper and vtkLODActor

 

You are here:

  • This pipeline will take input from a file with volumetric data which has dimensions of 256x256x577 with individual unsigned 16-bit units.  Because of the inherent flaws with the technology used to generate this data, it is necessary to extract a region that does not show the machine or table used to generate this data.  Also, it will be useful to select a range of slices to view at one time instead of the entire body.  For performance reasons, the data should be able to be subsampled to achieve better interactive performance.  Additionally, it would be nice to view any single region of the entire dataset.  This volumetric data should be viewable using any isosurface value.  So, once the region of interest is extracted, a specific isosurface value of the dataset should be chosen to view.  By itself, this isosurface will be invisible unless some additional configuration occurs.  For this reason, the user should be able to choose any color and amount of opacity of the surface.  In order to get better interactive performance when manipulating the model, it might be helpful to have the model have a lower level of details.

 

The pipeline so far is:

  • vtkImageReader -> vtkExtractVOI -> vtkMarchingCubes / vtkContourFilter

 

Studying the highlighted section:

·        “By itself, this isosurface will be invisible unless some additional configuration occurs.  For this reason, the user should be able to choose any color and amount of opacity of the surface.  In order to get better interactive performance when manipulating the model, it might be helpful to have the model have a lower level of details.”

o       This section is a perfect example of filling in the missing details.  From reading the previous sections, changing any sort of properties of an object requires working with the VTK class vtkActor or vtkLODActor.  Since the description mentions allowing the model to have a “lower level of details”, this means that using vtkLODActor is preferable to vtkActor.  However, there is a missing link that is needed to move to the vtkLODActor.  Specifically, the data must be mapped to geometry, and that task was not completed yet.  So, it is necessary to add vtkPolyDataMapper to the pipeline first before vtkLODActor.  Details of the pipeline generation will be given later in this page. 

§         In order to allow a specific color and opacity to be used without any regard to the values in the image file, make sure to call: ScalarVisibilityOff().

o       After adding the vtkPolyDataMapper object to the pipeline with an attachment to vtkActor, it is now possible to adjust the isosurface’s color and opacity in addition to adjusting the specified detail level. 

§         To change the color, issue the following call: GetProperty().SetColor( float r, float g, float b ).  Substitute the appropriate values to obtain the desired color.

§         To change the opacity, issue the following call: GetProperty ().SetOpacity( float ).  Substitute the appropriate value to obtain the desired opacity.

§         Finally, it is necessary to set a degree of detail by specifying the number of cloud points.  Pick any number that you think would be sufficient using the call SetNumberOfCloudPoints( int ). 

 

In order to add this object to the pipeline, issue a form of the following command:

  • To attach vtkPolyDataMapper to the pipeline, add this line:
    • vtkPolyDataMapperObject.SetInput( vtkMarchingCubesOrContourFilterObject.GetOutput() )
  • To attach vtkLODActor to the pipeline, add this line:
    • vtkLODActorObject.SetMapper( vtkPolyDataMapperObject )

 

 

<<< Previous

Creating the Pipeline: vtkMarchingCubes / vtkContourFitler

 

Table of Contents

 

Next >>>

vtkContourFilter vs. vtkMarchingCubes