<!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> </DIV>
<DIV><FONT face=Arial size=2>The following is the source code I
used.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>package require vtk<BR>package require
vtkinteraction</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2># Create the standard renderer, render window<BR>#
and interactor<BR>vtkRenderer ren1<BR>vtkRenderWindow
renWin<BR> renWin AddRenderer
ren1<BR>vtkRenderWindowInteractor iren<BR> iren
SetRenderWindow renWin</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>vtkBMPReader reader<BR> reader
SetDataExtent 0 253 0 161 1 184<BR> reader SetFilePrefix
"D:/VTK40/VTKDATA/Data/babybmp/s1"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>vtkImageIslandRemoval2D
islandRemover<BR> islandRemover SetAreaThreshold
4<BR> islandRemover SetIslandValue
-1<BR> islandRemover SetReplaceValue
1.0<BR> islandRemover SetInput [reader
GetOutput];</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>vtkImageGaussianSmooth
gaussian<BR> gaussian SetStandardDeviations 1.0 1.0
1.0<BR> gaussian SetRadiusFactors 1.0 1.0
1.0<BR> gaussian SetInput [islandRemover GetOutput]
</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><BR>vtkImageThreshold
selectTissue<BR> selectTissue ThresholdBetween 66.0
255.0<BR> selectTissue
ReplaceInOff<BR> selectTissue SetOutValue
0.0<BR> selectTissue SetInput [gaussian
GetOutput]</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2># Create transfer mapping scalar value to
opacity<BR>vtkPiecewiseFunction opacityTransferFunction<BR>
opacityTransferFunction AddPoint 66
0.259<BR> opacityTransferFunction AddPoint 255
1.0</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2># Create transfer mapping scalar value to
color<BR>vtkColorTransferFunction colorTransferFunction<BR>
colorTransferFunction AddRGBPoint 0.0 0.0 0.0
0.0<BR> colorTransferFunction
AddRGBPoint 66.0 0.259 0.259 0.3<BR>
colorTransferFunction AddRGBPoint 255.0 1.0 1.0
0.3</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2># The property describes how the data will
look<BR>vtkVolumeProperty volumeProperty<BR> volumeProperty
SetColor colorTransferFunction<BR> volumeProperty
SetScalarOpacity opacityTransferFunction</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2># The mapper / ray cast function know how to render
the data<BR>vtkVolumeRayCastCompositeFunction
compositeFunction<BR>vtkVolumeRayCastMapper volumeMapper<BR>
volumeMapper SetVolumeRayCastFunction compositeFunction<BR>
volumeMapper SetInput [reader GetOutput]</FONT></DIV>
<DIV> </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> volume SetMapper volumeMapper<BR>
volume SetProperty volumeProperty</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>ren1 AddVolume volume<BR>renWin Render</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>proc TkCheckAbort {} {<BR> set foo [renWin
GetEventPending]<BR> if {$foo != 0} {renWin SetAbortRender
1}<BR>}<BR>renWin SetAbortCheckMethod {TkCheckAbort}</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>iren SetUserMethod {wm deiconify
.vtkInteract}<BR>iren Initialize</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>wm withdraw .</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Thanks a lot</FONT></DIV></BODY></HTML>