[vtkusers] vtkGreedyTerrainDecimation from vtkImageData

wardva forwardje at hotmail.com
Mon Jan 14 10:01:06 EST 2008


Dear vtk-users,

i'm looking for a procedure to give me a strongly reduced
image from a given input image using a "greedy" insertion technique
provided by "vtkGreedyTerrainDecimation". 

I succeeded in doing this with an input .dem file using vtkDemReader.
However, when reading in an image, with e.g. BMPReader, the
produced output can not be fed into "vtkGreedyTerrainDecimation".
When executed vtk produces a series of errors on the outputscreen
at a rate impossible to read. 

The problem only begins when performing vtkwriter -> Write. 
Can someone help me with this? 


For example (tcl code): 

# reading a bmp file
vtkBMPReader bmpReader
  bmpReader SetFileName "image.bmp"
  bmpReader Update

set numbertriangles 5

# doing simplification
vtkGreedyTerrainDecimation decimateHeckbert
  decimateHeckbert SetInput [bmpReader GetOutput]
  decimateHeckbert BoundaryVertexDeletionOn
  decimateHeckbert SetErrorMeasureToNumberOfTriangles
  decimateHeckbert SetNumberOfTriangles $numbertriangles
  
# writing   
vtkPolyDataWriter vtkwriter
    vtkwriter SetInput  [decimateHeckbert GetOutput]
    vtkwriter SetFileName "test.vtk"
    vtkwriter SetFileTypeToASCII
    vtkwriter Write
    puts " file written to $name"

-- 
View this message in context: http://www.nabble.com/vtkGreedyTerrainDecimation-from-vtkImageData-tp14800937p14800937.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list