Microscopy Image Browser  1.233
All Classes Files Functions Variables Pages
render.m File Reference

Function RENDER will volume render a image of a 3D volume, with transperancy, shading and ColorTable. More...

Functions

function
render_image = 
render (volume, options)
 Function RENDER will volume render a image of a 3D volume, with transperancy, shading and ColorTable. More...
 
function Iout = render>render_slice (data)
 
function data = render>shear (data)
 
function data = render>returnnormal (x, y, z, data)
 
function data = render>updatebuffer_MIP (data)
 
function data = render>updatebuffer_COLOR (data)
 
function data = render>updatebuffer_SHADED (data)
 
function data = render>warp (data)
 
function [ Mshear ,

Mwarp2D , c ] = 
render>makeShearWarpMatrix (Mview, sizes)
 

Detailed Description

Function RENDER will volume render a image of a 3D volume, with transperancy, shading and ColorTable.

Function Documentation

function [Mshear , Mwarp2D , c ] = render>makeShearWarpMatrix (   Mview,
  sizes 
)
function Iout = render>render_slice (   data)

References affine_transform_2d_double().

Here is the call graph for this function:

function data = render>returnnormal (   x,
  y,
  z,
  data 
)
function data = render>shear (   data)
function data = render>updatebuffer_COLOR (   data)
function data = render>updatebuffer_MIP (   data)
function data = render>updatebuffer_SHADED (   data)
function data = render>warp (   data)

References affine_transform_2d_double().

Here is the call graph for this function:

function render_image = render (   volume,
  options 
)

Function RENDER will volume render a image of a 3D volume, with transperancy, shading and ColorTable.

I = RENDER(VOLUME,OPTIONS);

outputs, I: The rendered image

inputs, VOLUME : Input image volume (Data of type double has short render times uint16 the longest)

OPTIONS: A struct with all the render options and parameters
OPTIONS.RenderType : Maximum intensitity projections (default) mip, greyscale volume rendering bw, color volume rendering color and volume rendering with shading shaded OPTIONS.ShearInterp : Interpolation method used in the Shear steps of the shearwarp algoritm, nearest or (default) bilinear OPTIONS.WarpInterp : Interpolation method used in the warp step of the shearwarp algoritm, nearest or (default) bilinear OPTIONS.ImageSize : Size of the rendered image, defaults to [400 400] OPTIONS.Mview : This 4x4 matrix is the viewing matrix defaults to [1 0 0 0;0 1 0 0;0 0 1 0;0 0 0 1] OPTIONS.AlphaTable : This Nx1 table is linear interpolated such that every voxel intensity gets a specific alpha (transparency) [0 0.01 0.05 0.1 0.2 1 1 1 1 1] OPTIONS.ColorTable : This Nx3 table is linear interpolated such that every voxel intensity gets a specific color. defaults to [1 0 0;1 0 0;1 0 0;1 0 0;1 0 0;1 0 0;1 0 0] OPTIONS.LightVector : Light Direction defaults to [0.67 0.33 -0.67] OPTIONS.ViewerVector : View vector X,Y,Z defaults to [0 0 1] OPTIONS.ShadingMaterial : The type of material shading : dull, shiny(default) or metal.
Optional parameters to speed up rendering
OPTIONS.VolumeX, OPTIONS.VolumeY : Dimensions shifted Voxel volumes,
Must be used like
OPTIONS.VolumeX=shiftdim(OPTIONS.Volume,1); OPTIONS.VolumeY=shiftdim(OPTIONS.Volume,2); OPTIONS.Normals : The normalized gradient of the voxel volume
Must be used like
[fy,fx,fz]=gradient(OPTIONS.Volume); flength=sqrt(fx.^2+fy.^2+fz.^2)+1e-6; OPTIONS.Normals=zeros([size(fx) 3]); OPTIONS.Normals(:,:,:,1)=fx./flength; OPTIONS.Normals(:,:,:,2)=fy./flength; OPTIONS.Normals(:,:,:,3)=fz./flength;

example, dd paths functionname=render.m; functiondir=which(functionname); functiondir=functiondir(1:end-length(functionname)); addpath(functiondir); addpath([functiondir /SubFunctions]); Load data load(ExampleData/TestVolume.mat); V=data.volumes(1).volume_original; Type of rendering options.RenderType = color; color and alpha table options.AlphaTable=[0 0 0 0 0 1 1 1 1 1]; options.ColorTable=[1 0 0;1 0 0;1 0 0;1 0 0;1 0 0;1 0 0;1 0 0]; ptions.ColorTable=[1 0 0;1 0 0;]; Viewer Matrix options.Mview=makeViewMatrix([0 0 0],[0.25 0.25 0.25],[0 0 0]); Render and show image figure, I = render(V,options); imshow(I);

Function is written by D.Kroon University of Twente (April 2009)

Referenced by getRGBvolume().

Here is the caller graph for this function: