SlideShare a Scribd company logo
1 of 35
Direct Volume
Rendering (DVR):
Ray-casting
Mengxia Zhu
Fall 2007
Light: bouncing photons
 Lights send off photons in all directions
 Model these as particles that bounce off objects in the scene
 Each photon has a wavelength and energy (color and
intensity)
 When photon bounce, some energy is absorbed, some
reflected, some transmitted
 If we can model photon bounces we can generate
image
 Techniques: follow each photon from the light source
until
 All of its energy is absorbed (after too many bounces)
 It departs the known universe
 It strikes the image and its contribution is added to
appropriate pixel
Forward Ray Tracing
 Rays are the path of these photons
 This method of rendering by following photon path is
called ray tracing
 Forward ray tracing follows the photon in direction that
light travels (from the source)
 Big problem with this approach:
 Only a tiny fraction of rays will reach the image
 Extremely slow
 Ideal Scenario:
 We’d like to magically know which rays will eventually
contribute to the image, and trace only those
Direct: No conversion to surface geometry
Backward Ray Tracing
 The solution is to start from the image and
trace backwards
 Start from the image and follow the ray until the
ray finds or fail to find a light source
Backward Ray Tracing
 Basic ideas:
 Each pixel gets light from just one direction- the line
through the image point and focal point
 Any photon contribute to that pixel’s color has to come
from this direction
 So head in that direction and find what is sending light
this way
 If we hit a light source-we’re done
 If we find nothing-we’re done
 At the end we’ve done forward ray tracing, but
only for rays that contribute to the image
Basic Idea: Ray Casting
Based on the idea of ray tracing •Only consider Primary Ray
•Trace from eat each pixel
as a ray into object space
• Compute color value along
the ray, composite
• Assign the value to the
pixel
Data Representation
•3D volume data are represented by a finite number of cross
sectional slices (hence a 3D raster)
•On each volume element (voxel), stores a data value (if it uses
only a single bit, then it is a binary data set. Normally, we see a
gray value of 8 to 16 bits on each voxel.)
N x 2D arraies = 3D array
Data Representation (2)
What is a Voxel? – Two definitions
A voxel is a cubic cell, which
has a single value cover
the entire cubic region
A voxel is a data point
at a corner of the cubic cell
The value of a point inside the
cell is determined by interpolation
Ray Casting
 Stepping through the volume: a ray is cast into the volume, sampling the
volume at certain intervals
 The sampling intervals are usually equi-distant, but don’t have to be
 At each sampling location, a sample is interpolated / reconstructed from the
grid voxels
 popular filters are: nearest neighbor (box), trilinear (tent), Gaussian, cubic
spline
 Classification: map from density to color, opacity
 Composite colors and opacities along the ray path
Basic Idea of Ray-casting
Pipeline
c1
c2
c3
Raycasting
color
opacity
1.0
volumetric compositing
object (color, opacity)
Raycasting
color
opacity
Interpolation
kernel
1.0
object (color, opacity)
volumetric compositing
Raycasting
color c = c s s(1 - ) + c
opacity  =  s (1 - ) + 
1.0
object (color, opacity)
volumetric compositing
Interpolation
kernel
Raycasting
color
opacity
1.0
object (color, opacity)
volumetric compositing
Raycasting
color
opacity
1.0
object (color, opacity)
volumetric compositing
Raycasting
color
opacity
1.0
object (color, opacity)
volumetric compositing
Raycasting
color
opacity
1.0
object (color, opacity)
volumetric compositing
Raycasting
color
opacity
object (color, opacity)
volumetric compositing
Trilinear - Interpolation
eye
image pixel
viewing ray
voxel
sample point
trilinear
interpolation
Classification/Transfer Function
 Maps raw voxel value into presentable entities:
color, intensity, opacity, etc.
Raw-data  material (R, G, B, , Ka, Kd, Ks, .)
 Region of interest: high opacity (more opaque)
 no interest: translucent or transparent
 Often use look-up tables (LUT) to store the
transfer function
Levoy – Gradient/Normals
 Central difference
 per voxel
2
2
2
1
,
,
1
,
,
,
1
,
,
1
,
,
,
1
,
,
1












k
j
i
k
j
i
z
k
j
i
k
j
i
y
k
j
i
k
j
i
x
v
v
G
v
v
G
v
v
G
X+1
y-1,
Y+1
z-1
Levoy - Shading
 Phong Shading + Depth Cueing
 
 
    )
)
(
)
(
(
2
1
n
s
d
p
a
p H
x
N
k
L
x
N
k
x
d
k
k
C
k
C
x
C 





 Cp = color of parallel light source
 ka / kd / ks = ambient / diffuse / specular light coefficient
 k1, k2 = fall-off constants
 d(x) = distance to picture plane
 L = normalized vector to light
 H = normalized vector for maximum highlight
 N(xi) = surface normal at voxel xi
Compositing
 Front-to-back
 back-to-front
(1 )
(1 )
s s
s s
C C c

   
   
   
(1 )
(1 )
s s
s
C c C
 
   
   
   
Advantage: early ray termination
Advantage: object approach suitable for hardware implementation
It is the accumulation of colors weighted by opacities
Ray Traversal Schemes
Depth
Intensity
Max
Average
Accumulate
First
Ray Traversal - First
Depth
Intensity
First
Ray Traversal - Average
Depth
Intensity
Average
 Average: produces basically an X-ray picture
Ray Traversal - MIP
Depth
Intensity
Max
 Max: Maximum Intensity Projection
used for Magnetic Resonance Angiogram
Ray Traversal - Accumulate
Depth
Intensity
Accumulate
 Accumulate opacity while compositing colors: make
transparent layers visible!
Levoy ‘88
Volume Rendering Pipeline
Acquired values
Data preparation
Prepared values
classification
shading
Voxel colors
Ray-tracing / resampling Ray-tracing / resampling
Sample colors
compositing
Voxel opacities
Sample opacities
Image Pixels
VTK Ray Casting Example
 The given data represents a mummy
preserved for a long time. So the skin is
dried and not very crisp when compared
to the data set given in Project 3.
The dried skins iso value was found to
be around 70 to 90. The skull iso value
was around 100 to 120. In order to
visualize this data set a opacity transfer
function and a color transfer function are
constructed. The opacity for values
ranging from 0 - 50 is chosen to be 0.0
and 55 - 80 is chosen to be 0.1 (semi
translucent) and finally the bone values
ranging from 90 - 120 is given a complete
opaque value of 1.0. The colors are
chosen in such a way that the skin range
has a light blue and the bone has a
complete white and all other values have
a color value of 0.0.
 www.cs.utah.edu/.../sci_vis/prj4/REPO
RT.html
VTK Ray Casting Example
 create the maximum
intensity projection of the
image. This looks more
like an x-ray of the
mummy. I used the inbuilt
method in VTK called
vtkVolumeRayCastMIPFun
ction . The opacity transfer
function plays a major role
in this technique and the
color transfer function is
used to adjust the contrast
and get good looking
images.
 www.cs.utah.edu/.../sci_v
is/prj4/REPORT.html
Adaptive Termination
 The goal of adaptive termination is to quickly identify the
last sample along a ray that significantly changes the
color of the ray. We define a significant color change as
one in which C_out – C_in > Epsilon for some small
Epsilon > 0. Thus, Once opacity first exceeds 1-Epsilon,
the color will not change significantly. This is the
termination criteria.
 Higher values of Epsilon reduce rendering time, while
lower values of Epsilon reduce image artifacts producing
a higher quality image.
Four Steps Summary
 The volume ray casting algorithm comprises :
 Ray casting. For each pixel of the final image, a ray of sight is shot ("cast")
through the volume. At this stage it is useful to consider the volume being
touched and enclosed within a bounding primitive, a simple geometric
object — usually a cuboid — that is used to intersect the ray of sight and the
volume.
 Sampling. Along the part of the ray of sight that lies within the volume,
equidistant sampling points or samples are selected. As in general the
volume is not aligned with the ray of sight, sampling points usually will be
located in between voxels. Because of that, it is necessary to trilinearly
interpolate the values of the samples from its surrounding voxels.
 Shading. For each sampling point, the gradient is computed. These
represent the orientation of local surfaces within the volume. The samples
are then shaded, i. e. coloured and lighted, according to their surface
orientation and the source of light in the scene.
 Compositing. After all sampling points have been shaded, they are
composited along the ray of sight, resulting in the final colour value for the
pixel that is currently being processed. The composition is derived directly
from the rendering equation and is similar to blending acetate sheets on an
overhead projector.
http://en.wikipedia.org/wiki/Volume_ray_casting
Exercises
References
 This set of slides references slides used
by Prof. Torsten Moeller (Simon Fraser),
Prof. Han-Wei Shen (Ohio State), Prof.
Jian Huang (UTK).
 Prof. Karki at Louisiana State University
 Prof. Frank Pfenning at Carnegie Mellon
University

More Related Content

Similar to Direct Volume Rendering (DVR): Ray-casting

DIGITAL IMAGE FUNDAS.ppt
DIGITAL IMAGE FUNDAS.pptDIGITAL IMAGE FUNDAS.ppt
DIGITAL IMAGE FUNDAS.pptHari M
 
Computer vision - light
Computer vision - lightComputer vision - light
Computer vision - lightWael Badawy
 
Introduction to Colorimetry and basics.ppt.pptx
Introduction to Colorimetry and basics.ppt.pptxIntroduction to Colorimetry and basics.ppt.pptx
Introduction to Colorimetry and basics.ppt.pptxSheelaS18
 
Lecture 9&10 computer vision segmentation-no_task
Lecture 9&10 computer vision segmentation-no_taskLecture 9&10 computer vision segmentation-no_task
Lecture 9&10 computer vision segmentation-no_taskcairo university
 
CSE5559::Visualizing the Life and Anatomy of Cosmic Particles
CSE5559::Visualizing the Life and Anatomy of Cosmic ParticlesCSE5559::Visualizing the Life and Anatomy of Cosmic Particles
CSE5559::Visualizing the Life and Anatomy of Cosmic ParticlesSubhashis Hazarika
 
X-Ray Image Acquisition and Analysis
X-Ray Image Acquisition and AnalysisX-Ray Image Acquisition and Analysis
X-Ray Image Acquisition and AnalysisIJREST
 
Video Compression Part 1 Video Principles
Video Compression Part 1 Video Principles Video Compression Part 1 Video Principles
Video Compression Part 1 Video Principles Dr. Mohieddin Moradi
 
clem_waves_lesson03_presentation.ppt
clem_waves_lesson03_presentation.pptclem_waves_lesson03_presentation.ppt
clem_waves_lesson03_presentation.pptFrancis de Castro
 
clem_waves_lesson03_presentation.ppt
clem_waves_lesson03_presentation.pptclem_waves_lesson03_presentation.ppt
clem_waves_lesson03_presentation.pptGurumurthy B R
 
Graphics Lecture 7
Graphics Lecture 7Graphics Lecture 7
Graphics Lecture 7Saiful Islam
 
Texture By Priyanka Chauhan
Texture By Priyanka ChauhanTexture By Priyanka Chauhan
Texture By Priyanka ChauhanPriyanka Chauhan
 
Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfnagwaAboElenein
 
Digital image processing2.pptx
Digital image processing2.pptxDigital image processing2.pptx
Digital image processing2.pptxDivyanshAgarwal78
 
Adaptive Median Filters
Adaptive Median FiltersAdaptive Median Filters
Adaptive Median FiltersAmnaakhaan
 

Similar to Direct Volume Rendering (DVR): Ray-casting (20)

november6.ppt
november6.pptnovember6.ppt
november6.ppt
 
DIGITAL IMAGE FUNDAS.ppt
DIGITAL IMAGE FUNDAS.pptDIGITAL IMAGE FUNDAS.ppt
DIGITAL IMAGE FUNDAS.ppt
 
Computer vision - light
Computer vision - lightComputer vision - light
Computer vision - light
 
Introduction to Colorimetry and basics.ppt.pptx
Introduction to Colorimetry and basics.ppt.pptxIntroduction to Colorimetry and basics.ppt.pptx
Introduction to Colorimetry and basics.ppt.pptx
 
Lecture 9&10 computer vision segmentation-no_task
Lecture 9&10 computer vision segmentation-no_taskLecture 9&10 computer vision segmentation-no_task
Lecture 9&10 computer vision segmentation-no_task
 
CSE5559::Visualizing the Life and Anatomy of Cosmic Particles
CSE5559::Visualizing the Life and Anatomy of Cosmic ParticlesCSE5559::Visualizing the Life and Anatomy of Cosmic Particles
CSE5559::Visualizing the Life and Anatomy of Cosmic Particles
 
X-Ray Image Acquisition and Analysis
X-Ray Image Acquisition and AnalysisX-Ray Image Acquisition and Analysis
X-Ray Image Acquisition and Analysis
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Global illumination
Global illuminationGlobal illumination
Global illumination
 
Video Compression Part 1 Video Principles
Video Compression Part 1 Video Principles Video Compression Part 1 Video Principles
Video Compression Part 1 Video Principles
 
clem_waves_lesson03_presentation.ppt
clem_waves_lesson03_presentation.pptclem_waves_lesson03_presentation.ppt
clem_waves_lesson03_presentation.ppt
 
clem_waves_lesson03_presentation.ppt
clem_waves_lesson03_presentation.pptclem_waves_lesson03_presentation.ppt
clem_waves_lesson03_presentation.ppt
 
Graphics Lecture 7
Graphics Lecture 7Graphics Lecture 7
Graphics Lecture 7
 
Texture By Priyanka Chauhan
Texture By Priyanka ChauhanTexture By Priyanka Chauhan
Texture By Priyanka Chauhan
 
Dual photography
Dual photographyDual photography
Dual photography
 
DIP-Questions.pdf
DIP-Questions.pdfDIP-Questions.pdf
DIP-Questions.pdf
 
Ray tracing
Ray tracingRay tracing
Ray tracing
 
Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdf
 
Digital image processing2.pptx
Digital image processing2.pptxDigital image processing2.pptx
Digital image processing2.pptx
 
Adaptive Median Filters
Adaptive Median FiltersAdaptive Median Filters
Adaptive Median Filters
 

Recently uploaded

SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 

Recently uploaded (20)

SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 

Direct Volume Rendering (DVR): Ray-casting

  • 2. Light: bouncing photons  Lights send off photons in all directions  Model these as particles that bounce off objects in the scene  Each photon has a wavelength and energy (color and intensity)  When photon bounce, some energy is absorbed, some reflected, some transmitted  If we can model photon bounces we can generate image  Techniques: follow each photon from the light source until  All of its energy is absorbed (after too many bounces)  It departs the known universe  It strikes the image and its contribution is added to appropriate pixel
  • 3. Forward Ray Tracing  Rays are the path of these photons  This method of rendering by following photon path is called ray tracing  Forward ray tracing follows the photon in direction that light travels (from the source)  Big problem with this approach:  Only a tiny fraction of rays will reach the image  Extremely slow  Ideal Scenario:  We’d like to magically know which rays will eventually contribute to the image, and trace only those Direct: No conversion to surface geometry
  • 4. Backward Ray Tracing  The solution is to start from the image and trace backwards  Start from the image and follow the ray until the ray finds or fail to find a light source
  • 5. Backward Ray Tracing  Basic ideas:  Each pixel gets light from just one direction- the line through the image point and focal point  Any photon contribute to that pixel’s color has to come from this direction  So head in that direction and find what is sending light this way  If we hit a light source-we’re done  If we find nothing-we’re done  At the end we’ve done forward ray tracing, but only for rays that contribute to the image
  • 6. Basic Idea: Ray Casting Based on the idea of ray tracing •Only consider Primary Ray •Trace from eat each pixel as a ray into object space • Compute color value along the ray, composite • Assign the value to the pixel
  • 7. Data Representation •3D volume data are represented by a finite number of cross sectional slices (hence a 3D raster) •On each volume element (voxel), stores a data value (if it uses only a single bit, then it is a binary data set. Normally, we see a gray value of 8 to 16 bits on each voxel.) N x 2D arraies = 3D array
  • 8. Data Representation (2) What is a Voxel? – Two definitions A voxel is a cubic cell, which has a single value cover the entire cubic region A voxel is a data point at a corner of the cubic cell The value of a point inside the cell is determined by interpolation
  • 9. Ray Casting  Stepping through the volume: a ray is cast into the volume, sampling the volume at certain intervals  The sampling intervals are usually equi-distant, but don’t have to be  At each sampling location, a sample is interpolated / reconstructed from the grid voxels  popular filters are: nearest neighbor (box), trilinear (tent), Gaussian, cubic spline  Classification: map from density to color, opacity  Composite colors and opacities along the ray path
  • 10. Basic Idea of Ray-casting Pipeline c1 c2 c3
  • 13. Raycasting color c = c s s(1 - ) + c opacity  =  s (1 - ) +  1.0 object (color, opacity) volumetric compositing Interpolation kernel
  • 19. Trilinear - Interpolation eye image pixel viewing ray voxel sample point trilinear interpolation
  • 20. Classification/Transfer Function  Maps raw voxel value into presentable entities: color, intensity, opacity, etc. Raw-data  material (R, G, B, , Ka, Kd, Ks, .)  Region of interest: high opacity (more opaque)  no interest: translucent or transparent  Often use look-up tables (LUT) to store the transfer function
  • 21. Levoy – Gradient/Normals  Central difference  per voxel 2 2 2 1 , , 1 , , , 1 , , 1 , , , 1 , , 1             k j i k j i z k j i k j i y k j i k j i x v v G v v G v v G X+1 y-1, Y+1 z-1
  • 22. Levoy - Shading  Phong Shading + Depth Cueing         ) ) ( ) ( ( 2 1 n s d p a p H x N k L x N k x d k k C k C x C        Cp = color of parallel light source  ka / kd / ks = ambient / diffuse / specular light coefficient  k1, k2 = fall-off constants  d(x) = distance to picture plane  L = normalized vector to light  H = normalized vector for maximum highlight  N(xi) = surface normal at voxel xi
  • 23. Compositing  Front-to-back  back-to-front (1 ) (1 ) s s s s C C c              (1 ) (1 ) s s s C c C               Advantage: early ray termination Advantage: object approach suitable for hardware implementation It is the accumulation of colors weighted by opacities
  • 25. Ray Traversal - First Depth Intensity First
  • 26. Ray Traversal - Average Depth Intensity Average  Average: produces basically an X-ray picture
  • 27. Ray Traversal - MIP Depth Intensity Max  Max: Maximum Intensity Projection used for Magnetic Resonance Angiogram
  • 28. Ray Traversal - Accumulate Depth Intensity Accumulate  Accumulate opacity while compositing colors: make transparent layers visible! Levoy ‘88
  • 29. Volume Rendering Pipeline Acquired values Data preparation Prepared values classification shading Voxel colors Ray-tracing / resampling Ray-tracing / resampling Sample colors compositing Voxel opacities Sample opacities Image Pixels
  • 30. VTK Ray Casting Example  The given data represents a mummy preserved for a long time. So the skin is dried and not very crisp when compared to the data set given in Project 3. The dried skins iso value was found to be around 70 to 90. The skull iso value was around 100 to 120. In order to visualize this data set a opacity transfer function and a color transfer function are constructed. The opacity for values ranging from 0 - 50 is chosen to be 0.0 and 55 - 80 is chosen to be 0.1 (semi translucent) and finally the bone values ranging from 90 - 120 is given a complete opaque value of 1.0. The colors are chosen in such a way that the skin range has a light blue and the bone has a complete white and all other values have a color value of 0.0.  www.cs.utah.edu/.../sci_vis/prj4/REPO RT.html
  • 31. VTK Ray Casting Example  create the maximum intensity projection of the image. This looks more like an x-ray of the mummy. I used the inbuilt method in VTK called vtkVolumeRayCastMIPFun ction . The opacity transfer function plays a major role in this technique and the color transfer function is used to adjust the contrast and get good looking images.  www.cs.utah.edu/.../sci_v is/prj4/REPORT.html
  • 32. Adaptive Termination  The goal of adaptive termination is to quickly identify the last sample along a ray that significantly changes the color of the ray. We define a significant color change as one in which C_out – C_in > Epsilon for some small Epsilon > 0. Thus, Once opacity first exceeds 1-Epsilon, the color will not change significantly. This is the termination criteria.  Higher values of Epsilon reduce rendering time, while lower values of Epsilon reduce image artifacts producing a higher quality image.
  • 33. Four Steps Summary  The volume ray casting algorithm comprises :  Ray casting. For each pixel of the final image, a ray of sight is shot ("cast") through the volume. At this stage it is useful to consider the volume being touched and enclosed within a bounding primitive, a simple geometric object — usually a cuboid — that is used to intersect the ray of sight and the volume.  Sampling. Along the part of the ray of sight that lies within the volume, equidistant sampling points or samples are selected. As in general the volume is not aligned with the ray of sight, sampling points usually will be located in between voxels. Because of that, it is necessary to trilinearly interpolate the values of the samples from its surrounding voxels.  Shading. For each sampling point, the gradient is computed. These represent the orientation of local surfaces within the volume. The samples are then shaded, i. e. coloured and lighted, according to their surface orientation and the source of light in the scene.  Compositing. After all sampling points have been shaded, they are composited along the ray of sight, resulting in the final colour value for the pixel that is currently being processed. The composition is derived directly from the rendering equation and is similar to blending acetate sheets on an overhead projector. http://en.wikipedia.org/wiki/Volume_ray_casting
  • 35. References  This set of slides references slides used by Prof. Torsten Moeller (Simon Fraser), Prof. Han-Wei Shen (Ohio State), Prof. Jian Huang (UTK).  Prof. Karki at Louisiana State University  Prof. Frank Pfenning at Carnegie Mellon University