@@ -0,0 +1,1552 @@
+import vtk.vtkNativeLibrary;%0Aimport vtk.vtkImageCanvasSource2D;%0Aimport vtk.vtkXMLPImageDataWriter;%0A%0A%0Apublic class XMLPImageDataWriter%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    %0A    //parse command line arguments%0A    if (args.length != 1) %0A    %7B%0A      System.err.println(%22Usage: java -classpath ... Filename(.pvti) e.g Test.pvti%22);%0A      return;%0A    %7D%0A    String Filename = args%5B0%5D;%0A    vtkImageCanvasSource2D drawing = new vtkImageCanvasSource2D();%0A    drawing.SetNumberOfScalarComponents(3);%0A    drawing.SetScalarTypeToUnsignedChar();%0A    drawing.SetExtent(0, 20, 0, 50, 0, 1);%0A    drawing.SetDrawColor(255.0, 255.0, 255.0);%0A    drawing.DrawCircle(5, 5, 3);%0A    %0A    int numberOfPieces = 4;%0A    %0A    vtkXMLPImageDataWriter writer = new vtkXMLPImageDataWriter();%0A    writer.SetInputConnection(drawing.GetOutputPort());%0A    writer.SetFileName(Filename);%0A    writer.SetNumberOfPieces(numberOfPieces);%0A    writer.SetEndPiece(numberOfPieces-1);%0A    writer.SetStartPiece(0);%0A    writer.Update();%0A    %0A  %7D%0A%7D%0A

Create XMLPImageDataWriter.java