Hi,<br><br>I&#39;m fairly new to VTK so I was wondering what was the best way to visualize a 1D array of doubles in a grid format. Thinking that a 3D grid would be the best way to represent the data, I first converted the 1D array to a 3D array:<br>
<br>    double V1array[ ][ ][ ] = new double[numRows][numColumns][1];<br>    int k = 0;<br>    for (int a=0; a&lt;numRows; a++){<br>        for (int b=0; b&lt;numColumns; b++){<br>            for (int c=0; c&lt;1; c++){<br>
              V1array[a][b][c] = Varr1[k];<br>              k+=1;    <br>            }<br>        }<br>    }<br><br>I then created an instance of vtkStructuredGrid, set its dimensions as numRows, numColumns and 0 and then added the data to the grid through vtkPoints:<br>
<br>   vtkStructuredGrid V1 = new vtkStructuredGrid();<br>   V1.SetDimensions(numRows, numColumns, 0);<br>    vtkPoints points = new vtkPoints();<br>    for (int a=0; a&lt;numRows; a++){<br>        for (int b=0; b&lt;numColumns; b++){<br>
            for(int c=0; c&lt;1; c++){<br>                points.InsertNextPoint(V1array[a][b][c],0,0);<br>            }<br>        }<br>    }<br>    V1.SetPoints(points);<br><br>I then set the geometry of the grid with StructuredGridGeometryFilter and a gridMapper and set the Actor, Renderer and Render Window:<br>
<br>    vtkStructuredGridGeometryFilter plane = new vtkStructuredGridGeometryFilter();<br>    plane.SetInput(V1);<br>    <br>    <br>    vtkPolyDataMapper sgridMapper = new vtkPolyDataMapper();<br>    sgridMapper.SetInputConnection(plane.GetOutputPort());<br>
    <br>    vtkActor sgridActor = new vtkActor();<br>    sgridActor.SetMapper(sgridMapper);<br>    sgridActor.GetProperty().SetRepresentationToWireframe();<br>    sgridActor.GetProperty().SetColor(0, 0, 0);<br>    <br>    vtkRenderer renderer = new vtkRenderer();<br>
    vtkRenderWindow renWin = new vtkRenderWindow();<br>    renWin.AddRenderer(renderer);<br>    <br>    vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();<br>    iren.SetRenderWindow(renWin);<br>    <br>    renderer.AddActor(sgridActor);<br>
    renderer.SetBackground(1,1,1);<br>    renderer.ResetCamera();<br>    renWin.SetSize(500,500);<br>    <br>    renWin.Render();<br>    iren.Start();<br>    <br>However, all I get is a white screen for my render window and not a numRows X numColumns grid containing my data points. Any suggestions on how to fix my code and get a properly dimensioned grid of data? I intend on then using a LookUp Table to color code the data points in the grid so I first need a grid filled with all the data.<br>
<br>Thanks!<br>