<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hello,<br><br>I would like to use VTK to build a distance map of a 3D binary volume.<br>The vtkImageCityBlockDistance class seems to be the right tool for this but I fail to use it.<br><br>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.<br><br>This is my code to the use the vtkImageCityBlockDistance: <br><br><div style="margin-left: 40px;">vtkSmartPointer<vtkImageCityBlockDistance> dMap = vtkSmartPointer<vtkImageCityBlockDistance>::New();<br>dMap->SetInput(vtkData);<br>dMap->Update();<br></div><br>where vtkData is my input volume.<br><br>Then, I'm displaying the resulting volume slice by slice. Unfortunately, the result is the same as the input.<br><br>Can
someone explain me a reason for this ?<br>How to use vtkImageCityBlockDistance ?<br> Mardi 23 novembre 2010 18h04<br>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, ....<br><br>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.<br><br><br>Thank you for your help.<br>Best<br>James</td></tr></table><br>