[vtkusers] Computing distance map using VTK on a 3D volume (vtkImageCityBlockDistance)

Malsoaz James jmalsoaz at yahoo.fr
Tue Nov 23 13:32:36 EST 2010


Hello,

I would like to use VTK to build a distance map of a 3D binary volume.
The vtkImageCityBlockDistance class seems to be the right tool for this but I fail to use it.

Initially,
 I have a vtkImageData where objects are represented by the value 1. 
Background has the value 0. As said in the documentation, zero values 
are considered boundaries. Thus, I have set the objects values to 0 and 
background to 1.

This is my code to the use the vtkImageCityBlockDistance: 

vtkSmartPointer<vtkImageCityBlockDistance> dMap = vtkSmartPointer<vtkImageCityBlockDistance>::New();
dMap->SetInput(vtkData);
dMap->Update();

where vtkData is my input volume.

Then, I'm displaying the resulting volume slice by slice. Unfortunately, the result is the same as the input.

Can
 someone explain me a reason for this ?
How to use vtkImageCityBlockDistance ?
 Mardi 23 novembre 2010 18h04
The
 example given here: 
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/ImageCityBlockDistance 
is working but I don't see real difference with my code, ....

Note:
 I have tried with several input 3D volumes. One of them was a simple 
one with only a cross inside it. But same problem : input = output.


Thank you for your help.
Best
James


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101123/4de0ed9e/attachment.htm>


More information about the vtkusers mailing list