Objective: Investigate the use of MATLAB for navigating and visualizing an assortment of different datasets in 3-dimensi

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Objective: Investigate the use of MATLAB for navigating and visualizing an assortment of different datasets in 3-dimensi

Post by answerhappygod »

Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 1
Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 1 (241.39 KiB) Viewed 38 times
Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 2
Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 2 (282.82 KiB) Viewed 38 times
Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 3
Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 3 (265.22 KiB) Viewed 38 times
Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 4
Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 4 (278.72 KiB) Viewed 38 times
Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 5
Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 5 (296.24 KiB) Viewed 38 times
Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 6
Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 6 (287.09 KiB) Viewed 38 times
Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 7
Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 7 (277.69 KiB) Viewed 38 times
Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 8
Objective Investigate The Use Of Matlab For Navigating And Visualizing An Assortment Of Different Datasets In 3 Dimensi 8 (253.08 KiB) Viewed 38 times
Objective: Investigate the use of MATLAB for navigating and visualizing an assortment of different datasets in 3-dimensional (3D) space. Introduction: In scientific visualization and computer graphics, volume rendering is a set of techniques used to display a 2-dimensional (2D) projection of a 3D discretely sampled data set. A typical 3D dataset is a group of 2D slice images acquired by a computed tomography (CT), magnetic resonance imaging (MRI), or ultrasound (US) scanner. Usually these are acquired in a regular pattern (e.g. one slice every millimeter) and usually have many image pixels arranged in a regular pattern. This is an example of a regular volumetric grid, with each volume element, or voxel, represented by a single value that is obtained by sampling the immediate area surrounding the voxel. Typical scalar volume data is composed of a 3D array of data and three coordinate arrays of the same dimensions. The coordinate arrays specify the x-, y-, and z-coordinates for each data point. The units of the coordinates depend on the type of data. For example, flow data might have coordinate units of inches and data units of psi. Many existing MATLAB functions are useful for visualizing scalar data: Slice planes provide a way to explore the distribution of data values within the volume by mapping values to colors. You can orient slice planes at arbitrary angles, as well as use nonplanar slices. You can specify data used to color isosurfaces, enabling you to display different information in color and surface shape. Contour slices are contour plots drawn at specific coordinates within the volume. Contour plots enable you to see where in a given plane the data values are equal. Isosurfaces are surfaces constructed by using points of equal value as the vertices of graphic objects. . . To render a 2D projection of the 3D data set, one first needs to define a camera in space relative to the volume. Also, one needs to define the opacity and color of every voxel. For example, a volume may be viewed by extracting isosurfaces from the volume and rendering them or by rendering the volume directly as a block of data. The latter is a computationally intensive task but can be performed in several ways. In

this laboratory exercise, we will introduce and explore an assortment of MATLAB functions and examples for both visualizing discrete data in 3D space. This is going to be fun so let's get started. 1. Visualizing Vector Volume Data The coneplot command plots velocity vectors as cones at x, y, z points in a volume. The cones represent the magnitude and direction of the vector field at each point. 8 Load data load wind U V W X Y Z [m, n, pl = size (u): Calculate the location of the cones (Cx, cy, Cz) = meshgrid(1:4:m, 1:4:n, 1:4:p) : 8 Draw the cone plot h = coneplot (u, v, w,Cx, Cy, Cz, y, 4); set(h, EdgeColor, none) axis tighe equal view (37, B2 box or colormap (hsv) light The streamline function plot streamlines for a velocity vector at x, y, z points in a volume to illustrate the flow of a 3D vector field. clear the current axes Cla [m, n, pl = size (us Calelate the starting points on the same (sx, Sy, Sz) = meshgria 1, 1:5:n, 15:) w the samling streamline (u,v,w.sx, Sy, Sz) axis eight equa view (732) box On

The streamtube function plots stream tubes for a velocity vector at x, y, z points in a volume. The width of the tube is proportional to the normalized divergence of the vector field at each point. cla [m, n,p] = size (u): 8 Calculate the starting pean Cheure amine (Sx, Sy, Sz) = meshgrid 1, Sun, 1:5:p); 8 Draw the streamtubes and any otace h = streamtube (u, v,w.sx, Sysz): & Use 'set to change properes at an area or objects set (h, 'FaceColor, cyan set (h, Edgecolocnone axis tight equal view (37,32) box on, light Here, we combine volume visualizations in a single plot to get a more comprehensive picture of a velocity field within a volume. cla Wind speed at each point in the volume spd = sqrtkuu + V + W. W ISOSurade to the OS Lide the volume [fo, vo = isosurface (xyz, spd, 40); Toda pis or the end of the me [fe, ve, ce = isocaps ( xspd 40) Draw the otace Eneme pl = patch (Badesco Wecevo) pl.FaceColor = Need pl.EdgeColor=none Draw the end caps of the volume p2 = patch (Neadase, vertiteve, aceVertexcDatace p2 . FaceColor = inte p2.EdgeColor = nane Isasmace on the one [fc, vel = isosurface trz, spd, 30); Reduce the number owes and vertices [fe, vel = reducepatch (e, ve, 0.2); Drebe poneple

load mi D = squeeze (D); To display one of the MRI images, use the image command. First, create a new ligure that uses the MRI colormap, which is loaded with the data. Then index into the data array to obtain the data in the cighth image and adjust axis scaling as follows: figure colormap (map) image num = 8 image (D(:, :,image num) axis image Let's save the x- and y-axis limits for use in the next part of the example, X = Xlims y = ylim: It is customary to visualize MRI data as volume data because it is a collection of slices taken progressively through the 3D object. We can use contourstice to display a contour plot of a volume slice. Now, let's create a contour plot with the same orientation and size as the image created in the first part of this example. To improve the visibility of details, this contour plot uses the jer colormap. The brighter function reduces the brightness of the color values. am = brighten (jet (length (map, -0.5 figure colormap (am) contourslice D. 0, 0, image num) axis Adjuse the y-axis direction xlim (x) Set LE ylim SY Set LLE daspect (1,1,1) see the data aspect ratio Unlike images, which are 2D objects, contour slices are 3D objects that you can display in any orientation. For example, you can display four contour slices in a 3D view

hi.FaceColor = 'cyan'; hi. EdgeColor = 'none'; Starting points for streamline (sx, sy, sz) = meshgrid(80, 20:10:50, 0:5:15): Draw the streamlines h2 = streamline (x, y, 2, u, v.W. Ex. sy. 82) set (h2, Color', 1.41.4) axis tight equal view (37, 32) boxon light 2. Displaying Topographic Data This example shows several ways to represent the Earth's topography. The data used in this example was provided by the National Geophysical Data Center, NOAA Department of Commerce under data announcement 88-MGG-02. The data file, topo. mat, contains topographic data, topo is the altitude data and topomap! is a colormap for the altitude. load topo topo topomapi whos topo, topomapi) Load data One way to visualize topographic data is to create a contour plot. To show the outline of the Earth's continents, plot points that have zero altitude. The first three input arguments to contour specify the X, Y, and Z values on the contour plot. The fourth argument specifies the contour levels to plot. x = 0:359; y = -89,90; Longitude Latitude figure contour(x,y, topo [00] axis equ See una be he same ne box PC Dieplay bounding bos a = gee, e cene ax. Xin = 8601 ax-YU - 90 90 Set mes ax.xrick - co 60 120 180 240 300 3801 Denne ax Yrick - (-90 60 30 30 60 9013 De

We can create an image of the topography using the elevation data a custom colormap. The topography data is treated as an index into the custom colormap. Set the CDataMapping of the image to scaled to linearly scale the data values to the range of the colormap. In this colormap, the shades of green show the altitude data and the shades of the blue represent depth below sea level. image (10 360) (-90 90), Flip topo), DataMappingscaled colormap(topomapi) axis equal al unit beheer ax = gca; Menu ax.XLim = 10 360) & LE ax. Ylim = (-90 90), LALE ax.xTick = [0 60 120 180 240 300 360) Deletely ax. YTick = (-90 -60 -30 0 30 60 90) Denne veke Texture mapping maps a 2D image onto a 3D surface. To map the topography to a spherical surface, set the color of the surface, specified by the CData property, to the topographic data and set the FaceColor property to *texturemap clf (x, y, z) = sphere (50) s = surface (x, y, z); Ceata a sphere Plot spherical surface s.@Data topo. Set color delta ce topeguaphie data s. FaceColor = texturemap use teicture mapping Remove ige s. Edgecolor = "none" s. EaceLighting = gouneud s. SpecularStrength = 0.4: light (Position-101 Preferred ting Ourved surface change the strength the elected ight Add a 19h axis square oft Betaris Bauare and remove and view ([-30, 30) Det ne viewing ang 3. Displaying 3-dimensional Medical Images An example of scalar data includes MRI data. This data typically contains several slice planes taken through a volume, such as the human body. MATLAB provides an MRI dataset that contains 27 image slices of a human head. The first step is to load the data and transform the data array from 4D to 3D.

figure colormap (cm) contourslice (D, 0, 0, (1,12,19,271,8): view (3); axis tight box You can use isosurfaces to display the overall structure of a volume. When combined with isocaps, this technique can reveal information about data on the interior of the isosurfaces. Before we proceed, let's smooth our dataset with smooth3, which is a 3D lowpass filter, then use isosur faces to calculate the isodata. Use patch to display this data in a figure that uses the original grayscale colormap for the isocaps. figure colormap (map) Ds = smooth3 (D) : hiso = patch(isosurface (Ds, 5), 'FaceColor (1, 0.75, 0.657 Edgecolar none isonormals (Ds, hiso) The isonormals function renders the isosurfaces using vertex normal obtained from the smoothed data, improving the quality of the isosurfaces. The isosurfaces uses a single color to represent its isovalue. Let's now use isocaps to calculate the data for another patch that is displayed at the same isovalue (5) as the isosurfaces. We will use the unsmoothed data (D) to show the details of the interior. You can see this as the sliced-away top of the head. The low isocap is not visible in the final view. hcap - patch (isacaps (D, Sacecolo unter den ene Define the view and set the aspect ratio as done previously: view (35, 30) axis Sicht daspect (11,1, 0.41) We can add lighting and recalculate the surface normal based on the gradient of the volume data, which produces a smoother lighting. Increase the AmbientStrength property of the isocap to brighten the coloring without affecting the isosurfaces. Set the SpecularColorRellectance of the isosurface to make the color of

the specular reflected light closer to the color of the isosurfaces, then set the SpecularExponent to reduce the size of the specular spot. lightangle (45,30); lighting gouraud hcap.AmbientStrength 0.6; hiso. SpecularColorReflectance hiso. SpecularExponent 50; = 0; box An isocap combined with an isosurfaces can be used to visualize MRI data. The isocaps use interpolated face coloring, which means the figure colormap determines the coloring of the patch. This example uses the colormap supplied with the data. To display isocaps at other data values we can use the subvolume command as follows: figure [X, Y, Z, D = subvolume (D, [60, 80, nan, 80, nan, nan]); pl - patch (isosurface (x, y, z,D, 5), Facecolor(0.36, 0.22 0.21], Edgecolor', none) ; isonormals (x, y, z, D,pl); p2 - patch (isocaps (x, y, z, D, 5), FacecolominterpageColor", none; view (3) axis tight; daspect ([1 1 0.4) colormap (gray (100) camlight right camlight left; lighting gourand
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply