Download presentation
Presentation is loading. Please wait.
Published by麓 裘 Modified over 5 years ago
1
NA-MIC, 2008 June Workshop, IHK Akademie Westerham KWWidgets
Sebastien BARRE - Kitware, Inc.
2
What is KWWidgets? A GUI toolkit Cross-platform Open-license Free
NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 2
3
What is KWWidgets? (cont.)
A GUI toolkit that provides low-level and high-level visualization-oriented widgets compatible with the VTK framework. vs. NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 3
4
What is KWWidgets? (cont.)
Over 150 C++ classes, Around 190,000 lines of code, 49 person years, roughly $5M at 100k per person (source: ohloh.org) Used extensively by Kitware to develop open-source and commercial end-user applications for more than 9 years Used extensively in Slicer3 NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 4
5
What is KWWidgets? (cont.)
Cardiac segmentation and CT Volume Rendering in Slicer3, using data and segmentations from the collaboration with Boston Children's Hospital Pediatric Cardiology. Cardiac segmentation and CT Volume Rendering in Slicer3, using data and segmentations from the collaboration with Boston Children's Hospital Pediatric Cardiology. NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 5
6
What is KWWidgets? (cont.)
VolView 3.0 (Work in Progress) NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 6
7
Features Object-oriented C++ layer on top of Tcl/Tk
Inherit from the VTK coding framework checkbutton .cb1 .cb1 config -text "A checkbutton" .cb1 deselect pack .cb1 vtkKWCheckButton *cb1 = vtkKWCheckButton::New(); cb1->SetParent(parent); cb1->Create(); cb1->SetText("A checkbutton"); cb1->DeSelect(); app->Script("pack %s", cb1->GetWidgetName()); NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 7
8
Features (cont.) Can interact and co-exist with Tcl/Tk directly from Tcl/Tk or Slicer3 Wrapped into a Tcl package just like VTK Fast-prototyping NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 8
9
Features (cont.) C++ vs. Tcl
vtkKWCheckButton *cb1 = vtkKWCheckButton::New(); cb1->SetParent(parent); cb1->Create(); cb1->SetText("A checkbutton"); cb1->DeSelect(); app->Script("pack %s", cb1->GetWidgetName()); package require kwwidgets vtkKWCheckButton cb1 cb1 SetParent $parent cb1 Create cb1 SetText "A checkbutton" cb1 DeSelect pack [cb1 GetWidgetName] … button .b -text "My Button" pack .b NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 9
10
Widgets overview Core widgets Composite widgets VTK widgets
Helper classes NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 10
11
Widgets overview (cont.)
Core widgets vtkKWCanvas vtkKWCheckButton vtkKWEntry vtkKWFrame vtkKWLabel vtkKWListBox vtkKWMenu vtkKWOptionMenu vtkKWPushButton vtkKWRadioButton vtkKWScale vtkKWScrollbar vtkKWText vtkKWThumbWheel vtkKWTopLevel vtkKWTree … NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 11
12
Widgets overview (cont.)
Composite widgets vtkKWChangeColorButton vtkKWDialog vtkKWExtent vtkKWListBoxToListBoxSelectionEditor vtkKWHSVColorSelector vtkKWNotebook vtkKWProgressGauge vtkKWRange vtkKWSelectionFrame vtkKWSelectionFrameLayoutManager vtkKWSplashScreen vtkKWSplitFrame vtkKWTclInteractor vtkKWToolbar vtkKWToolbarSet vtkKWUserInterfaceManager vtkKWUserInterfacePanel vtkKWWidgetSet vtkKWWidgetWithScrollbars vtkKWWindow … NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 12
13
Widgets overview (cont.)
… more composite widgets: divide and conquer NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 13
14
Widgets overview (cont.)
VTK widgets vtkKWColorPresetSelector vtkKWColorTransferFunctionEditor vtkKWCornerAnnotationEditor vtkKWHeaderAnnotationEditor vtkKWPiecewiseFunctionEditor vtkKWRenderWidget vtkKWScalarBarAnnotation vtkKWScalarComponentSelectionWidget vtkKWTextPropertyEditor vtkKWVolumeMaterialPropertyWidget vtkKWVolumePropertyWidget … NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 14
15
Examples A simple image viewer using KWWidgets and VTK
NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 15
16
Examples (cont.) NA-MIC, 2008 June Workshop, IHK Akademie Westerham
package require kwwidgets vtkKWApplication app vtkKWWindowBase win app AddWindow win win Create vtkKWRenderWidget rw rw SetParent [win GetViewFrame] rw Create rw CornerAnnotationVisibilityOn pack [rw GetWidgetName] -side top -expand y -fill both \ -padx 0 -pady 0 vtkXMLImageDataReader reader reader SetFileName "head100x100x47.vti" vtkImageViewer2 viewer viewer SetRenderWindow [rw GetRenderWindow] viewer SetRenderer [rw GetRenderer] viewer SetInput [reader GetOutput] vtkRenderWindowInteractor iren viewer SetupInteractor iren rw ResetCamera set ca [rw GetCornerAnnotation] $ca SetImageActor [viewer GetImageActor] $ca SetWindowLevel [viewer GetWindowLevel] $ca SetText 2 "<slice>" $ca SetText 3 "<window>\n<level>" vtkKWScale slice_scale slice_scale SetParent [win GetViewFrame] slice_scale Create slice_scale SetRange \ [viewer GetWholeZMin] [viewer GetWholeZMax] slice_scale SetValue [viewer GetZSlice] slice_scale SetCommand "" \ {viewer SetZSlice [slice_scale GetValue] ; rw Render} pack [slice_scale GetWidgetName] -side top -expand n \ -fill x -padx 2 -pady 2 app Start rw Delete reader Delete viewer Delete iren Delete slice_scale Delete win Delete app Delete NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 16
17
Examples (cont.) KWWidgetsTour Show all widgets
Provide Tcl vs. C++ vs. Python code comparison NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 17
18
KWWidgets in Slicer3 in Base/GUI (Load/Save, App Settings, Color, Data, Fiducials, Models, ROI, Slices, Transforms) NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 18
19
KWWidgets in Slicer3 (cont.)
in C++ or Tcl modules slicerWiki: How to implement an Interactive Module GUI NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 19
20
KWWidgets in Slicer3 (cont.)
<?xml version="1.0" encoding="utf-8"?> <executable> <category> Filtering.Denoising </category> <title> Median Filter </title> <description> The MedianImageFilter is commonly used as a robust approach for noise reduction. This filter is particularly efficient against "salt-and-pepper" noise. In other words, it is robust to the presence of gray-level outliers. MedianImageFilter computes the value of each output pixel as the statistical median of the neighborhood of values around the corresponding input pixel. </description> <version>0.1.0.$Revision: 2085 $(alpha)</version> <contributor>Bill Lorensen</contributor> <parameters> <label>Median Filter Parameters</label> <description>Parameters for the median filter</description> <integer-vector> <name>neighborhood</name> <longflag>--neighborhood</longflag> <description>The size of the neighborhood in each dimension</description> <label>Neighborhood Size</label> <default>1,1,1</default> </integer-vector> </parameters> <label>IO</label> <description>Input/output parameters</description> <image> <name>inputVolume</name> <label>Input Volume</label> <channel>input</channel> <index>0</index> <description>Input volume to be filtered</description> </image> <name>outputVolume</name> <label>Output Volume</label> <channel>output</channel> <index>1</index> <description>Output filtered</description> </executable> in Command Line Plugins slicerWiki: Execution Model Documentation UI and command-line generated from self-describing XML NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 20
21
Resources Web & Wiki: http://kwwidgets.org
API: Tutorial and examples available in the source: cvs –d co KWWidgets Dashoard: NA-MIC, 2008 June Workshop, IHK Akademie Westerham NA-MIC, 2008 June Workshop, IHK Akademie Westerham June 16-17, 2008 21
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.