@@ -0,0 +1,3265 @@
+import vtk.vtkNamedColors;%0Aimport vtk.vtkNativeLibrary;%0Aimport vtk.vtkRenderWindow;%0Aimport vtk.vtkRenderWindowInteractor;%0Aimport vtk.vtkRenderer;%0Aimport vtk.vtkImageEllipsoidSource;%0Aimport vtk.vtkImagePermute;%0Aimport vtk.vtkImageActor;%0Aimport vtk.vtkInteractorStyleImage;%0A%0A%0Apublic class ImageOrientation %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    vtkNamedColors colors = new vtkNamedColors();%0A%0A    //For originalViewport Color%0A    double originalViewportColor%5B%5D = new double%5B4%5D;%0A    //For permutedViewport Color%0A    double permutedViewportColor%5B%5D = new double%5B4%5D;%0A%0A    colors.GetColor(%22SlateGray%22, originalViewportColor);%0A    colors.GetColor(%22LightSteelBlue%22,permutedViewportColor);%0A    %0A    // Create an image%0A    vtkImageEllipsoidSource source = new vtkImageEllipsoidSource();%0A    source.SetWholeExtent(0, 20, 0, 20, 0, 0);%0A    source.SetCenter(10,10,0);%0A    source.SetRadius(2,5,0);%0A    source.Update();%0A    %0A    vtkImagePermute permuteFilter = new vtkImagePermute();%0A    permuteFilter.SetInputConnection(source.GetOutputPort());%0A    permuteFilter.SetFilteredAxes(1,0,2);%0A    permuteFilter.Update();%0A    %0A    // Create actors%0A    vtkImageActor originalActor = new vtkImageActor();%0A    originalActor.GetMapper().SetInputConnection(source.GetOutputPort());%0A    %0A    vtkImageActor permutedActor = new vtkImageActor();%0A    permutedActor.GetMapper().SetInputConnection(permuteFilter.GetOutputPort());%0A    %0A    // Define viewport ranges%0A    // (xmin, ymin, xmax, ymax)%0A    double originalViewport%5B%5D = new double%5B%5D %7B0.0, 0.0, 0.5, 1.0%7D;%0A    double permutedViewport%5B%5D = new double%5B%5D %7B0.5, 0.0, 1.0, 1.0%7D;%0A    %0A    // Setup renderers%0A    vtkRenderer originalRenderer = new vtkRenderer();%0A    originalRenderer.SetViewport(originalViewport);%0A    originalRenderer.AddActor(originalActor);%0A    originalRenderer.ResetCamera();%0A    originalRenderer.SetBackground(originalViewportColor);%0A    %0A    vtkRenderer permutedRenderer = new vtkRenderer();%0A    permutedRenderer.SetViewport(permutedViewport);%0A    permutedRenderer.AddActor(permutedActor);%0A    permutedRenderer.ResetCamera();%0A    permutedRenderer.SetBackground(permutedViewportColor);%0A    %0A    vtkRenderWindow renderWindow = new vtkRenderWindow();%0A    renderWindow.SetSize(600, 300);%0A    renderWindow.AddRenderer(originalRenderer);%0A    renderWindow.AddRenderer(permutedRenderer);%0A    %0A    vtkRenderWindowInteractor renderWindowInteractor = new vtkRenderWindowInteractor();%0A    %0A    vtkInteractorStyleImage style =new vtkInteractorStyleImage();%0A    %0A    renderWindowInteractor.SetInteractorStyle(style);%0A%0A    renderWindowInteractor.SetRenderWindow(renderWindow);%0A    renderWindow.Render();%0A    renderWindowInteractor.Initialize();%0A%0A    renderWindowInteractor.Start();%0A  %7D%0A%7D%0A

Create ImageOrientation.java