Difference between revisions of "Special topic breakout: KWWidgets"
Line 100: | Line 100: | ||
==== From Gary and James:==== | ==== From Gary and James:==== | ||
− | * I'd like to have a discussion of how to make a widget that reads one image plane at a time from a volume to make a multi-data set display. We have an implementation in wxWidgets that reads data from multiple files as a slider that changes the slice number without having to read the entire volumes into memory.<br>'''Hint:''' ''I think that is demonstrated by the MedicalImageViewer example. The reading/caching/streaming strategy is not KWW related, but VTK related.'' | + | * I'd like to have a discussion of how to make a widget that reads one image plane at a time from a volume to make a multi-data set display. We have an implementation in wxWidgets that reads data from multiple files as a slider that changes the slice number without having to read the entire volumes into memory.<br>'''Hint:''' ''I think that is demonstrated by the MedicalImageViewer example. The reading/caching/streaming strategy is not KWW related, but VTK related though.'' |
− | * When displaying multiple vtkKWRenderWindows at once, the KWwidgets base class generates an error. Being able to display multiple renderwindows at one time is an essential requirement for our project. <br>'''Hint:''' ''Displaying multiple render windows is done by pretty all | + | * When displaying multiple vtkKWRenderWindows at once, the KWwidgets base class generates an error. Being able to display multiple renderwindows at one time is an essential requirement for our project. <br>'''Hint:''' ''Displaying multiple render windows is done by pretty much all our medical apps at Kitware, so yes, this is doable and we can help. What error message are you referring to?.'' |
− | * The order of linking the ITK, VTK, TCL, TK and KWwidget libraries so that they do not conflict.<br>'''Hint:''' ''I'm not aware of ordering conflicts. | + | * The order of linking the ITK, VTK, TCL, TK and KWwidget libraries so that they do not conflict.<br>'''Hint:''' ''I'm not aware of ordering conflicts. Have a look at the KWW examples and how they are linked: there is *no* explicit mention to VTK and Tcl/Tk, they are pulled automatically by CMake as part of the dependencies.'' |
− | * We want to access the KWwidgets' device client/handles for drawing on the controls.<br>'''Hint:''' ''Which control?'' | + | * We want to access the KWwidgets' device client/handles for drawing on the controls.<br>'''Hint:''' ''Which control?'' |
==== From Vincent ==== | ==== From Vincent ==== |
Revision as of 20:56, 23 June 2007
Home < Special topic breakout: KWWidgets![](/w/img_auth.php/d/de/ProjectWeek-2007.png)
KWWidgets Breakout Session
June 26th, 1-2pm
Location: Grier Rooms A & B: 34-401A & 34-401B
Attendees:
- Yumin Yuan
- Steve Pieper
- Alex Yarmarkovich
- Wendy Plesniak
- Nicole Aucoin
- Curt Lisle
- Csaba Csoma
- Brad Davis
- David Gobbi
- Kiran Shivanna
- Kevin Teich
- Jeff Hawley
- Xiujuan Geng
- James Harris
- Gary Christensen
- Paul Song
- Alex. Gouaillard
- Vincent Magnotta
- Kiran Shivanna
Agenda
- Roadmap (to help KWWidgets developers prioritize their work)
- Widget feature requests / feedback
- Talk about best approaches to making some widget behavior appear consistent across platforms.
- Separate Tutorial Session for New Users (to happen possibly on Wednesday)
Specific Issues
From Nicole Aucoin
Directory selection dialog box on linux:
- Bug: it pops up with a default width such that the right scroll bar isn't visible (see this screenshot; to reproduce it, start up Slicer3, go to the Models module, click on "Load Directory").
Hint: the quickest workaround at this point would be to make the default width a tad larger so that the right scrollbar button shows up (Yumin).
- Request: an entry box where I can type a path to reduce clicking through the tree (useful before setting up a favourite)
Hint: Very doable (Yumin). Let's put all requests in the TODO list and prioritize.
From Curtis Lisle
- I have had trouble initializing widgets to specific values in advance of user input. For example, I've created interfaces with sliders and buttons but I have had trouble getting the widgets toinitialize in a state different then the default state. For example, setting a slider to value=26 in the middle of its range without dragging the mouse. The API looks like it is there, but I couldn't get it to work for me. I'm sure I tried setting the state before and after creation, if I remember, but no luck. It may be that I'm not updating the GUI successfully after changing values. Update: see screenshot; by state, I mean the widget-specific state, such as a check button is checked, or a slider is set at a particular value within its range. For example, the "Outline Display" button could be checked ON via API control of the program, not the user clicking on it. Before this picture was taken, I dragged the "element size" slider to 93% via the mouse. I'd like to instantiate the GUI, then set the actual positions and state values of the widgets. I just need clarity on the order of events to invoke through the API or help figuring out what I'm doing wrong. I notice that for KWWidgets, State usually means enabled/disabled to process user events. Instead, I am thinking about setting widget values from the program. I guess for CheckButtons, this would be Get/SetSelectedState(). For a vtkKWScale, this would be SetValue(). I tried setting these but didn't see the effect on the GUI. Maybe I am just not invoking Modified() correctly afterwards.
- discuss when UI elements need to have Modified() / Update()invoked to refresh their appearance. I used a histogram widget on a project and had to experiment a lot calling the panel and RenderWidowWidget, etc. before I finally got the histogram to update when the input changed.
From Brad Davis
- Bug: Double-clicking does not work with slicer3 and linux.
Hint: The KWWidgets demo/examples handle double-clicks fine, so my guess is that Slicer3 is intercepting them. Yumin to investigate this issue (until I get access to my Linux box at work). - Bug: File->Add Data does not use new file browser.
Hint: Sounds like a quick fix to me (Yumin). - Request: Tree with additional columns widget
Hint: The TkTreeCtrl library is in KWW and allows that, but one need to wrap it inside a C++ class, and this is a lot of work (Seb). Let's put all requests in the TODO list and prioritize.
From Alex:
- Request: I would lile to address the performance of building GUI in slicer3 Modules. When selecting a module for the first time (Volumes or Models) it takes noticable time before the UI panel is displayed.
Hint: Well, you can't have your cake and eat it too :)) We delayed the creation of modules so that Slicer3 starts up faster. But one way or the other, the modules GUI has to be created. I just tried on my laptop on Win32, and I did not notice anything slow when I selected a few modules. Which ones are slow? Maybe one of the slow modules is actually doing more than just creating GUI when it is initialized.
- Request: Customizable tree widget similar to slicer2 model hierarchy editor: allow to add push-buttons or check boxes for the individual tree leaves.
Hint: The TkTreeCtrl library is in KWW and allows that, but one need to wrap it inside a C++ class, and this is a lot of work (Seb). Let's put all requests in the TODO list and prioritize.
From Wendy:
Mostly pesky things:
- Request: Creating special versions of menubutton drop-down menus with scroll capability.
Hint: There is no such native widget, so we would have to create a composite widget mixing a button and a scroll list (Seb or Yumin). A day or two worth probably. Let's put all requests in the TODO list and prioritize. - Request: checkbuttons and radiobuttons with consistent "on/off" visual representation across platforms. (either special Slicer widgets or KWWidgets).
Hint: Tcl/Tk does not provide an API to modify that visual representation (called the 'indicator'), since it is trying to use the native widgets when possible. However, you can emulate that behavior by setting an image for both unselected and selected state (SetImageToPredefinedIcon, SetSelectImageToPredefinedIcon), then make sure the image does not override the text (SetCompoundModeToLeft), remove the usual indicator (SetIndicatorVisibility), and remove the border of what is now a button (SetBorderWidth). All of those calls can be made into a theme. I've update the KWThemeExample (check the green theme) to show how it is done. I would recommend against it, as a lot of Slicer3 GUI already uses SetImage and SetSelectImage to provide graphical checkbuttons instead of textual ones. I'm not confident this would play well, but let's try.
It would be good to decide on a strategy for addressing these things.
- Request: Also, if a radiobutton's indicator visibility is off, the widget gets rendered with a 3D effect (even if we're using an icon to display the button's on/off state). Can we turn that 3D effect off?
Hint: Not to my knowledge, it's a Tk feature.
From KWW-Users mailing list
- http://public.kitware.com/pipermail/kwwidgets/2007-June/000456.html
Hint: To be investigrated by the File Browser Master (Yumin). - http://public.kitware.com/pipermail/kwwidgets/2007-June/000461.html
Hint: Gonna need some source code/example to reproduce it (Seb). - http://public.kitware.com/pipermail/kwwidgets/2007-May/000433.html
Hint: I've head this has been done but usually no, the command has to be a Tcl command. We would need a Python guru on this one.
From Steve:
I'd like to have a discussion of GUI Tracing. In slicer3 we've started to experiment with a MRML-based tracing structure using the scene snapshot infrastructure, but we should consider if this is preferable to a GUI-based solution or not. See, for example, the vtkSlicerRecordSnapshotWidget.
Performance of the file browser could be improved (request for multi-threaded solution or a helper process that does the glob'ing so the main application does not block).
Look and feel issues:
- On windows, the menu bar and scroll bar do not get the appearance.
Hint: Nope, that was investigated in the past, menu bar and scroll bar are not themable on Windows, it's a Tk "feature". - On linux, font size is sometimes way too small.
Hint: Fonts are themable, did you try assigning a bigger one globally?.
- Maybe just me, but I find the new file browser sometimes ignores doubleclicks -- perhaps it is more picky about any small mouse movement between clicks?
Hint: Would the be related to the whole double-click problem mentioned already, i.e. Slicer3 might be capturing double-clicks..
- Configure event management is still a problem - dragging the split frame or hiding the left panel (with F5) causes a lot of extraneous ConfigureEvents.
Hint: pretty much all the widgets are inside those split frames, hence repacked/relayout by Tk, and that may trigger a ton of ConfigureEvents (not actual 'pack' calls but just Tk re-doing its whole layout, which triggers events). There are so many widgets and different packing parameters, some "rubber-band" effect may be going on where the layout is adjusted iteratively until it stabilizes.
From Gary and James:
- I'd like to have a discussion of how to make a widget that reads one image plane at a time from a volume to make a multi-data set display. We have an implementation in wxWidgets that reads data from multiple files as a slider that changes the slice number without having to read the entire volumes into memory.
Hint: I think that is demonstrated by the MedicalImageViewer example. The reading/caching/streaming strategy is not KWW related, but VTK related though.
- When displaying multiple vtkKWRenderWindows at once, the KWwidgets base class generates an error. Being able to display multiple renderwindows at one time is an essential requirement for our project.
Hint: Displaying multiple render windows is done by pretty much all our medical apps at Kitware, so yes, this is doable and we can help. What error message are you referring to?.
- The order of linking the ITK, VTK, TCL, TK and KWwidget libraries so that they do not conflict.
Hint: I'm not aware of ordering conflicts. Have a look at the KWW examples and how they are linked: there is *no* explicit mention to VTK and Tcl/Tk, they are pulled automatically by CMake as part of the dependencies.
- We want to access the KWwidgets' device client/handles for drawing on the controls.
Hint: Which control?
From Vincent
There are issues with Slicer3 and fonts under Ubuntu Linux (Fiesty Fawn). The fonts are unreadable under this system. On the same system, Paraview fonts appear just fine. After performing some testing and evaluation, it appears that this is related to the order that fonts are resolved under Linux. We have a little script that will work around this by removing the X11 fonts on this sytem and only using the other system fonts for Slicer3. This is an ugly hack, but was close as we managed to get to track down the issue after approximately 3-4 hours of investigation.
Hint: If we are talking ParaView 2 (the old ones), then they may be specifying their own fonts explicitly at startup, and that can be done by Slicer3 as well, fonts are themable. If ParaView3, then it's a different story since it is using Qt.
#!/bin/bash mv /usr/share/fonts/X11 /usr/share/fonts/X11-Slicer3 /opt/Slicer3/Slicer3 mv /usr/share/fonts/X11-Slicer3 /usr/share/fonts/X11