Difference between revisions of "Sept-2009-SlicerWidgetsBrainstorm"

From NAMIC Wiki
Jump to: navigation, search
m (Text replacement - "http://www.slicer.org/slicerWiki/index.php/" to "https://www.slicer.org/wiki/")
 
(42 intermediate revisions by 9 users not shown)
Line 1: Line 1:
 +
== Presentation Material ==
 +
 +
* Jean-Christophe (JC) Fillion-Robin's [[media:QtInSlicer.ppt | Basic Qt usage in Slicer]]
 +
 
== Logistics ==
 
== Logistics ==
  
*Tentative date: Wednesday and Thursday, '''September 16 and 17, 2009'''
+
*Confirmed date: Wednesday and Thursday, '''September 16 (1-5pm) and 17 (9am-12), 2009'''
*Location: 1249 Boylston Street, 2nd floor conference room
+
*Location: [http://www.spl.harvard.edu/pages/Directions#Getting_to_1249_Boylston_Street. 1249 Boylston Street], 2nd floor conference room
  
 
== Goals ==
 
== Goals ==
  
The purpose of this meeting is to discuss development strategies to migrate Slicer to a new GUI layer.  For some background and discussion of our experiments with Qt and a possible development plan see [http://wiki.slicer.org/slicerWiki/index.php/Qt_in_Slicer3 this document on Qt and Slicer3].
+
The purpose of this meeting is to discuss development strategies to migrate Slicer to a new GUI layer.  For some background and discussion of our experiments with Qt and a possible development plan see [http://wiki.slicer.org/slicerWiki/index.php/Qt_in_Slicer3 this wiki page about Qt and Slicer3].
  
 
Important questions to consider at this meeting are:
 
Important questions to consider at this meeting are:
Line 21: Line 25:
 
** What are the trends in GUI interface development for applications like ours
 
** What are the trends in GUI interface development for applications like ours
 
** What are the risks/benefits/complexity trade offs of various approaches
 
** What are the risks/benefits/complexity trade offs of various approaches
 +
 +
== Activities at the Meeting ==
 +
* Demo of experiments
 +
** Steve on Qt/KWW coexisting in the same process space and use of QtWebKit for [http://viewvc.slicer.org/viewcvs.cgi/trunk/Base/GUI/vtkKWTextWithHyperlinksWithScrollbars.cxx?rev=10473&view=diff&r1=10473&r2=10472&p1=trunk/Base/GUI/vtkKWTextWithHyperlinksWithScrollbars.cxx&p2=/trunk/Base/GUI/vtkKWTextWithHyperlinksWithScrollbars.cxx hyperlinks in help frames].
 +
** Alex on Example Qt-based Slicer module
 +
* Review [http://wiki.slicer.org/slicerWiki/index.php/Qt_in_Slicer3#Statistics list of widgets that are in use in slicer currently] (Steve)
 +
* Review existing widgets in slicer and their Qt analogs (Seb)
 +
* Programming walkthrough of writing Qt Widgets and using them with VTK (JC)
 +
* Discussion points:
 +
** scripting options - [http://www.pyside.org/ PySide] (note: requires boost); [http://pythonqt.sourceforge.net/ pythonqt] and [http://www.riverbankcomputing.co.uk/news pyqt] are less desirable options.
 +
** various development environments (Visual Studio, QtCreator...)
 +
** review and refine [http://wiki.slicer.org/slicerWiki/index.php/Qt_in_Slicer3#Development_Plan_Option_for_Transition_to_Qt development plan]
 +
** Estimate how much human time is required to implement this
  
 
==List of Widgets that are needed for the Slicer port==
 
==List of Widgets that are needed for the Slicer port==
 +
 +
This list is a wishlist of many widgets, not all of which are required for slicer:
 +
 
* http://my-trac.assembla.com/protoctk/wiki/WidgetPlans
 
* http://my-trac.assembla.com/protoctk/wiki/WidgetPlans
  
 +
Ideally there will be a community-driven process to develop higher-level Qt widgets in a reusable library, possibly as part of the newly forming [http://www.na-mic.org/Wiki/index.php/Events:CTK-Workshop-June-2009 Common Toolkit (CTK)] effort.  Wherever possible, widgets developed for slicer should be written in a reusable fashion.  As always, the slicer code will be offered with a BSD-style license for re-use in other projects.
  
 
== Other Things to Consider ==
 
== Other Things to Consider ==
Line 34: Line 55:
 
** http://gwt.google.com/samples/Mail/Mail.html
 
** http://gwt.google.com/samples/Mail/Mail.html
 
** http://earth-api-samples.googlecode.com/svn/trunk/demos/drive-simulator/index.html
 
** http://earth-api-samples.googlecode.com/svn/trunk/demos/drive-simulator/index.html
 +
** http://blog.forwardbias.in/2009/09/side-effects-of-using-qtwebkit-for-desktop-apps.html
 
* echo http://demo.nextapp.com/echo3csjs/
 
* echo http://demo.nextapp.com/echo3csjs/
* Phyton wrappings around JavaScript
+
* Python wrappings around JavaScript
 
**http://pyjs.org
 
**http://pyjs.org
 
*** http://pyjs.org/examples/
 
*** http://pyjs.org/examples/
 
*** http://pyjs.org/examples/mail/output/Mail.html
 
*** http://pyjs.org/examples/mail/output/Mail.html
 +
* Objective-J (essentially Objective-C NextStep/Cocoa in javascript): http://cappuccino.org/
  
 
===Other Cross-platform GUIs===
 
===Other Cross-platform GUIs===
Line 44: Line 67:
 
* GNUstep http://www.gnustep.org/
 
* GNUstep http://www.gnustep.org/
 
* Adobe Flex http://www.adobe.com/products/flex/
 
* Adobe Flex http://www.adobe.com/products/flex/
* http://cappuccino.org/
+
* Clutter http://www.clutter-project.org/
  
 
=== Open Questions ===
 
=== Open Questions ===
Line 54: Line 77:
 
   ADD_EXECUTABLE(foobar WIN32 ${SRCS} ${UI_CXX} etc.)
 
   ADD_EXECUTABLE(foobar WIN32 ${SRCS} ${UI_CXX} etc.)
 
</pre>
 
</pre>
 +
 
* Need CMake to build a visual studio compatible version of Qt
 
* Need CMake to build a visual studio compatible version of Qt
 
** Seb: not really, no :) Qt is very easy to build, especially the latest LGPL distribution. It's a matter of typing one or two commands (qmake) and you are done; go get a coffee far far away though. We (mainly Bill H.) have approached Nokia/Trolltech to see if they would be interested in porting the Qt build system to CMake, but they are sticking to qmake for now (to my knowledge). Porting to CMake is, to my opinion, a non-trivial effort, considering the sheer size of the Qt distribution and how close to the system it is. I assume they include a lot of code to test if such or such feature is available at the low-level of the OS; while we are familiar with writing such tests, it takes some time and careful coding to cover all the bases.
 
** Seb: not really, no :) Qt is very easy to build, especially the latest LGPL distribution. It's a matter of typing one or two commands (qmake) and you are done; go get a coffee far far away though. We (mainly Bill H.) have approached Nokia/Trolltech to see if they would be interested in porting the Qt build system to CMake, but they are sticking to qmake for now (to my knowledge). Porting to CMake is, to my opinion, a non-trivial effort, considering the sheer size of the Qt distribution and how close to the system it is. I assume they include a lot of code to test if such or such feature is available at the low-level of the OS; while we are familiar with writing such tests, it takes some time and careful coding to cover all the bases.
 +
** Steve: actually not so easy to build for visual studio - Qt comes with a configure.exe that can create build files for various back-ends like msvc2008 etc, but there are a lot of issues reported (mvsc2008 worked, but msvc2005 had some build errors for webkit and others).  Presumably this is something that will sort out over time.
 +
 
* Need CPack to bundle Qt libraries with slicer binaries
 
* Need CPack to bundle Qt libraries with slicer binaries
 +
** Seb: we have experience with this, we deliver turn-key applications bundled with Qt (ParaView3 to name one, and other internal commercial projects).
 +
 
* How to adjust the look-and-feel to make an application that includes both KWW and Qt seem coordinated (even if the windows are not nested in the same toplevel window).
 
* How to adjust the look-and-feel to make an application that includes both KWW and Qt seem coordinated (even if the windows are not nested in the same toplevel window).
 +
** Seb: the trick with Slicer is that you are actually trying *not* to be consistent with the look&feel of the platform, but consistent "across" all the platforms, by using the theming framework I added a few years ago to KWW. On the other hand, Qt is definitely trying to look very close to the native UI it is running on. For Qt to look like Slicer running KWW, you would have to dig inside Qt Theming and Style Sheets (see [http://labs.trolltech.com/blogs/2007/11/27/theming-qt-for-fun-and-profit/ this article] from 2007) and shoehorn Qt to Slicer's branding. This is do-able, but is definitely considered an "advanced" topic; my opinion is that there is already a good deal to learn before. While I'm a big fan of branding and Wendy's fantastic UI work, I would also suggest reconsidering theming Slicer so heavily, I think it looks very alien on platforms like MacOS; maybe this doesn't bother users as much as I think, you guys have a survey? Definitely keep the beautiful icons, but let Qt do his job with the layout. KWW allows the user to bend the layout almost to the pixel, but I think going so close to the metal has been the source of a lot of frustrations and weird glitches in the layout, still to this day.
 +
** J2: the [http://doc.trolltech.com/4.5/qmotifstyle.html Motif style] seems the closer to the look-and-feel of Slicer. If it's not good enough, as Seb said, one can still create css-style sheets (and make it as similar as possible). A compromise between look-and-feel similarity and time to spend must be found ( i.e. how much time are we willing to spend to have a qt scrollbar to look exactly the same as the original Slicer scrollbar).
 +
 
* Best patterns for mixing Qt and VTK (events/callbacks/signals/slots)
 
* Best patterns for mixing Qt and VTK (events/callbacks/signals/slots)
 +
** Jc: VTK provide a class named '''vtkEventQtSlotConnect''' alowing to smoothly integrate both. That way, any vtkEvent can be connected to a QT slot. See http://www.vtk.org/doc/nightly/html/classvtkEventQtSlotConnect.html
 +
** J2: Note: vtkEventQtSlotConnect is only taking care of the VTK->Qt connection
  
 
== Attendance ==  
 
== Attendance ==  
Line 67: Line 100:
 
#Nicole Aucoin
 
#Nicole Aucoin
 
#Alex Yarmarkovich (Wed only)
 
#Alex Yarmarkovich (Wed only)
 +
#Sebastien Barre
 +
#JC Fillion
 +
#Katie Hayes
 +
#Andriy Fedorov
 +
#Junichi Tokuda (Thu only)
 +
 +
== Results ==
 +
 +
Much fruitful discussion and interesting demonstrations.  Overall feeling was that the task seems achievable and will provide positive benefits to the slicer developer and user communities.  There will be a major disruption of development activities but the participants felt that the Qt port is worth the effort and should be undertaken.
 +
 +
[https://www.slicer.org/wiki/Slicer:Developer_Meetings:20090916 Rough notes]
 +
 +
== Strawman timeline ==
 +
 +
# Shared desktop/tcon next Tuesday with Steve and JC (to be arranged - others can contact us to participate)
 +
# JC will spend the next few weeks fleshing out a first pass on a qSlicer framework for the main application and for modules.
 +
# Face to Face meeting in North Carolina in October or November
 +
# "Rough Cut" materials presented to the community in at SLC meeting in January 2010.
 +
# Further module porting and debugging in early 2010
 +
# "Developer Ready" version at Summer Project Week 2010.
 +
# Exact release date for a KWW-free version of Slicer TBD

Latest revision as of 17:48, 10 July 2017

Home < Sept-2009-SlicerWidgetsBrainstorm

Presentation Material

Logistics

  • Confirmed date: Wednesday and Thursday, September 16 (1-5pm) and 17 (9am-12), 2009
  • Location: 1249 Boylston Street, 2nd floor conference room

Goals

The purpose of this meeting is to discuss development strategies to migrate Slicer to a new GUI layer. For some background and discussion of our experiments with Qt and a possible development plan see this wiki page about Qt and Slicer3.

Important questions to consider at this meeting are:

  • What functionality does the application need to have in order to accomplish the needs of our DBP and clinical collaborations over the next several years?
  • What look and feel should the application have?
  • What capabilities will help us build the community of developers and users
    • Standard tools - well supported with ample documentation, support, etc
    • Flexibility to run in many environments
    • Ease of use and productivity for developers
  • Can we get a realistic estimate of the workload required and what skills are required to do the work?
    • How much work have comparable project required (by people with what skills and experience?)
    • What resources do we have to devote to this project compared with other demands?
  • Are we comfortable that we have considered all the viable alternatives?
    • What are the trends in GUI interface development for applications like ours
    • What are the risks/benefits/complexity trade offs of various approaches

Activities at the Meeting

  • Demo of experiments
    • Steve on Qt/KWW coexisting in the same process space and use of QtWebKit for hyperlinks in help frames.
    • Alex on Example Qt-based Slicer module
  • Review list of widgets that are in use in slicer currently (Steve)
  • Review existing widgets in slicer and their Qt analogs (Seb)
  • Programming walkthrough of writing Qt Widgets and using them with VTK (JC)
  • Discussion points:
    • scripting options - PySide (note: requires boost); pythonqt and pyqt are less desirable options.
    • various development environments (Visual Studio, QtCreator...)
    • review and refine development plan
    • Estimate how much human time is required to implement this

List of Widgets that are needed for the Slicer port

This list is a wishlist of many widgets, not all of which are required for slicer:

Ideally there will be a community-driven process to develop higher-level Qt widgets in a reusable library, possibly as part of the newly forming Common Toolkit (CTK) effort. Wherever possible, widgets developed for slicer should be written in a reusable fashion. As always, the slicer code will be offered with a BSD-style license for re-use in other projects.

Other Things to Consider

Our current plan is to move to QT. However, there are some alternates which should be looked at as a due diligence:

Javascript family

Note: with Qt's incorporation of WebKit it is possible to run any of the javascript tools natively inside a Qt application to build an alternate GUI.

Demo showing QVTKWidget as a plugin to a webpage with methods callable via JavaScript

Other Cross-platform GUIs

Open Questions

  • How .ui files mix with CMake and how they are called
    • Seb: This is quite easy. Support for Qt in CMake is very strong, as a result of our collaboration with the KDE team a few years ago. KDE relies entirely on Qt and is CMake's largest project (to my knowledge). Dealing with .ui files goes like this (this should look familiar if you have worked with VTK wrappers):
  SET(UI_SRCS foo.ui bar.ui)
  QT4_WRAP_UI(UI_CXX ${UI_SRCS})
  ADD_EXECUTABLE(foobar WIN32 ${SRCS} ${UI_CXX} etc.)
  • Need CMake to build a visual studio compatible version of Qt
    • Seb: not really, no :) Qt is very easy to build, especially the latest LGPL distribution. It's a matter of typing one or two commands (qmake) and you are done; go get a coffee far far away though. We (mainly Bill H.) have approached Nokia/Trolltech to see if they would be interested in porting the Qt build system to CMake, but they are sticking to qmake for now (to my knowledge). Porting to CMake is, to my opinion, a non-trivial effort, considering the sheer size of the Qt distribution and how close to the system it is. I assume they include a lot of code to test if such or such feature is available at the low-level of the OS; while we are familiar with writing such tests, it takes some time and careful coding to cover all the bases.
    • Steve: actually not so easy to build for visual studio - Qt comes with a configure.exe that can create build files for various back-ends like msvc2008 etc, but there are a lot of issues reported (mvsc2008 worked, but msvc2005 had some build errors for webkit and others). Presumably this is something that will sort out over time.
  • Need CPack to bundle Qt libraries with slicer binaries
    • Seb: we have experience with this, we deliver turn-key applications bundled with Qt (ParaView3 to name one, and other internal commercial projects).
  • How to adjust the look-and-feel to make an application that includes both KWW and Qt seem coordinated (even if the windows are not nested in the same toplevel window).
    • Seb: the trick with Slicer is that you are actually trying *not* to be consistent with the look&feel of the platform, but consistent "across" all the platforms, by using the theming framework I added a few years ago to KWW. On the other hand, Qt is definitely trying to look very close to the native UI it is running on. For Qt to look like Slicer running KWW, you would have to dig inside Qt Theming and Style Sheets (see this article from 2007) and shoehorn Qt to Slicer's branding. This is do-able, but is definitely considered an "advanced" topic; my opinion is that there is already a good deal to learn before. While I'm a big fan of branding and Wendy's fantastic UI work, I would also suggest reconsidering theming Slicer so heavily, I think it looks very alien on platforms like MacOS; maybe this doesn't bother users as much as I think, you guys have a survey? Definitely keep the beautiful icons, but let Qt do his job with the layout. KWW allows the user to bend the layout almost to the pixel, but I think going so close to the metal has been the source of a lot of frustrations and weird glitches in the layout, still to this day.
    • J2: the Motif style seems the closer to the look-and-feel of Slicer. If it's not good enough, as Seb said, one can still create css-style sheets (and make it as similar as possible). A compromise between look-and-feel similarity and time to spend must be found ( i.e. how much time are we willing to spend to have a qt scrollbar to look exactly the same as the original Slicer scrollbar).
  • Best patterns for mixing Qt and VTK (events/callbacks/signals/slots)

Attendance

  • Open to all self-declared Slicer developers:
  1. Will Schroeder
  2. Steve Pieper
  3. Ron Kikinis
  4. Nicole Aucoin
  5. Alex Yarmarkovich (Wed only)
  6. Sebastien Barre
  7. JC Fillion
  8. Katie Hayes
  9. Andriy Fedorov
  10. Junichi Tokuda (Thu only)

Results

Much fruitful discussion and interesting demonstrations. Overall feeling was that the task seems achievable and will provide positive benefits to the slicer developer and user communities. There will be a major disruption of development activities but the participants felt that the Qt port is worth the effort and should be undertaken.

Rough notes

Strawman timeline

  1. Shared desktop/tcon next Tuesday with Steve and JC (to be arranged - others can contact us to participate)
  2. JC will spend the next few weeks fleshing out a first pass on a qSlicer framework for the main application and for modules.
  3. Face to Face meeting in North Carolina in October or November
  4. "Rough Cut" materials presented to the community in at SLC meeting in January 2010.
  5. Further module porting and debugging in early 2010
  6. "Developer Ready" version at Summer Project Week 2010.
  7. Exact release date for a KWW-free version of Slicer TBD