Previous

Section

<<<

Isosurface Generation using VTK

Next

Section

>>>

VTK Basics

 

 

3.2.1.1. vtkExtractVOI Functions

 

In order to successfully resample the file and select a volume of interest, the following functions should be called:

 

  • void SetVOI( int,int, int,int, int,int )

·     Use this function to specify the region of interest that should be extracted from the data file.  The first pair of numbers represents the extent of the x-dimension, the second pair is for the y-dimension, and the third pair is for the z-dimension.  Based on the extents specified with vtkImageReader, please make every effort not to go outside that range; otherwise, it is very likely that a run-time error will occur.

 

  • void SetSampleRate( int, int, int )

·        This function will allow the resampling of the data file.  Please note that all of these parameters are integers and must be 1 or greater (though if specified 1 for all parameters, that really would not be very useful).  According to the VTK documentation, if the sample rate parameters were 2,2,2, then the resulting volume would be 1/8th of its original size.  Remember though that a higher value for the sampling rate will reduce the resolution.  Also, it is acceptable to sample at one rate on one axis and another rate on another axis.  However, in order to maintain some sort of aspect ratio, it would be advisable to have the x- and y- axis sampling rates remain the same while varying the z-axis sampling rate.

 

  • void SetInput( vtkImageData * input )

·     Technically this function belongs to the superclass of vtkExtractVOI named vtkImageToImageFilter.  This class named vtkExtractVOI takes as input an object of type vtkImageData which is the type of the object generated by vtkImageReader2.  For more information on class hierarchies, consult the VTK Documentation.

 

  • vtkImageData * GetOutput()

·     Technically this function belongs to the superclass of vtkExtractVOI named vtkImageSource.  This class named vtkExtractVOI produces output of the type vtkImageData.  This output will serve as input to either vtkContourFilter or vtkMarchingCubes.  For more information on setting input to these classes further in the pipeline, consult their sections.  To learn more about the VTK class hierarchies, view the VTK documentation.

 

 

<<< Previous

vtkExtractVOI

 

Table of Contents

 

Next >>>

vtkContourFilter / vtkMarchingCubes