CSCI 55200 DATA VISUALIZATION
• Microsoft Visual Studio 2017
• CMake 3.9.6
• VTK 8.1.0
• avanigadda.cxx (source file)
• CMakeLists.txt (source file)
• avanigadda.exe (executable file)
- Make sure Visual studio, CMake and VTK installed and synchronized each other perfectly.
- Create a “src” folder and put source files in it. i.e avanigadda.cxx and CMakeLists.txt
- Create a “build” folder and make sure it is empty.
- Open CMake-gui desktop app.
- Give folder path of “src” to “where is the source code” in CMake-gui app. Example: path = C:/…../Project1/src
- Give folder path of “build” to “where to build the binaries”
- Click configure
- After successful configure, you will notice Configuring done, then Click Generate
- After successful Generating, you will notice Generating done
- Files are generated in “build” folder. You will find “avanigadda.sln” in it. Double Click on it. it will lead you to Visual Studio.
- After successful installation and scanning of files, it will show Ready in bottom-left corner. Then Right click on ALL_BUILD and click on Build.
- After successful build, you will notice Debug folder in “build” folder containing three files namely avanigadda.exe, avanigadda.dil and avanigadda.pdb. Open Debug folder and put the “Heightmap.PNG” in it.
- Copy all .dil and .pdb files in ….\VTK\bin\bin\Debug (these files are created while installing VTK through CMake)
- Paste those files in ….\build\Debug i.e debug folder created in build containing avanigadda.exe and Heightmap.PNG
- Open command prompt navigate to build folder containing executable file. Example: cd C:.....\Project1\build\Debug
- Run the executable file in command prompt passing image name as arguments. Example: > avanigadda.exe Heightmap.PNG
While executing avanigadda.exe in command prompt, you will get warnings in vtkOutputWindow. Ignore them and find the visualization result in another window.
- We read the .PNG file through vtkPNGReader object.
- We can find the pixel intensities of image by vtkImageMagnitude. It will find the magnitudes of each pixel in image.
- We convert the image data i.e magnitudes into Polydata by using vtkImageDataGeometryFilter. It will extract the geometry from structured points of dataset (contains magnitudes and x,y) and convert it into Polydata.
- We used vtkWarpScalar to scale the z co-ordinates. It will decide the scaling factor and gives 3D effect to image.
- vtkMergeFilter merge the image and polydata.
- vtkPolyDataMapper maps the polydata to graphics.
- Then generated graphics are pipelined to actor by vtkActor.
- It is pipelined to vtkRenderer.
- It is pipelined to vtkRendererWindow.
- It is pipelined to vtkRenderWindowInteractor to get interaction with graphics.
- Finally, we add actor to renderer, renderer to renderer_window. And start the visualization.