[vtkusers] slow update with vtkTkImageViewerWidget

Frank-André Siebert siebert at onco.uni-kiel.de
Fri Nov 25 02:09:47 EST 2005


Hi all,

 

I have problems with the performance of my vtk software. For my software I use win2k with vtk 4.2.1 and tcl/tk 8.3 on a new +3GHz PC.

 

The program imports 8 bit tiff-images (each about 1MB) and I draw some lines and points onto it. The images are embedded into a tcl/tk GUI as canvas via vtkTkImageViewerWidget. The functionality of the software is ok - but the update of the windows is incredible slow after dragging another window over it or switching between applications. Sometimes I have to wait almost 1 minute until the whole window is refreshed with every image and tk widget.

Besides, I eliminated almost every update and update idletask from the code.

 

Because the whole project is too long to post I add only a part of the software:

 

Maybe somebody has experience in this topic and is willing to give me a hint.

 

 

Thanks,

 

Frank-André

 

 

 

 

 

 

 

package require vtkinteraction

package require vtk

 

 

#!/bin/sh

# the next line restarts using wish \

exec wish "$0" ${1+"$@"}

 

# feste Fenstergrösse

wm minsize . 800 600

wm maxsize . 800 600

wm geometry . +0+0

 

canvas .c1 -width 100 -height 100 -bg yellow -borderwidth 0 -takefocus 0

place .c1 -x 550 -y 300 -in .

 

.c1 create rectangle 10 10 50 50 -fill red

 

button .b -width 12 -text "load image" -command loadImage

place .b -x 550 -y 100 -in .

 

 

 

proc loadImage { } {

 

    set types {

                {{TIFF Files} {.tif}}

            }

 

    set file [tk_getOpenFile -filetypes $types]

            # Ein Bild wurde eingelesen

            if {$file == ""} { return }

 

 

    vtkTIFFReader TiffReader

            TiffReader SetFileName $file

            TiffReader Update ;# Bild in RAM lesen

            

            vtkImageCast cast

            cast SetInput [TiffReader GetOutput]

            cast SetOutputScalarTypeToFloat

 

    vtkImageReslice reslice

            reslice SetInput [cast GetOutput]

            #reslice InterpolateOn

            reslice SetOutputSpacing 1.0 1.0 0.0

            reslice SetOutputExtent 0 500 0 500 0 0

 

            vtkImageViewer viewer

            viewer SetInput [reslice GetOutput]

            viewer SetColorWindow 256

            viewer SetColorLevel 127.5

            [viewer GetRenderWindow] DoubleBufferOn

 

    # Ein Widget wird für den viewer erstellt

    set vtkiw [vtkTkImageViewerWidget .c2 -width 500 -height 500 -iv viewer]

 

    ::vtk::bind_tk_imageviewer_widget $vtkiw

 

    place .c2 -x 0 -y 0 -in .

 

}

 

 

 

 

 

 

 

 

 

-------------------------------------------------- 
Frank-André Siebert (PhD) 
Universitätsklinikum Schleswig-Holstein 
Campus Kiel 
Klinik für Strahlentherapie (Radioonkologie) 
Direktor Prof. Dr. Dr. Kimmig 
Arnold-Heller-Str. 9 
24105 Kiel, Germany 
-------------------------------------------------- 
Email: siebert at onco.uni-kiel.de 
Tel: 0431/597-3022 
Fax: 0431/597-3110 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20051125/0532e2a0/attachment.htm>


More information about the vtkusers mailing list