DOC PREVIEW
OSU CS 553 - Directly Visualizing Volume Data

This preview shows page 1-2 out of 6 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Directly Visualizing Volume DataMike [email protected] – May 14, 2013Oregon State UniversityComputer GraphicsOregon State UniversityVolume Data: A DefinitionA volume is a 3D discretely sampled data set where the size of the voxels have been expanded to occupy the space to the neighboring voxels.mjb – May 14, 2013Oregon State UniversityComputer GraphicsWhy Do We Care About Volume Visualization?• Medical: CAT, MRI, 3D ultrasound• Science and engineering: CFD, stress, thermal, molecular• Volumes are normally very difficult to comprehendmjb – May 14, 2013Oregon State UniversityComputer GraphicsUnderstanding Volume Data Usually Involves a CompromisePoint CloudsInterpolated-colors cutting planesContours cutting planeAll values everywhere, hard to see very much, distracting artifactsAll values in a single planeDiscrete values in a single planemjb – May 14, 2013Oregon State UniversityComputer GraphicsIsosurfacesA single value everywhereBecause of these compromises, these are all considered to be indirect ways to visualize volume dataDirect Volume RenderingComposite the colors and alphas of the voxelsmjb – May 14, 2013Oregon State UniversityComputer GraphicsA Volume Element, or voxelTransfer FunctionOpacityColorsFrequency Histogram (usually a log scale)mjb – May 14, 2013Oregon State UniversityComputer GraphicsOSU vxTransfer Function Sculpting WindowOpacity)2CCColdnew).1('Voxel CompositingRecall this color blending equation from the OpenGL Transparency notes:CIn “Voxel World”, things work the same way:mjb – May 14, 2013Oregon State UniversityComputer GraphicsColdC’Cnew, αTMIN = 0.TMAX = 100.The color transfer function is a Black-Red-Yellow-White heated object scale, mapping a scalar value of 0. to Black, and 100. to White.The opacity transfer function is a linear ramp so that the opacity is 1. (opaque) when T = 100. and 0. (transparent) when T = 0.R,G,B = (0.,1.,1.)R,G,B = (?,?,?)T = 33.33Voxel Compositing Examplemjb – May 14, 2013Oregon State UniversityComputer GraphicsYou are compositing back-to-front through the volume. At this moment, the running values of RGB are (0., 1., 1.) . The next voxel you encounter has a T value of 33.331. What is the color of just this voxel?2. What is the opacity of just this voxel?3. What will the new running RGB values be when you are done compositing this voxel with the old running RGB values?What is the color of just this voxel?What is the opacity of just this voxel?mjb – May 14, 2013Oregon State UniversityComputer GraphicsWhat will the new running RGB values be when you are done compositing this voxel with the old running RGB values?Cropping the Volume based on Data Valuemjb – May 14, 2013Oregon State UniversityComputer GraphicsCropping the Volume based on Spatial Locationmjb – May 14, 2013Oregon State UniversityComputer Graphics“Magic Lens” to Selectively Look InsideVolume DataDisplay Parameters #1Display Parameters #2mjb – May 14, 2013Oregon State UniversityComputer GraphicsOne Display3Lightingmjb – May 14, 2013Oregon State UniversityComputer Graphics(,,)dS dS dSnSdx dy dzXZYVolume Rendering with Parallel Texture Planesmjb – May 14, 2013Oregon State UniversityComputer Graphicsunsigned char TextureXY[NZ][NX][NY][4];“NZ slices of an NX by NY RGBA exture"unsigned char TextureYZ[NX][NY][NZ][4];“NX slices of an NY by NZ RGBA texture"unsigned char TextureXZ[NY][NX][NZ][4];“NY slices of an NX by NZ RGBA texture"nge you want to view … )ar) ( 255.*r + .5 );ar) ( 255.*g + .5 );ar) ( 255.*b + .5 );ar) ( 255.*alpha + .5 );In a callback that is called whenever the opacity transfer function changes:Zside is set from somewhere elsemjb – May 14, 2013Oregon State UniversityComputer GraphicsvoidFillXY( void ){float alpha; // opacity at this voxelfloat r, g, b; // running color compositefor( int x = 0; x < NX; x++ ){for( int y = 0; y < NY; y++ ){r = g = b = 0.;for( int zz = 0; zz < NZ; zz++ ){// which direction to fill:int z;if( Zside == PLUS )z = zz;elsez = ( NZ-1 ) - zz;if( … this scalar value is not in the ra{r = g = b = 0.;alpha = 0.;}else{r = Nodes[x][y][z].r;g = Nodes[x][y][z].g;b = Nodes[x][y][z].b;alpha = MaxAlpha;}TextureXY[zz][y][x][0] = (unsigned chaTextureXY[zz][y][x][1] = (unsigned chaTextureXY[zz][y][x][2] = (unsigned chaTextureXY[zz][y][x][3] = (unsigned cha}}}}glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );int filter = GL_NEAREST;if( Bilinear )filter = GL_LINEAR;elsefilter = GL_NEAREST;glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter );glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter );glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );glEnable( GL_TEXTURE_2D );glBlendFunc( GL SRC ALPHA GL ONE MINUS SRC ALPHA);In Display( ), I:mjb – May 14, 2013Oregon State UniversityComputer GraphicsglBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );glEnable( GL_BLEND );DetermineVisibility( );float z0, dz;if( Major == Z ){if( Zside == PLUS ){z0 = -1.; // back-to-frontdz = 2. / (float)( NZ - 1 );}else{z0 = 1.; // front-to-backdz = -2. / (float)( NZ - 1 );}Sets the global variables Major, Xside, Yside, and ZsideglBegin( GL_QUADS );for( z = 0; z < NZ; z++, zcoord += dz ){In Display( ), II:x=-1., y=-1., s=0., t=0.x= 1., y= 1., s=1., t=1.x=-1., y= 1., s=0., t=1.x= 1., y=-1., s=1., t=0.mjb – May 14, 2013Oregon State UniversityComputer Graphics{glTexImage2D( GL_TEXTURE_2D, 0, 4, NX, NY, 0, GL_RGBA, GL_UNSIGNED_BYTE, &TextureXY[z][0][0][0] );glTexCoord2f( 0.f, 0.f );glVertex3f( -1.f, -1.f, zcoord );glTexCoord2f( 1.f, 0.f );glVertex3f( 1.f, -1.f, zcoord );glTexCoord2f( 1.f, 1.f );glVertex3f( 1.f, 1.f, zcoord );glTexCoord2f( 0.f, 1.f );glVertex3f( -1.f, 1.f, zcoord );}glEnd( );} // if( Major == Z )Human Embryomjb – May 14, 2013Oregon State UniversityComputer Graphics4Geophysicsmjb – May 14, 2013Oregon State UniversityComputer GraphicsVolume Interaction: The Visible Humanmjb – May 14, 2013Oregon State UniversityComputer GraphicsInteractive Volume Visualization forComputational Fluid Dynamicsmjb – May 14, 2013Oregon State UniversityComputer GraphicsVolume Interaction in Cancer researchmjb – May 14, 2013Oregon State UniversityComputer GraphicsMolecular Sciencemjb – May 14, 2013Oregon State UniversityComputer GraphicsSolar Windmjb – May 14, 2013Oregon State UniversityComputer Graphics5OSU


View Full Document

OSU CS 553 - Directly Visualizing Volume Data

Download Directly Visualizing Volume Data
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Directly Visualizing Volume Data and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Directly Visualizing Volume Data 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?