Visualization using Matlab April 10, 2007 Rachael Brady CSEM Matlab Workshop.

Slides:



Advertisements
Similar presentations
3D Graphics Rendering and Terrain Modeling
Advertisements

 Engineering Graphics & Introductory Design 3D Graphics and Rendering REU Modeling Course – June 13 th 2014.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Information Visualization.
(conventional Cartesian reference system)
Introduction to Volume Visualization Mengxia Zhu Fall 2007.
Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC /11/2004.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
Importance Driven Volume Rendering Authors: I. Viola, A. Kanitsar, M. Gröler Visualization II Instructor: Jessica Crouch.
MULTIMEDIA TECHNOLOGY SMM 3001 MEDIA - GRAPHICS. In this chapter how the computer creates, stores, and displays graphic images how the computer creates,
Computer Graphics Mirror and Shadows
Computer Graphics An Introduction. Computer Graphics 26/9/2008Lecture 12 What’s this course all about? We will cover… Graphics programming and algorithms.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
Polygon Shading. Assigning color to a shape to make graphical scenes look realistic, or artistic, or whatever effect we’re attempting to achieve But first.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
19/18/ :34 Graphics II Volume Rendering Session 10.
Chapter 3 Space. Three Kinds of Space Space as format: size, scale, and presentation. Space as the relationships among objects and the areas surrounding.
Lecture 3 : Direct Volume Rendering Bong-Soo Sohn School of Computer Science and Engineering Chung-Ang University Acknowledgement : Han-Wei Shen Lecture.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
-Global Illumination Techniques
Scientific Visualization Module 6 Volumetric Algorithms (adapted by S.V. Moore – slides deleted, modified, and added) prof. dr. Alexandru (Alex) Telea.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006 Real-Time Volume.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 Going-through.
Marching Cubes: A High Resolution 3D Surface Construction Algorithm William E. Lorenson Harvey E. Cline General Electric Company Corporate Research and.
Direct Volume Rendering (DVR): Ray-casting Jian Huang This set of slides references slides used by Prof. Torsten Moeller (Simon Fraser), Prof. Han-Wei.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
September 5, 2013Computer Vision Lecture 2: Digital Images 1 Computer Vision A simple two-stage model of computer vision: Image processing Scene analysis.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Colormaps 101 Sources – Russell Taylor Comp 290 course notes Colin Ware – Perception for Design IBM Web Site An Excellent Paper: A Rule-based Tool for.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
Outline Announcements –HW II due Friday –HW III option Interpolation Colormaps.
Digital Media Dr. Jim Rowan ITEC 2110 Vector Graphics II.
CS559: Computer Graphics Lecture 8: 3D Transforms Li Zhang Spring 2008 Most Slides from Stephen Chenney.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
CS559: Computer Graphics Lecture 8: Warping, Morphing, 3D Transformation Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Course Introduction to virtual engineering Óbuda University John von Neumann Faculty of Informatics Institute of Applied Mathematics Lecture and laboratory.
Digital Media Dr. Jim Rowan ITEC 2110 Vector Graphics II.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
CHAPTER 10 VOLUME VISUALIZATION. OUTLINE 3D (volumetric) scalar fields Slice plane and isosurfaces techniques are limited in showing only a subset of.
June 14, ‘99 COLORS IN MATLAB.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
EEE 242 Computer Tools for Electrical Engineering
Digital Media Dr. Jim Rowan ITEC 2110 Vector Graphics II.
1 of 32 Computer Graphics Color. 2 of 32 Basics Of Color elements of color:
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
CS552: Computer Graphics Lecture 35: Rendering. Recap Illumination Model o Light Source and surface o Effect of multiple light source o Colored lights.
Reading and Writing Image Files
John Federici NJIT Physics Department
- Introduction - Graphics Pipeline
Volume Visualization Chap. 10 November 20 , 2008 Jie Zhang Copyright ©
Visualization Friday Forum
3D Graphics Rendering PPT By Ricardo Veguilla.
CS451Real-time Rendering Pipeline
Chapter 14 Shading Models.
Volume Visualization Chap. 10 December 3 , 2009 Jie Zhang Copyright ©
Real-Time Volume Graphics [06] Local Volume Illumination
Volume Rendering (2).
Volume Rendering.
Yang-Ming University, Taipei, Taiwan
Dr. Jim Rowan ITEC 2110 Vector Graphics II
Dr. Jim Rowan ITEC 2110 Vector Graphics II
Presentation transcript:

Visualization using Matlab April 10, 2007 Rachael Brady CSEM Matlab Workshop

Today’s Topics Color in Matlab 2D and 3D plots Rendering data as an image 3D volumetric techniques –IsoSurface –Volume Rendering

Resources Get an idea of what Matlab can do by looking at the 3-D visualization “Contents” and Graphics “Contents” (execute ‘demo’ on the command line) At Duke, the ISDS had made some nice webpages giving another view on several of these commands The mathworks file exchange website is an excellent resource For color map help, see colorbrewer.org

Human Perception Humans perceive COLOR and SHAPE before anything else. Pay attention to these two attributes when making any kind of visual representation of your data (show Healey pre-attentive application)

A word about color Humans do not perceive color linearly. We see lightness to darkness in a linear fashion. When coloring isomorphic data (i.e. showing data value through color in a continuous manner), the color ramp should go from dark to light (or vice-versa). Exceptions include 2- ended color schemes. Different color schemes should be used when the task is different. For example, showing discrete steps such as map contours should be shown with gradations in color. Showing different data belonging to categories should be shown with divergent colors.

Colormap Choice Should be Linked to Task Atmospheric Motion Bergman, Rogowitz, Treinish, IEEE Vis ‘95

Colormap Choice Should be Linked to Task Pollution Levels Bergman, Rogowitz, Treinish, IEEE Vis ‘95

Not ordered (double ended) Tufte ‘97, pg. 77. Taken from Russell Taylor II, UNC CS 290 Course Notes

Ordered (and double-ended) Tufte ‘97, pg. 76. Taken from Russell Taylor II, UNC CS 290 Course Notes

Color is useful for classification Taken from Russell Taylor II, UNC CS 290 Course Notes

Color is useful for classification Taken from Russell Taylor II, UNC CS 290 Course Notes

Color in Matlab Matlab only “knows” eight colors: Yellow (y)Green (g) Magenta (m)Red (r) Cyan (c)Blue (b) White (w)Black (k) All other colors must be specified as rgb triplets See colorbrewer.org for good colors and their rgb specifications

Color in Matlab Matlab contains many default colormaps. Perceptually linear ones are Gray, Hot, Summer, Bone, Pink Use the ‘colormap’ command to reset the current colormap to one of the defaults, or create one of your own. A cmap is merely an nx3 vector of values from [0-1]. A good test for a dark->light colormap is to make a black and white xerox the color image. Do the colors separate? (show col_bar, 2, 3)

Color is not needed to understand shape, spatial relationships of objects, or movement. Laboratory assistant went 21 years without realizing he was color-blind Don’t use color if you don’t need to. Taken from Russell Taylor II, UNC CS 290 Course Notes

Plots Default 2d (‘plot’) and 3d (‘plot3’) plots in Matlab are generally good. The only recommended change is to avoid the legend (‘legend hide’). Replace this with direct annotation. The functions mesh and surf are the same, except mesh draws in wireframe. High frequency information on surfaces are easier seen with lighting and shadows. lighting gouraud or lighting phong Normally, surfaces would need to have their properties set (FaceColor, EdgeColor, etc) to make lighting work. One can also use the ‘shading’ command: flat, interp, faceted as a shortcut (run surfExample)

imagesc vs. pcolor Both image and pcolor generate a 2-D colored image from a 2D matrix. An image coordinate system is left handed with the origin in the upper left corner. A pseudocolor plot (pcolor) uses a right handed coordinate system with the origin in the lower left corner. An image plot is pixel centered, a pcolor plot is vertex centered.

Consider the matrix Y generated from the following code: n=6; r=(0:n)’/n; theta=pi*(-n:n)/n; Y is a 7x13 matrix Y=r*sin(theta);

Imagesc(Y)Pcolor(Y)

3D Data Vis - Isosurface An Isosurface is the equivalent to a contour line in one dimension higher. An isosurface of value 10 has volumetric data on one side whose values are all larger than 10, and on the other side whose values are all smaller than 10. Perception of 2D surfaces in 3D is what the visual system is tuned for A surface requires an underlying mesh. The calculation of this mesh and the surface introduces errors to the viewed data. Surfaces can occlude each other. Transparency on surfaces does not work well since we lose the shape information from the lighting function.

Matlab Isosurface Isosurface(x, y, z, v, ) calculates the surface mesh. It must be rendered with the ‘patch’ command. (run isoSurf) Show ring at end of surface

3D Data Vis - Volume Rendering Image is generated directly from data volume Advantages –No need to calculate geometrical surface –Very compelling “what you see is what is there” Disadvantages –Computationally expensive –Difficult to perceive structure without motion

Volume Rendering Basic Idea: –Integrate through volume “Every voxel contributes to image” No intermediate geometry extraction Greater flexibility than isosurfaces –May be X-ray-like –May be surface-like –Results depend on the transfer function (see next) Ray D0D0 D1D1 D2D2 D3D3

Transfer Function Maps from density value to Opacity Taken from Russell Taylor II, UNC CS 290 Course Notes

Transfer Function Opacity and color maps may differ Taken from Russell Taylor II, UNC CS 290 Course Notes

Transfer Function Different colors, same opacity Taken from Russell Taylor II, UNC CS 290 Course Notes

Common Mixing Functions Maximum Intensity Projection (MIP) Value = max(D 0, D 1, D 2, D 3 ) X-ray-like (inverse of density attenuation) Value = sum(D 0, D 1, D 2, D 3 ) Composite (back-to-front, no color) Value(i) = D i + (Value(i+1) * (1-D i )) Ray D0D0 D1D1 D2D2 D3D3 Modified from Russell Taylor II, UNC CS 290 Course Notes

Volume Rendering Ray Traced Texture Mapped

Volume Rendering in Matlab Joe Conti has submitted a very nice volume renderer at the matlab file exchage, called vol3d.m. It uses 2D texture maps to do the volume rendering. (run vol3dExample)

Thank You

Resources Get an idea of what Matlab can do by looking at the 3-D visualization “Contents” and Graphics “Contents” (execute ‘demo’ on the command line) At Duke, the ISDS had made some nice webpages giving another view on several of these commands The mathworks file exchange website is an excellent resource For color map help, see colorbrewer.org