Objectives In this first project, you will familiarize yourself with VTK while experimenting with several techniques to visualize 2D scalar data. The topic here is geovisualization, in other words the visualization of geographic data. Specifically, you will be visualizing a dataset that combines bathymetry/topography data with satellite imagery of the earth surface. Your visualization will include a graphical user interface that interactively controls certain aspects of the visualization. Background Bathymetry measures the underwater depth of the ocean floor while topography measures land elevation with respect to sea level. Together, they describe the earth surface’s geometry. For simplicity, I use the term elevation below to jointly refer to both. NASA’s Blue Marble project offers high resolution elevation datasets along with satellite imagery of the earth surface acquired at different times of the year. In this project you will learn how to use VTK to create compelling interactive visualizations of the elevation data. Practically, the data consists of grayscale images (relief / topography) and color images (satellite views) with resolutions up to 86400 x 43200 (3.7 gigapixels). In each image, the earth surface is sampled at regular angular intervals spanning the domain [−π, π] × [−π/2, π/2] in spherical coordinates (see illustration below). 1/22/2020 Project 1 – Geovisualization https://www.cs.purdue.edu/homes/cs530/projects/project1.html 2/6 Specifically, each row of the image corresponds to a parallel (line of constant latitude, shown in red), while each column corresponds to a meridian (line of constant longitude, shown in blue). Note that the North and South poles (where parallels degenerate to points) are each represented by an entire row of uniform value. Task 1. Height Map Visualization and Texture Mapping (30%) Task summary Your first task consists in visualizing the elevation dataset through an interactive height map textured with the satellite image. See explanations below. Height map A height map is a mapping from a gray-scale (scalar) image to a curved surface, whereby each position associated with value in the image is mapped to the 3D position . In the case of the elevation dataset, the resulting surface matches (by definition) the earth elevation profile. Computing a height map in VTK is done with the help of the vtkWarpScalar filter, whose basic usage is demonstrated in ImageWarp.py (found here). Interactivity vtkWarpScalar provides a scale factor that allows the user to control the amount by which the image is moved up or down for a given scalar value at each point: is in fact mapped to by the algorithm, where is the scale factor. This control mechanism can be tied to a slider GUI to permit the interactive manipulation of the scale factor and update the visualization accordingly. Texture mapping Height mapping as described previously produces a geometric representation of the Earth’s surface. In the absence of additional visual cues, however, key aspects of the data, such as the continents’ coast lines, remain ambiguous. To remedy this problem you will use the available satellite image through texture mapping. In VTK, textures are stored in vtkTexture objects that can then be supplied to vtkActor to enable texture mapping during the rendering stage. Note that this mapping is only possible if the vertices of the target geometry (here, the height surface) are equipped with texture coordinates that specify their matching location on the texture. It is therefore important to point out that the supplied elevation datasets already contain texture coordinates among the point attributes. Implementation You will write for this task a program that satisfies the following requirements: Import the necessary files (elevation and satellite image) using the appropriate VTK readers (x, y) f (x, y, f) {(x, y), f} (x, y, Kf) K 1/22/2020 Project 1 – Geovisualization https://www.cs.purdue.edu/homes/cs530/projects/project1.html 3/6 Compute a height map representation of the elevation with vtkWarpScalar Texture map the satellite image onto the height map geometry Visualize the result Provide a slider bar GUI to interactively manipulate the scale factor of vtkWarpScalar Maintain consistency between visualization and GUI API Your program will have following API: > heightfield[.py] where is the path of the elevation data file and is the path of the satellite picture. Report Include in your report images of the visualization results produced by your program Make sure to select camera angles that convey the presence of a 3rd dimension Provide several images showing the results obtained for different scale factors Include close-up images Task 2. Isocontours and Color Mapping (30%) Task summary For the second task, you will visualize the elevation dataset using isocontours. Isocontours To highlight specific values of the elevation, one needs isocontours, which are also known as contour lines, isolines, or more formally level sets. An isocontour corresponds to the set of points where the considered function has a particular value (the pre-image of that function at that value). In 2D, isocontours form closed curves. Note that we will study this topic in great detail when we consider isosurfaces in the coming weeks. By selecting a number of discrete values between the minimum and the maximum values of the data set one can get a good illustration of the value distribution across the domain. To compute isocontours in the elevation dataset you will use vtkContourFilter, the API of which is discussed here. Specifically, you will create a visualization that shows isocontours associated with elevation values ranging from -10,000 meters to +8,000 meters in 1,000 meters increments. To improve the clarity of your visualization, you will wrap the isocontour into tubes using vtkTubeFilter. Note that the radius of your tubes must be selected carefully (not too big to avoid occlusion and not too small to make them easily distinguishable). To facilitate this selection you will create a GUI slider that lets you interactively modify this radius. In addition, you will apply a color map to the isocontours, in other words, assign to each isocontour a color that represents its value. Here, I am asking you to use the color scale shown below, where the maximal ocean depth will be mapped to blue, the maximum mountain height will be mapped to yellow, and values close to the sea level (either positive or negative) will be mapped to desaturated colors. The sea level itself (elevation 0) will be shown in red. Note that color maps in VTK are defined through vtkColorTransferFunction that are then supplied to the mapper via mapper.SetLookupTable(), where is the name of your color transfer function. To provide context to the isocontours, you will apply the same texture mapping solution as in the previous task, this time however to a flat geometry. Observe that you may need to tweak the blue and yellow ends of the color map defined above to improve the contrast of your isocontours with the underlying satellite image. 1/22/2020 Project 1 – Geovisualization https://www.cs.purdue.edu/homes/cs530/projects/project1.html 4/6 Implementation You will write for this task a program that meets the following requirements: Import the elevation dataset and satellite using the appropriate VTK readers Define a vtkContourFilter to create a series of isocontours in 1,000 meters increments in the interval -10,000 meters to +8,000 meters. Display the resulting curves as tubes using vtkTubeFilter Color the tubes using the indicated color scale and vtkColorTransferFunction Provide a GUI slider bar to control the radius of the tubes Texture map a satellite image to the dataset Keep visualization and GUI selection consistent API The API for your program should be as follows: > isocontour[.py] where is the path of the elevation data file and is the path of the satellite picture. Report Include in your report high quality images of the results produced by your program Provide images showing the results obtained for several radius selections Include close-up images Task 3. Putting It All Together On A Sphere (30%) Task summary For this third and final task, you will integrate height field representation, texture mapping, and isocontours and display them on a sphere to create a compelling visualization of the elevation dataset. Interactive scalar field visualization The fourth task in this project consists in combining the various visualization techniques that you implemented previously in a single visualization. Specifically, you should write a program that displays the elevation dataset as a height field, applies to it the satellite imagery using texture mapping (as done in Task 1), and visualizes isocontours as tubes (cf. Task 2). As discussed previously, your visualization should include a slider bar to control the scaling factor of the height field representation. Note that you will set the radius of the isocontours to a fixed value that you found appropriate in Task 2). Mapping to a sphere In contrast to what you did so far, you will display height field, texture, and isocontours on a sphere instead of a plane. Indeed, the results achieved so far do not convey the actual shape of the various continents due to the significant distortion that is caused by the latitude / longitude parameterization of the image. To remedy this problem we need to visualize the data directly on a sphere. To make your task easier, I am providing you with a sphere dataset that contains elevation values, normals, and texture coordinates. Note that the sphere that I am giving you is already scaled to the radius of the earth (in meters). Implementation You will write for this task a program that satisfies the following requirements: Import the elevation dataset on a sphere and satellite image using the appropriate VTK readers Apply vtkWarpScalar to visualize the elevation data as height field Provide a slider bar to control the scaling factor of vtkWarpScalar Texture map the satellite image onto the height field 1/22/2020 Project 1 – Geovisualization https://www.cs.purdue.edu/homes/cs530/projects/project1.html 5/6 Apply vtkContourFilter to create a series of isocontours in 1,000 meters increments in the interval -10,000 meters to +8,000 meters Display the resulting curves as tubes using vtkTubeFilter Color the tubes using the prescribed color map and vtkColorTransferFunction Draw the tubes directly on the height field Keep visualization and GUI selection consistent API The API for your program should be as follows: > view_earth[.py] where is the path of the elevation on a sphere data file and is the path of the satellite image. Report Include in your report high quality images of the results produced by your program Provide images showing the results obtained for several scaling factors Include images that show you results for different parts of the world and different camera perspectives Include close-up images Discussion (10%) Answer the following questions in your report. Be as specific as possible and draw from your experience in this assignment to justify your opinion. Considering the height map technique used in Task 1: 1. What properties of the dataset were effectively visualized with this technique? 2. What are in your opinion the main limitations of this technique and how could you address them? 3. How useful did you find the slider interface in your usage of the height field representation? 4. How effective do you find this visualization technique for this dataset? Considering the level sets considered in Task 2: 1. What specific aspects of the data were readily visible with isocontours? 2. How useful did you find the color map and why? Considering the sphere representation in Task 3: 1. What benefits did you see to the perform the visualization on a sphere? 2. How did the resulting visualization compare to the previous ones? Considering your findings in tasks 1, 2, and 3: 1. Did you find that the combined use of these visualization techniques in Task 3 improved upon the results of each technique applied separately? Why or why not? Datasets As indicated in preamble, the data used in this project is courtesy of NASA Earth Observatory and available on the web site of the Blue Marble project. Since the server can be slow at times, I am providing you with a local copy of the relevant files. Note that I converted the bathymetry / topography datasets to a single vtkImageData to simplify your programs. The dataset is available in 4 different resolutions for convenience. Similarly, the satellite image of the Earth is provided in 3 different resolutions. In both cases, use a low resolution version to test your implementation and use for your report the highest resolution that your computer can 1/22/2020 Project 1 – Geovisualization https://www.cs.purdue.edu/homes/cs530/projects/project1.html 6/6 handle. Note that some of these files are really large (see below) so make sure to download only what you need. Elevation datasets: small version: 540 x 270, 1.6 MB medium version: 1080 x 540, 6.0 MB large version: 2160 x 1080, 24 MB very large version: 4320 x 2160, 89 MB Same elevation datasets on sphere geometry: small version: 540 x 270, 9.2 MB medium version: 1080 x 540, 38 MB large version: 2160 x 1080, 152 MB very large version: 4320 x 2160, 608 MB Satellite image: medium version: 2160 x 1080, 573 KB large version: 5400 x 2700, 2.3 MB (very) large version: 21600 x 10800, 36 MB Report Please refer to the class syllabus for late policy and formatting guidelines of project reports. Your report should also contain your answers to the questions asked in the discussion section. As a reminder, this project must be completed individually. Submission Submit your project on Blackboard before February 4 at 11:59:59 pm. Please observe following instructions. Include the 3 program files along with any other source code you may have Make sure that your programs have the correct API! Include high resolution sample images showing results for each task. Include a PDF report describing what you have done and answering the questions asked above. The report should include high-resolution images. Additional images can be provided as part of the project submission. Include all submitted files in a single tar zip’ed directory named _p1, where is your Purdue login. Do not include any binary file Do not include any data files Do not use hardcoded paths (relative or absolute) in your programs.
Objective The second assignment focuses on the visualization of three-dimensional scalar fields using isosurfaces. Specifically, we will consider a medical imaging dataset corresponding to CT scans of a female subject. Your objective will be to combine isosurfaces, transparency, clipping planes and color mapping to reveal in your visualization important anatomical structures present in the data. Background The data corresponds to CT scans of a human female head and feet, courtesy of the Visible Human Project. For each dataset I am providing you with both high and low resolution versions. The small resolution was created by halving the size of the original data along each direction (it is therefore 8 times smaller). For each resolution, you will find both a CT volume and an additional dataset corresponding to the magnitude of the gradient of the CT image. As a reminder, the gradient of a scalar field is the vector-valued derivative of the scalar field. Here however, we are only interested in the magnitude of the derivative. In each case, the CT data is of type unsigned short, yielding values between 0 and 65535, while the gradient magnitude data is of type float. Note that the small resolution is mainly provided as a convenience for the testing phase of your implementation and I expect to see high quality results at full resolution in your reports. The interesting features in this dataset 2/8/2020 Programming Assignment 2 – Isosurfaces https://www.cs.purdue.edu/homes/cs530/projects/project2.html 2/6 correspond to skin, bones, and muscles. Note that other soft tissues (e.g., fat or brain) are too difficult to extract. Overview Your experimentation with the head dataset should allow you to identify values that correspond to the skin, skull, and muscles. In the foot dataset, you will use isosurfaces to reveal the bone structure as well the skin and surrounding muscles. Note that for each dataset, the CT and gradient magnitude volumes will offer you complementary means to identify interesting features. To permit the selection of good isovalues, you will create a GUI that will let you select individual values associated with the various structures you are looking for. A slider bar will allow you to interactively browse the value range in search for the proper isovalue, while two additional slider bars will allow you to select a range of gradient magnitudes to act as a filter on the constructed isosurface. To mitigate the occlusion caused by the nested structure of the surfaces, you will be using transparency and clipping planes. The latter will allow you to cut away the occluding part of the surfaces to reveal internal structures. Finally you will use color mapping to convey quantitative properties of the selected isosurfaces. Task 1 – Interactive Isosurfacing The first task in this project consists in visualizing a 3D scalar dataset using isosurfacing while supporting the interactive modification of the corresponding isovalue. This initial step will allow you to identify a set of isovalues that correspond to the major anatomical structures present in each dataset. Specifically, skin, bones, and muscles. Implementation Write a program that uses vtkContourFilter to extract isosurfaces and ties it to a slider bar GUI to interactively manipulate the isovalue. To address occlusion issues, your program will offer interactive control over three clipping planes implemented as a vtkClipPolyData filter used with an implicit function called vtkPlanes, which allows you to clip away portions of the volume to reveal internal structures. You will also add a color bar to your render window to show the meaning of the colors used in your visualization. This is done with the help of vtkScalarBarActor. An example showing how to use this class is available here. Note that this example uses a data file contained in the VTKData distribution. If you do not have it, it can be found on github. Specifically, your program must satisfy following requirements. Take in input the name of the scalar volume to be visualized from the command line Perform an isosurface visualization of the dataset Provide a slider bar to control the isovalue to be used within a range of interesting values Ensure consistency between slider bar selection and isosurface Provide three additional slider bars GUI to control the position of three clipping planes moving along the X, Y, and Z coordinate axis, respectively Show the color scale through a color bar Optionally import the initial isovalue and initial X, Y, and Z clipping plane positions from the command line API Your program will have following API: > python isosurface.py [–val ] [–clip ] where is the 3D scalar dataset to visualize, is the optional initial isovalue to be used by the program, and are the optional initial positions of the 3 clipping planes. Report Include in your report high-quality images showing each of the major anatomical structures that you were able to extract with isosurfaces. Each image should include a color bar. Indicate the isovalues that you identified for each structure and the visual settings associated with each visualization. Use clipping planes at your discretion 2/8/2020 Programming Assignment 2 – Isosurfaces https://www.cs.purdue.edu/homes/cs530/projects/project2.html 3/6 to facilitate the visual inspection of your results. In addition, include answers to following questions in your report. 1. Which isosurfaces look the most interesting? Justify your answer. 2. How did you select the position of clipping planes? Task 2 – Value vs. Gradient Magnitude Now that you have identified interesting isosurfaces corresponding to major anatomical structures in each dataset, your second task is to color map the value of the gradient magnitude on those isosurfaces. In other words, you will visualize the values that the gradient magnitude takes at the set of positions defined by each isosurface. This visualization should give you additional insight into the properties of each isosurface. Implementation Write a program that takes both scalar volume and gradient magnitude in input as well as a set of pre-selected isovalues in Task 1 and perform the color coding of the gradient magnitude on the isosurfaces. More precisely, you will use vtkProbeFilter jointly on the geometry of the isosurfaces and on the gradient magnitude volume to associate each vertex of the isosurfaces with the corresponding gradient magnitude value. The color mapping itself will be controlled by a color map supplied by the user. Specifically, your program must meet following requirements: Take in input the name of the scalar volume and the corresponding gradient magnitude volume from the command line Take in input the name of a file containing a set of isovalues (1) to be used for isosurface extraction Perform the resampling of the gradient magnitude on these isosurfaces and apply color mapping to visualize the resulting values Optionally take in input a color map to be used for the color mapping of gradient magnitude on the isosurfaces, otherwise resort to a default color map Provide the same three sliders GUI (2) used in Task 1 to control the position of 3 clipping planes to be used in the visualization Include a color bar to document the selected color map Notes (1) The isovalues to be used by the program must be included in a file (see API below). (2) The GUI only controls the clipping planes. There is no isovalue slider for this task. API Your program will have following API: > python isogm.py [–cmap ] [–clip ] where is the 3D scalar dataset, is the corresponding gradient magnitude, is the name of a file containing the isovalues to be used, is the optional name of a file containing a color map definition with following syntax: Lines preceded by the character ‘#’ are comments and should be ignored Each non-comment line must contain a scalar value followed by the R, G, and B values of the associated color. Finally, are the optional initial positions of the 3 clipping planes. Report Include in your report images of the color mapped isosurfaces computed by your program. Indicate clearly for each surface the corresponding isovalue. Each image should include a color bar. In addition, answer following questions: 2/8/2020 Programming Assignment 2 – Isosurfaces https://www.cs.purdue.edu/homes/cs530/projects/project2.html 4/6 1. What differences can you identify between the various isosurfaces in terms of their associated gradient magnitude distribution? 2. How do you interpret these results? Justify your answer. 3. What does that tell you about the value of the resulting visualization? Explain. Task 3 – Two-dimensional Transfer Function Combining the insight you gained from Task 1 and Task 2 you will now use the gradient magnitude data to filter out unwanted portions of your isosurfaces. Specifically, Task 2 has shown you what values of the gradient magnitude coincide with certain portions of your isosurface. You can therefore use this information to discard from an isosurface uninteresting portions by specifying a gradient magnitude interval outside which isosurface points should be removed. This kind of downstream filtering can be achieved by using vtkClipPolyData again but this time you will be applying it directly to the gradient magnitude values attached to the vertices of the isosurface. In fact, you will need to use two such filters for a given gradient magnitude interval, one to discard all the values less than and one to discard all the values larger than among the values that passed the first filtering stage. Implementation You will write a program similar to the one you wrote for Task 2 except that this time, the gradient magnitude information will not be directly displayed on the isosurface after resampling but instead used to determine which points should be removed from the isosurface in the visualization pipeline. Your program should allow the user to interactively modify the selection interval to facilitate the identification of an optimal range. Specifically, your program should meet following requirements: Take in input the name of both scalar volume and gradient magnitude datasets to be processed from the command line Optionally take in input the initial isovalue to consider Provide a GUI with two slider bars to allow the user to control the range (min et max) of gradient magnitude values to select Provide an additional slider bar to control the value of the selected isovalue Provide the same GUI as in Task 1 to control the position of 3 clipping planes to be used in the visualization Perform a resampling of the gradient magnitude on the isosurface Filter the isosurface using two consecutive vtkClipPolyData consistent with the gradient magnitude range currently selected Visualize the resulting filtered isosurface Note that in contrast to Task 2, you will only be considering one isosurface at a time here. This is meant to facilitate the adjustment of the gradient magnitude range on a per surface basis. API Your program will have following API: > python iso2dtf.py [–val ] [–clip ] where is the 3D scalar dataset and is the corresponding gradient magnitude to visualize, and are the optional initial positions of the 3 clipping planes. Report Include in your report high quality images for each dataset, corresponding to each filtered isosurface, while precisely indicating the matching isovalue. Indicate for each visualization which parameters / visual settings were used to create the image. In addition, provide an answer to following questions, with images to support your answers as necessary. [gradm , gra ] in dmax gradmin gradmax [gradm , gra ] in dmax 2/8/2020 Programming Assignment 2 – Isosurfaces https://www.cs.purdue.edu/homes/cs530/projects/project2.html 5/6 1. To what extent did the gradient magnitude filtering help in refining the isosurface selection? Be specific. 2. Which isosurfaces benefited the most from this filtering? Why? Task 4 – Complete visualization Using the isovalues that you identified in Task 1 and the gradient magnitude filtering ranges that you discovered in Task 3 to precisely characterize the various anatomical structures present in the data, you will now create a visualization where all the filtered isosurfaces are shown simultaneously using color and transparency. Implementation For this final implementation task, you will write a program that incorporates the various features of the programs written so far and uses transparency in addition to clipping planes to allow for all relevant isosurfaces to be shown simultaneously without excessive occlusion. Remember to use Depth Peeling to achieve correct transparency results! Specifically, your program must satisfy following requirements. Take in input from the command line the name of both scalar volume and gradient magnitude datasets to be processed Take in input the name of a file that specifies, for each isosurface, the corresponding isovalue, the associated gradient magnitude range, and the associated color and transparency. Perform a resampling of the gradient magnitude on each isosurface Filter each isosurface using two consecutive vtkClipPolyData consistent with the gradient magnitude range selected for that isosurface Visualize the resulting filtered isosurfaces with correct colors and transparency Provide the same GUI as in Task 1 to control the position of 3 clipping planes to be used in the visualization API Your program will have following API: > python isocomplete.py [–clip ] where is the 3D scalar dataset, is the corresponding gradient magnitude to visualize, is the name of a file containing all the information necessary to select, filter, and visualize the isosurfaces. The format of this file will be as follows. Lines starting with ‘#’ will be considered comments and ignored. Each following non-comment line that is not a comment will indicate an isovalue, a gradient magnitude range (min then max value), a RGB color and an opacity. It will have the form ” ” where ” ” indicates the gradient magnitude filtering range for the isosurface, ” specify the color associated with , and is the associated opacity. Report Include in your report, high quality images showing the results produced by your method for your particular selection of parameters for each dataset. Comment on your selection of the transparency for each isosurface. How does transparency benefit your visualization? Explain. Summary Analysis Comment on the effectiveness of isosurfaces for these medical imaging datasets in your report. Isosurfaces in general are widely used in medical applications. 1. What explanation can you propose for this success? 2/8/2020 Programming Assignment 2 – Isosurfaces https://www.cs.purdue.edu/homes/cs530/projects/project2.html 6/6 2. Comment on the quality of the images you were able to obtain in each case. 3. Discuss any shortcomings of the isosurfacing technique you may have come across in this project. 4. Comment on the role and meaning of gradient magnitude to filter isosurfaces. 5. Comment on the benefits and limitations of transparency and clipping planes to enhance the visualization. Datasets The datasets are available online. All datasets are of type vtkStructuredPoints, which is itself a specialized type of vtkImageData. Feet: CT (small, large), gradient magnitude (small, large) Head: CT (small, large), gradient magnitude (small, large) Submission Submit your solution for this project on Blackboard before February 18, 2020, 11:59 pm. Refer to the instructions below. Include all program files Make sure that your programs have the correct API! For Task 4, include the necessary parameter file for each dataset named head_params.txt and feet_params.txt. Include high resolution sample images showing results for each task. Include a html or PDF report summarizing what you have done and answering all the questions asked. The report should include high-resolution images. Include all submitted files in a single directory named _p2, where is your Purdue login. Do not include binary file Do not include data files Do not use absolute paths in your code
Objective The topic of this assignment is the visualization of 3D scalar fields through direct volume rendering. You will experiment with transfer function design and revisit some of the tasks of the second assignment to compare the effectiveness of isosurfacing and volume rendering in two application scenarios. Specifically, you will apply volume rendering to a medical dataset (similar to the CT volume used in the previous assignment) and to a computational fluid dynamics (CFD) simulation of turbulent combustion. Background The key to achieving good results with volume rendering is to select an effective transfer function. We saw in class that a good transfer function should reveal boundaries present in the volume, when such boundaries exist. When clear boundaries are not present, the transfer function should be designed to reveal important geometric structures in the data. In this assignment, you will be working with two datasets that illustrate these two scenarios: the CT dataset contains boundaries corresponding to the interface between different tissue types while the CFD dataset describes the spatial distribution of vorticity in a turbulent combustion and is globally smooth. The project starts by asking you to identify remarkable (iso)values in each dataset, which you will then 10/16/21, 10:23 PM Programming Assignment 3 – Volume Rendering and Transfer Functions https://www.cs.purdue.edu/homes/cs530/projects/project3.html 2/4 use as reference points to create your transfer function. The third part of the project invites you to compare the respective pros and cons of volume rendering and isosurfacing in the context of these two datasets. Tasks Task 1: Important Isosurfaces Your first task consists in determining for each dataset a set of isovalues that capture salient (remarkable) structures in the considered field. To do so, you will use the code that you wrote for the second assignment to identify important isosurfaces. In the case of the head dataset, salient isosurfaces capture boundaries corresponding to the skin, muscles, skull (and teeth). In the case of the combustion dataset, you will look for isosurfaces that reveal the sheet and tubular structures that are present in the flame. Bear in mind that fuzzy structures might be poorly captured by isovalues. Using different opacities for different isosurfaces, create for each dataset a visualization showing all isosurfaces simultaneously. Deliverables: Create two executables for this task: salient_head.py and salient_flame.py that each contain the (hardcoded) information needed to visualize the salient isosurfaces of the corresponding dataset using transparency. In both cases, your executable will obtain the name of the file to visualize from the command line (which allows us to specify an arbitrary location and resolution for the input file). > python salient_head.py > python salient_flame.py Report: Describe in the report how you selected the isovalues for each dataset. Include pictures showing each isosurface individually and other images showing all isosurfaces combined using transparency. Make sure to use the same camera setting across all images corresponding to the same dataset. To that end, refer to the code sample that showed you how to print out the current camera setting during an interactive session as well as save the current frame to file. Once you identify a suitable camera position, simply hard code the corresponding parameters in your program or create a mechanism to import those settings from file on the command line. Task 2: Transfer Function Design Now that you have found good isovalues, you will design a transfer function for each dataset based upon those values. For that, create a vtkVolumeProperty by following the example provided in Examples/VolumeRendering/Python/SimpleRayCast.py to define both color and opacity transfer functions in order to emphasize the selected isovalues. You are already familiar with vtkColorTransferFunctions from previous assignments. The opacity transfer function is defined through a vtkPiecewiseFunction. Your objective in designing the opacity transfer function is to reveal as much as possible of the internal structures of each dataset. The volume rendering itself will be performed by raycasting using a vtkSmartVolumeMapper. Note that this implementation will automatically determine the hardware resources available and perform GPU-based raycasting whenever possible. Select the compositing blend mode of vtkSmartVolumeMapper for value compositing along each ray. Your implementation should produce high-quality renderings by combining trilinear interpolation and small sampling distance along each ray: you will select SetInterpolationTypeToLinear() in the API of vtkVolumeProperty and manipulate the discretization along each ray via SetSampleDistance(). You will need to experiment with different values of the sampling distance to determine the precision necessary to obtain good results. Good results in particular should not exhibit aliasing artifacts such as moiré effect. Note that an appropriate value of the sampling distance depends both on the smoothness of the data and on the properties of your transfer function. Finally, you should activate the shading option (via ShadeOn() in vtkVolumeProperty()) in your rendering to further improve the visual quality of your results. Deliverables: create two executables dvr_head.py and dvr_flame.py that contain the information necessary to create high quality renderings of the corresponding dataset. In particular, the opacity and color 10/16/21, 10:23 PM Programming Assignment 3 – Volume Rendering and Transfer Functions https://www.cs.purdue.edu/homes/cs530/projects/project3.html 3/4 transfer functions must be hard coded in these programs. Like for the first task, your executables must obtain the name of the data file from the command line. > python dvr_head.py > python dvr_flame.py Report: Provide a detailed description (including diagram) of the various transfer functions you created along with a justification of the choices made. What method did you use to create each opacity transfer function? What do you consider to be the strengths and limitations of your solutions? Include in the report several images for each dataset that highlight the effectiveness of your transfer function and the quality of your volume rendering parameters. Task 3: Volume Rendering vs. Isosurfacing Provide for each dataset a side by side comparison between the results obtained for isosurfacing (Task 1) and volume rendering (Task 2). Make sure to use the same camera settings for both techniques in order to facilitate their comparison. No additional code should be written for this task: simply use the executables created for the previous tasks to create the images that will be included in the report. Report: Comment on the differences between the two techniques. Illustrate your argumentation by zooming on particular features of each volume. For each dataset, which technique do you find most effective? Why? Be specific. Summary Analysis Include in the report your critical assessment of volume rendering: What are in your opinion the pros and cons of this technique? Refer to the tasks of this project to justify your opinion. Data Sets You will be visualizing two datasets for this assignment. The first one is a head CT scan dataset similar to what you used for Project 2. Here, the data corresponds to a male subject, part of the Visible Human Project (National Library of Medicine). The second dataset corresponds to a computational fluid dynamics simulation of a turbulent combustion. In this case the provided scalar volume corresponds to the magnitude of the vorticity field, a quantity that is derived from the flow velocity and can be used to identify vortices in numerical datasets. Note that both datasets have been low-pass filtered (“smoothed”) to facilitate their visualization (e.g., reduce aliasing issues). The datasets are available online. All datasets are of type vtkStructuredPoints. Visible Male Head: CT scan, low resolution (unsigned short, 12.2MB) CT scan, high-resolution (unsigned short, 98MB) CFD Dataset: Vorticity magnitude (low-resolution) (unsigned short, 2.6MB) Vorticity magnitude (high-resolution) (unsigned short, 18.5MB) Submission Submit your solution for this project on Blackboard before March 15, 2021 at 11:59:59 pm. Refer to the instructions below. Include all program files (salient_head.py, salient_flame.py, dvr_head.py, dvr_flame.py) along with any other source code you may have. 10/16/21, 10:23 PM Programming Assignment 3 – Volume Rendering and Transfer Functions https://www.cs.purdue.edu/homes/cs530/projects/project3.html 4/4 Include high resolution sample images showing results for each task. Include a report briefly summarizing what you have done and answering all the questions asked. As always, the report should include high-resolution images. Include README.txt file with execution instructions (optional). Include all submitted files in a single directory named _p3, where is your Purdue login. Do not include binary file Do not include data files Do not use absolute paths in your code
Objective The topic of this assignment is vector field / flow visualization. You will study a delta wing dataset and visualize the velocity information using vector field visualization techniques. Your task will be to show the major flow structures present in the dataset (primary and secondary vortices and recirculation bubble on each side of the wing). In addition, you will visualize the spatial relationship that exists between the velocity (vector) field and the pressure (scalar) field. Refer to the corresponding instructions below. Task 1: Glyphs [20%] Your first task consists in using cutting planes to probe the vector values. Specifically, you will create a plane orthogonal to the X axis of the volume (the main axis of the wing) and sample the velocity vector field on that plane. You will need to follow an approach similar to what is demonstrated in ProbeCombustor.py for that purpose. To represent individual vectors as arrows, you will use vtkArrowSource as the source of a vtkGlyph3D filter. Use 3 plane at 3 different locations along the X axis (with normal pointing along the X direction) to capture the structures mentioned above. Show the delta wing geometry in each image for context (the corresponding geometry is provided as vtkUnstructuredGrid in a separate file). Deliverables: Create an executable named three_planes.py that contains the (hardcoded) information needed to visualize the vector glyphs on the 3 planes that you have selected. Your executable should receive the names of two files from the command line, namely the CFD file containing the vector field information and the file containing the geometry of the delta wing. > python three_planes.py Report: Explain in the report how you selected the planes used in your implementation and comment on the properties of the flow that you can discern in your visualization. Include pictures showing each cutting plane 10/16/21, 10:24 PM Programming Assignment 4 – Flow Visualization https://www.cs.purdue.edu/homes/cs530/projects/project4.html 2/3 individually (along with the associated glyphs) as well as other images showing all planes and the wing together. Task 2: Streamlines, Stream Tubes and Stream Surfaces [40%] Task 1 should provide you with a general sense of the location of interesting structures in the flow volume. Your second task now consists in using streamlines, stream tubes and stream surfaces as demonstrated in officeTubes.py and streamSurface.py to show how the flow swirls around the vortices present in the data. Deliverables: You will construct 3 visualizations for this task. A first executable showing a large number (between 50 and 200) of streamlines. A second executable showing a small number of stream tubes A third executable showing a stream surface seeded along an appropriately chosen line segment (aka rake). In each case, the seeding locations and the other parameters of the technique must be hardcoded in your program. You must choose parameter values that produce good quality results and capture the behavior of the flow around the vortices on each side of the wing. Note that each visualization should represent the velocity magnitude using color coding and the corresponding color scale should be provided for reference. Show the delta wing geometry in each image for context. > streamlines > streamtubes > streamsurfaces Report: Explain in the report how the seeding locations were chosen for each of these three techniques and how they relate to the observations made in Task 1. Task 3: Combining Scalar and Vector Visualization [20%] The scalar and vector information available for this dataset provide two complementary perspectives on the properties of the flow. For the third task of this assignment, you will combine isosurfaces of pressure with streamlines to visualize the relationship between the streamlines’ geometry and the shape of the isosurfaces. Create visualizations in which the streamline seeds and the isovalues of the isosurface are chosen in such a way as to best illustrate the correlation between the two kinds of object. Deliverables: Create an executable named combined.py that produces a visualization of the CFD dataset, combining isosurfaces of the pressure scalar field, streamlines of the velocity vector field, and geometry of the delta wing. The various parameters needed to create the visualization must be hardcoded in the program. Your executable should receive from the command line the names of the files needed to create the visualization: velocity and pressure dataset (in the same file), and wing geometry description. > python combined.py Report: Describe in the report the things you tried before arriving at the proposed solution and explain why your final selection is a good one. Show the delta wing geometry in each image for context. Task 4: Analysis [20%] 10/16/21, 10:24 PM Programming Assignment 4 – Flow Visualization https://www.cs.purdue.edu/homes/cs530/projects/project4.html 3/3 Considering your results in Task 1 and Task 2 of the assignment, comment on the effectiveness of the resulting visualizations for your understanding of this dataset. What were the pros and cons of each technique? Comment on the results you were able to achieve in Task 3 by integrating isosurfacing and vector visualization. Did you find this combination beneficial? Provide a justified answer to each of these questions in the report. Data Sets The CFD dataset used in this project is a available as a (fairly) large vtkUnstructuredGrid. The information available corresponds to the velocity (vector field) and the pressure (a scalar field). A separate file describing the geometry of the delta wing is also available (also a vtkUnstructuredGrid). Note that the CFD simulation that produced this dataset used adaptive mesh refinement, which explains the vast discrepancies that exist between the resolution of the mesh next to the wing and further away from it. 3D Flow: Velocity (vector field), and Pressure (scalar field) in double precision (vfem.vtu, 170 MB) Wing geometry (wing.vtu, 1.0 MB ) Submission Submit your solution for this project on Brightspace before April 1, 2021 at 11:59 pm. Refer to the instructions below. Include all program files (three_planes.py, streamlines.py, streamtubes.py, streamsurfaces.py, combined.py) along with any other source code you may have. Include high resolution sample images showing results for each task. Include a report summarizing what you have done and answering all the questions asked. As always, the report should include high-resolution images. Include a README.txt file with execution instructions (optional). Include all files to be submitted in a single directory named _p4, where is your Purdue login. Do not include binary file Do not include data files Do not use absolute paths in your code Use Brightspace for your submission.

![[SOLVED] Cs530 projects 1 to 4 solution](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[SOLVED] CSE340 Project 1: Lexical Analysis Solution](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.