[vtkusers] Volume rendering of vtkRectilinearGrid using vtkImageData grid and vtkProbeFilter (ERROR: "vtkStreamingDemandDrivenPipeline,... update extent.... outside whole extent")
SKoch at trinityconsultants.com
SKoch at trinityconsultants.com
Mon Sep 25 15:39:10 EDT 2006
Help
I've spent enough hours trying to stop VtkOutputWindow from popping up
with this error:
ERROR: In ..\..\vtk\Filtering\vtkStreamingDemandDrivenPipeline.cxx, line
628
vtkStreamingDemandDrivenPipeline (061A8E28): The update extent specified
in the information for output port 0 on algorithm
vtkTrivialProducer(061AE298) is 0 31 0 31 0 31, which is outside the whole
extent 0 32 0 27 0 9.
Our volume rendering is working fine! But this error message won't go
away. Our data is loaded into a vtkRectilinearGrid (any resolution -
32x27x9 is just one of many possibilities). To do volume rendering we
create a 32x32x32 vtkImageData grid and resample the vtkRectilinearGrid
data using vtkProbeFilter (see code below). Like I said, everything works
great. The volume rendering appears and behaves very well. The only
problem is that this error message pops up with the VtkOutputWindow. I
looks like the vtkImageData object (32x32x32) has inherited the "whole
extent" of the original vtkRectilinearGrid (33x28x10)? This doesn't make
sense.... somebody please help....
Note: Code is in Visual Basic (We are using Andrew Dolgert's ".NET
Wrappers for VTK 5" - works great!)
Private Sub LoadVolumeActor()
'Create a rectilinear grid (any resolution and spacing in X, Y,
and Z)
Dim vtkGrid3D as vtk.vtkRectilinearGrid = Me.LoadRectilinearGrid()
'Create the image data grid
Dim ImageGrid As New vtk.vtkImageData
Dim nx As Integer = 32
ImageGrid.SetDimensions(nx, nx, nx)
ImageGrid.SetOrigin(m_sngGridMinX, m_sngGridMinY, m_sngGridMinZ)
ImageGrid.SetSpacing((m_sngGridMaxX - m_sngGridMinX) / (nx - 1), _
(m_sngGridMaxY - m_sngGridMinY) / (nx - 1), _
(m_sngGridMaxZ - m_sngGridMinZ) / (nx - 1))
'Use probe filter to get scalar values for image data grid
Dim Probe As New vtk.vtkProbeFilter
Probe.SetInput(ImageGrid)
Probe.SetSource(m_vtkGrid3D)
'Convert the image data grid scalars from float to unsigned
character
Dim ScalarMin, ScalarMax As Double
Me.GetScalarMinMax(vtkGrid3D, ScalarMin, ScalarMax)
Dim Shift As Double = -ScalarMin
Dim Scale As Double = 255.0 / (ScalarMax - ScalarMin)
Dim ShiftScale As New vtk.vtkImageShiftScale
ShiftScale.SetShift(Shift)
ShiftScale.SetScale(Scale)
ShiftScale.SetOutputScalarTypeToUnsignedChar()
ShiftScale.SetInput(Probe.GetImageDataOutput)
'Volume function
Dim VolumeFunction As New vtk.vtkVolumeRayCastMIPFunction
VolumeFunction.SetMaximizeMethodToScalarValue() 'Default method
'VolumeFunction.SetMaximizeMethodToOpacity() 'Alternate method
'Volume mapper
Dim VolumeMapper As New vtk.vtkVolumeRayCastMapper
VolumeMapper.SetVolumeRayCastFunction(VolumeFunction)
VolumeMapper.SetSampleDistance((m_sngGridMaxX - m_sngGridMinX) /
((nx - 1) * 3))
VolumeMapper.SetInput(ShiftScale.GetOutput)
'Opacity transfer function
Dim OpacityTransferFunction As New vtk.vtkPiecewiseFunction
OpacityTransferFunction.AddPoint(0.0, 0.7)
OpacityTransferFunction.AddPoint(255.0, 0.7)
'Volume property
Dim VolumeProperty As New vtk.vtkVolumeProperty
'VolumeProperty.SetInterpolationTypeToNearest() 'Default -
faster, course image
VolumeProperty.SetInterpolationTypeToLinear() 'Smoother -
slower, smooth image
VolumeProperty.SetScalarOpacity(OpacityTransferFunction)
VolumeProperty.SetColor(Me.CreateLookupTable(ActorIndex,
SetLutOptions.NewLUT, Shift, Scale))
'Volume actor
Dim Volume As New vtk.vtkVolume
Volume.SetMapper(VolumeMapper)
Volume.SetProperty(VolumeProperty)
m_vtkRen1.AddVolume(Volume)
m_vtkRenWin.Render()
End Sub
Steve Koch
Applications Developer
Trinity Consultants, Inc.
skoch at trinityconsultants.com
phone: 972-661-8881 x1332
fax: +214-615-7425
breeze-software.com
_________________________________________________________________________
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you
Received this in error, please contact the sender and delete the material
from any computer.
_________________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060925/fc05b68f/attachment.htm>
More information about the vtkusers
mailing list