Looping and streaming

Ron Inbar rinbar at netvision.net.il
Tue Nov 16 15:46:59 EST 1999


Hi all!

I'm trying to take a large volume and plant some spheres into it.  The way I
figured I should do it is as follows:

vtkImageReader read
...
vtkImageEllipsoidSource sphere
...
vtkImageMathematics max
max SetOperationToMax
maxSetInput1 [read GetOutput]
maxSetInput2 [sphere GetOutput]
...
vtkImageTranslateExtent copy
copy SetTranslation 0 0 0
# or any other imaging filter that can copy its input unchanged to its
output; it serves as a buffer between max's output and its input
copy SetInput [max GetOutput]
...
set sphereParamList {...}
foreach sphereParams $sphereParamList {
    sphere SetCenter ... ; # using $sphereParams
    sphere SetRadius ... ; # using $sphereParams
    copy Update

    # Use the output of this iteration as the input of the next iteration
   max SetInput1 [copy GetOutput]
}

vtkImageWriter write
write SetInput [copy GetOutput]
write Write

So far I don't think there's any problem with the script.  However, it
doesn't stream yet because I haven't set any memory limits.  If I set a
memory limit using the following command:

copy SetInputMemoryLimit 10000

what happens is as follows: copy breaks up the extent into pieces to obey
the memory limit.  max gets a small update extent, but because of the loop
it gives the same update extent back to copy.  copy is not aware of the
loop, and loses its original update extent.  Eventually only the first piece
gets updated.

I suppose I'm not the first to come across this catch.  Is there a
workaround?

TIA,

Ron




-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------




More information about the vtkusers mailing list