how to add a set of images?

Charles Law charles.law at kitware.com
Fri Apr 21 13:46:46 EDT 2000


There are multiple ways you can do this.  In the nightly 
release,  vtkDataObjects have ShallowCopy and DeepCopy.

The following should work.
See the changes below.

Charles.

At 12:56 PM 4/21/00 -0400, Alexandre Guimond wrote:
>Hi.  I wan't to add a set of images together and I can't figure out
>the way to do this.  Hopefully one of you can help :)
>
>In the following code, all the images file prefix are in $series.
>
>==
>vtkImageMathematics add
>add SetOperationToAdd
>
>vtkImageReader reader
>reader SetFilePrefix [lindex $series 0]

vtkImageData last
reader Update
last ShallowCopy [reader GetOutput]

>foreach i [lrange $series 1 end] {

       add SetInput1 last

>     reader SetFilePrefix $i;
>     add SetInput2 [reader GetOutput]

        add Update
        last ShallowCopy [add GetOutput]


>}
>
>vtkImageViewer viewer

    viewer SetInput last

>viewer Render
>==
>
>I guess the problem has to do with the implicit execution stuff.
>That's why I put a couple of Update calls in there.  It doesn't help
>in any way though.
>
>thx for any info.
>
>ps: Is there an archive to this mailing list?
>--
>ag
>--------------------------------------------------------------------
>This is the private VTK discussion list. Please keep messages on-topic.
>Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
><majordomo at public.kitware.com>. For help, send message body containing
>"info vtkusers" to the same address.
>--------------------------------------------------------------------

--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list