@@ -0,0 +1,2517 @@
+import vtk.vtkActor;%0Aimport vtk.vtkNativeLibrary;%0Aimport vtk.vtkRenderWindow;%0Aimport vtk.vtkRenderWindowInteractor;%0Aimport vtk.vtkRenderer;%0Aimport vtk.vtkImageData;%0Aimport vtk.vtkCellCenters;%0Aimport vtk.vtkDataSetMapper;%0A%0A%0Apublic class CellCenters %0A%7B%0A  // -----------------------------------------------------------------%0A  // Load VTK library and print which library was not properly loaded%0A  static %0A  %7B%0A    if (!vtkNativeLibrary.LoadAllNativeLibraries()) %0A    %7B%0A      for (vtkNativeLibrary lib : vtkNativeLibrary.values()) %0A      %7B%0A        if (!lib.IsLoaded()) %0A        %7B%0A          System.out.println(lib.GetLibraryName() + %22 not loaded%22);%0A        %7D%0A      %7D%0A    %7D%0A    vtkNativeLibrary.DisableOutputWindow(null);%0A  %7D%0A  // -----------------------------------------------------------------%0A%0A  public static void main(String args%5B%5D) %0A  %7B  %0A    // Create an image data%0A    vtkImageData imageData = new vtkImageData();%0A%0A    // Specify the size of the image data%0A    imageData.SetDimensions(3,3,2);%0A    imageData.SetSpacing(1.0, 1.0, 1.0);%0A    imageData.SetOrigin(0.0, 0.0, 0.0);%0A%0A    vtkCellCenters cellCentersFilter = new vtkCellCenters();%0A    cellCentersFilter.SetInputData(imageData);%0A    cellCentersFilter.VertexCellsOn();%0A    cellCentersFilter.Update();%0A    %0A    // Access the cell centers%0A    for(int i = 0; i %3C cellCentersFilter.GetOutput().GetNumberOfPoints(); i++)%0A    %7B%0A      double p%5B%5D = new double%5B3%5D;%0A      cellCentersFilter.GetOutput().GetPoint(i, p);%0A      System.out.print(%22Point %22 + %22 %22 + i + %22 : %22 + %22 %22 +  p%5B0%5D + %22 , %22 + p%5B1%5D + %22 , %22 + p%5B2%5D + %22%5Cn%22); %0A    %7D%0A    %0A    // Display the cell centers%0A    vtkDataSetMapper centerMapper = new vtkDataSetMapper();%0A    centerMapper.SetInputConnection(cellCentersFilter.GetOutputPort());%0A    %0A    vtkActor centerActor = new vtkActor();%0A    centerActor.SetMapper(centerMapper);%0A%0A    vtkDataSetMapper mapper = new vtkDataSetMapper();%0A    mapper.SetInputData(imageData);%0A%0A    vtkActor actor = new vtkActor();%0A    actor.SetMapper(mapper);%0A    actor.GetProperty().SetRepresentationToWireframe();%0A%0A    // Create the renderer, render window and interactor.%0A    vtkRenderer ren = new vtkRenderer();%0A    vtkRenderWindow renWin = new vtkRenderWindow();%0A    renWin.AddRenderer(ren);%0A    vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();%0A    iren.SetRenderWindow(renWin);%0A    %0A    // Visualize%0A    ren.AddActor(actor);%0A    ren.AddActor(centerActor);%0A%09    %0A    renWin.SetSize(300, 300);%0A    renWin.Render();%0A    %0A    iren.Initialize();%0A    iren.Start();%0A  %7D%0A%7D%0A

Create CellCenters.java