[vtkusers] Gradient and Laplacian magnitude from 3D object (from vtkPolyDataConnectivityFilter)

walmor godoi wfisico at yahoo.com.br
Thu Apr 2 15:46:36 EDT 2009


Hello everyone, 

I would like to calculate the Gradient and Laplacian (as a single scalar value to represent this magnitudes) from the
output of vtkPolyDataConnectivityFilter (from a 3D object). For Gradient, vtkImageGradientMagnitude tried but did not return anything.

Can anyone help?


-----------------java part code from netbeans----------------
//Filtro Gaussiano
  vtkImageGaussianSmooth smooth = new vtkImageGaussianSmooth();
  smooth.SetInput(bmpReader.GetOutput());
  smooth.SetStandardDeviations(4.0, 4.0, 4.0);
  smooth.SetRadiusFactors(2.0, 2.0, 2.0);
  smooth.SetDimensionality(3);
  smooth.Update();
//Marching Cubes
vtkImageMarchingCubes marcher = new vtkImageMarchingCubes();
marcher.SetInput(smooth.GetOutput());
marcher.SetValue(0,100);
marcher.Update();

vtkPolyDataConnectivityFilter conn =new vtkPolyDataConnectivityFilter();
    conn.SetInput(marcher.GetOutput());
    conn.SetExtractionModeToSpecifiedRegions();
    conn.InitializeSpecifiedRegionList();
    conn.AddSpecifiedRegion(0);
    conn.Update();

int idx;    
//loop 
for(idx=0; idx<conn.GetNumberOfExtractedRegions(); idx++){
conn.DeleteSpecifiedRegion(idx-1);
conn.AddSpecifiedRegion(idx);
conn.Update();
//Gradient
 gradientmagnitude.SetInput(conn.GetOutput());  double 
// gradientmagnitude.Update();
Gradiente=gradientmagnitude.GetOutput().GetScalarSize();
  //or
// double Gradiente = gradientmagnitude.GetOutput().GetScalarTypeMax();
   
(...)

 ---------------------------------------------------------------------------------
Walmor Cardoso Godoi, M. Sc.
Curitiba - Paraná - Brazil
Url: http://www.walmorgodoi.com
Blog (visite!): http://walmorgodoi.com/palavraimpressa
--------------------------------------------------------------------------------



      Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090402/c5a2b372/attachment.htm>


More information about the vtkusers mailing list