<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Courier New" size=2>Hi vtk users,</FONT></DIV>
<DIV><FONT face="Courier New" size=2>I have a series of slices (PNG files)
obtained from an ultrasound registration and I'm trying to reconstruct a 3D
volume rendering. The result is a 3D volume with an huge banding effect that I'm
not able to eliminate. Could someone help me? The TCL code I'm using is the
following:</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>package require vtk<BR>package require
vtkinteraction</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" 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><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>vtkPNGReader reader<BR> reader
SetDataExtent 0 0 0 0 0 72<BR> reader SetDataSpacing 0.3 0.3
0.18<BR> reader SetFilePrefix "C:/bscansdi/slice"</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" 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><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" 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><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><BR><FONT face="Courier New" size=2>vtkImageThreshold
selectTissue<BR> selectTissue ThresholdBetween 30.0
255.0<BR> selectTissue
ReplaceInOff<BR> selectTissue SetOutValue
0.0<BR> selectTissue SetInput [gaussian
GetOutput]</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2># Create transfer mapping scalar value to
opacity<BR>vtkPiecewiseFunction opacityTransferFunction<BR>
opacityTransferFunction AddPoint 0 0.0<BR>
opacityTransferFunction AddPoint 10
0.259<BR> opacityTransferFunction AddPoint 255
1.0</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" 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 10.0 0.259 0.259 0.3<BR>
colorTransferFunction AddRGBPoint 255.0 1.0 1.0
0.3</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2># The property describes how the data will
look<BR>vtkVolumeProperty volumeProperty<BR> volumeProperty
SetColor colorTransferFunction<BR> volumeProperty
SetScalarOpacity opacityTransferFunction<BR> volumeProperty
SetInterpolationTypeToLinear<BR> volumeProperty
ShadeOff</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" 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 [selectTissue GetOutput]</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" 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><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>ren1 AddVolume volume<BR>ren1 SetBackground
0.1 0.2 0.4<BR>renWin Render</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>iren Initialize</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>wm withdraw .</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>Thank for your help</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Sandro Rosi</FONT></DIV></BODY></HTML>