[vtkusers] vtkVoxelModeller,vtkDataSetWriter,example

petr zlamal p.zlamal.vtk at gmail.com
Tue Aug 4 06:54:54 EDT 2009


Hi all,
I try to use vtkVoxelModeller in my python script. For this test I 
generated practice image png dataset (resolution of each image file is 
12x12 px). Practice image  data are composed from 10 slices with black 
(0) and white (255) segments. First and second  slice is only white and  
next images  are same with a pattern below:

1 1 1 1 0 0 0 0 1 1 1 1
1 1 1 1 0 0 0 0 1 1 1 1
1 1 1 1 0 0 0 0 1 1 1 1
1 1 1 1 0 0 0 0 1 1 1 1
0 0 0 0 1 1 1 1 0 0 0 0
0 0 0 0 1 1 1 1 0 0 0 0
0 0 0 0 1 1 1 1 0 0 0 0
0 0 0 0 1 1 1 1 0 0 0 0
1 1 1 1 0 0 0 0 1 1 1 1
1 1 1 1 0 0 0 0 1 1 1 1
1 1 1 1 0 0 0 0 1 1 1 1
1 1 1 1 0 0 0 0 1 1 1 1


where 0 is black (0 scalar vlaue) and 1 is white (255 scalar value).  I 
try to setup control variables in vtkVoxelModeller 
(SetSampleDimensions,SetModelBounds,SetMaximumDistance) but output 
(write by vtkDataSetWriter) is strange (not look as input image data 
pattern). Can someone advise me how to setup control variables for this 
case or how to create voxel model from input image data?

Thank you
Vepro

I have simple code:
voxelModeller=vtk.vtkVoxelModeller()
voxelModeller.SetInput(input.GetOutput())
voxelModeller.SetSampleDimensions(12,12, 10)
voxelModeller.SetMaximumDistance(12)
voxelModeller.SetModelBounds(0,11,0,11,0,9)
voxelModeller.Update()







More information about the vtkusers mailing list