<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content="MSHTML 5.00.3315.2870" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear All</FONT></DIV>
<DIV><FONT face=Arial size=2>I am fresher in VTK. Now I try to reconstruct a 
series of 2D ultrasound image to 3D using VoulmeRendering. My dataset is BMP 
grey image(0-255, one byte per pixel). I use threshold to get rid of some noise 
and use gaussian smooth to smooth the original image and then to render it. But 
I can not get the right result. I used another comerical software can succeed in 
voulmerendering those dataset. I do not know why? Could anybody help me to 
figure it out?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The following is the source code I 
used.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>package require vtk<BR>package require 
vtkinteraction</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># Create the standard renderer, render window<BR># 
and interactor<BR>vtkRenderer ren1<BR>vtkRenderWindow 
renWin<BR>&nbsp;&nbsp;&nbsp; renWin AddRenderer 
ren1<BR>vtkRenderWindowInteractor iren<BR>&nbsp;&nbsp;&nbsp; iren 
SetRenderWindow renWin</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>vtkBMPReader reader<BR>&nbsp;&nbsp; reader 
SetDataExtent 0 253 0 161 1 184<BR>&nbsp;&nbsp; reader SetFilePrefix 
"D:/VTK40/VTKDATA/Data/babybmp/s1"</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>vtkImageIslandRemoval2D 
islandRemover<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; islandRemover SetAreaThreshold 
4<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; islandRemover SetIslandValue 
-1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; islandRemover SetReplaceValue 
1.0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; islandRemover SetInput [reader 
GetOutput];</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>vtkImageGaussianSmooth&nbsp; 
gaussian<BR>&nbsp;&nbsp;&nbsp;&nbsp; gaussian SetStandardDeviations 1.0 1.0 
1.0<BR>&nbsp;&nbsp;&nbsp;&nbsp; gaussian SetRadiusFactors 1.0 1.0 
1.0<BR>&nbsp;&nbsp;&nbsp;&nbsp; gaussian SetInput [islandRemover GetOutput] 
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><BR>vtkImageThreshold 
selectTissue<BR>&nbsp;&nbsp;&nbsp;&nbsp; selectTissue ThresholdBetween 66.0 
255.0<BR>&nbsp;&nbsp;&nbsp;&nbsp; selectTissue 
ReplaceInOff<BR>&nbsp;&nbsp;&nbsp;&nbsp; selectTissue SetOutValue 
0.0<BR>&nbsp;&nbsp;&nbsp;&nbsp; selectTissue SetInput [gaussian 
GetOutput]</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># Create transfer mapping scalar value to 
opacity<BR>vtkPiecewiseFunction opacityTransferFunction<BR>&nbsp;&nbsp;&nbsp; 
opacityTransferFunction AddPoint&nbsp; 66&nbsp;&nbsp; 
0.259<BR>&nbsp;&nbsp;&nbsp; opacityTransferFunction AddPoint&nbsp; 255&nbsp; 
1.0</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># Create transfer mapping scalar value to 
color<BR>vtkColorTransferFunction colorTransferFunction<BR>&nbsp;&nbsp;&nbsp; 
colorTransferFunction AddRGBPoint&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0.0 0.0 0.0 
0.0<BR>&nbsp;&nbsp;&nbsp; colorTransferFunction 
AddRGBPoint&nbsp;&nbsp;&nbsp;&nbsp; 66.0 0.259 0.259 0.3<BR>&nbsp;&nbsp;&nbsp; 
colorTransferFunction AddRGBPoint&nbsp;&nbsp;&nbsp; 255.0 1.0 1.0 
0.3</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># The property describes how the data will 
look<BR>vtkVolumeProperty volumeProperty<BR>&nbsp;&nbsp;&nbsp; volumeProperty 
SetColor colorTransferFunction<BR>&nbsp;&nbsp;&nbsp; volumeProperty 
SetScalarOpacity opacityTransferFunction</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># The mapper / ray cast function know how to render 
the data<BR>vtkVolumeRayCastCompositeFunction&nbsp; 
compositeFunction<BR>vtkVolumeRayCastMapper volumeMapper<BR>&nbsp;&nbsp;&nbsp; 
volumeMapper SetVolumeRayCastFunction compositeFunction<BR>&nbsp;&nbsp;&nbsp; 
volumeMapper SetInput [reader GetOutput]</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># The volume holds the mapper and the property 
and<BR># can be used to position/orient the volume<BR>vtkVolume 
volume<BR>&nbsp;&nbsp;&nbsp; volume SetMapper volumeMapper<BR>&nbsp;&nbsp;&nbsp; 
volume SetProperty volumeProperty</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>ren1 AddVolume volume<BR>renWin Render</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>proc TkCheckAbort {} {<BR>&nbsp; set foo [renWin 
GetEventPending]<BR>&nbsp; if {$foo != 0} {renWin SetAbortRender 
1}<BR>}<BR>renWin SetAbortCheckMethod {TkCheckAbort}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>iren SetUserMethod {wm deiconify 
.vtkInteract}<BR>iren Initialize</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>wm withdraw .</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks a lot</FONT></DIV></BODY></HTML>