Difference between revisions of "Slicer4:ViewerDesign"

From Slicer Wiki
Jump to: navigation, search
Line 1: Line 1:
 
[[Slicer4:Developers#Projects|Back to Slicer 4 Developer Projects]]
 
[[Slicer4:Developers#Projects|Back to Slicer 4 Developer Projects]]
  
 +
= Project Description =
 
Ron would like to see a scalable architecture for the visual appearance of Slicer viewers as we add more types of elements and more of them. This architecture will also need to be able to accommodate new types of viewers such as graphs and tables.
 
Ron would like to see a scalable architecture for the visual appearance of Slicer viewers as we add more types of elements and more of them. This architecture will also need to be able to accommodate new types of viewers such as graphs and tables.
  
Line 9: Line 10:
 
= Notebook for Slicer 4 Presentation Layer Design =
 
= Notebook for Slicer 4 Presentation Layer Design =
  
 +
== Notes & Sketches (Chronologically listed) ==
  
 +
=== On Color-coding viewers ===
  
== Notes & Sketches (Chronologically listed) ==
+
* (from Jim) '''Colors & Qt''': Many of the viewers we are using colors from the Qt palette. The viewer "name" is color alias that is recognized by Qt.  But it doesn't need to be this way.  We could always go through a lookup to map viewers with nonstandard color names as the viewer name to a RGB triple. We'll just need to slip in that mapping in the appropriate places. Qt accepts "named colors" from the SVG color keywords. See http://www.w3.org/TR/SVG/types.html#ColorKeywords. Qt can also take ANY color specified as RGB, HSV, etc. components.
 +
 
 +
* (from Julien) There are 2 kinds of palettes:
 +
** a general "Qt application GUI" palette (color of the background, buttons, text, shadings, highlight color). This is QPalette.
 +
** a Slicer/MRML specific palette: color of the slice views, renderer background color of the 3D view, highlight of current view (slice or 3D). For now there is no placeholder for such a palette. I somewhat started to gather them in qMRMLColors.h/cxx. However, I believe it should be a VTK/MRML palette. Where MRML could provide a default palette, that can be extended/replaced by a Slicer palette.
 +
 
 +
* (from Julien) I've noticed there has been some work done in the past to allow such kind of feature: Slicer4\Modules\Meshing\BuildingBlock\vtkSlicerColor.h/cxx. I'm not sure in what extend we could reuse/generalize that work. For information, vtkMRMLViewNode already hardcodes the light blue background color.
 +
 
 +
* (question from Julien) Shall we make such a palette a singleton in MRML, or should it be a vtkMRMLScene member, other ideas ?
  
* '''Colors & Qt''': Many of the viewers we are using colors from the Qt palette. The viewer "name" is color alias that is recognized by QtBut it doesn't need to be this way. We could always go through a lookup to map viewers with nonstandard color names as the viewer name to a RGB triple. We'll just need to slip in that mapping in the appropriate places.
+
* (from Jim) The colors for the various viewers feels more like "application settings" or "look and feel" than MRMLI don't feel strongly about this but I wonder if the colors just need to be accessible from the Application object. I guess since we store things like the layout in MRML, it would make sense for the available colors to decorate the UI also be established in MRML.
  
 
= Guidelines for Developers of New Viewers =
 
= Guidelines for Developers of New Viewers =

Revision as of 12:53, 2 August 2011

Home < Slicer4:ViewerDesign

Back to Slicer 4 Developer Projects

Project Description

Ron would like to see a scalable architecture for the visual appearance of Slicer viewers as we add more types of elements and more of them. This architecture will also need to be able to accommodate new types of viewers such as graphs and tables.

We would also like to prepare a guide for developers of new types of viewers:

  • that ensures that all viewers have a consistent visual and interaction design,
  • and that makes it simpler for a developer to implement their viewer.

Notebook for Slicer 4 Presentation Layer Design

Notes & Sketches (Chronologically listed)

On Color-coding viewers

  • (from Jim) Colors & Qt: Many of the viewers we are using colors from the Qt palette. The viewer "name" is color alias that is recognized by Qt. But it doesn't need to be this way. We could always go through a lookup to map viewers with nonstandard color names as the viewer name to a RGB triple. We'll just need to slip in that mapping in the appropriate places. Qt accepts "named colors" from the SVG color keywords. See http://www.w3.org/TR/SVG/types.html#ColorKeywords. Qt can also take ANY color specified as RGB, HSV, etc. components.
  • (from Julien) There are 2 kinds of palettes:
    • a general "Qt application GUI" palette (color of the background, buttons, text, shadings, highlight color). This is QPalette.
    • a Slicer/MRML specific palette: color of the slice views, renderer background color of the 3D view, highlight of current view (slice or 3D). For now there is no placeholder for such a palette. I somewhat started to gather them in qMRMLColors.h/cxx. However, I believe it should be a VTK/MRML palette. Where MRML could provide a default palette, that can be extended/replaced by a Slicer palette.
  • (from Julien) I've noticed there has been some work done in the past to allow such kind of feature: Slicer4\Modules\Meshing\BuildingBlock\vtkSlicerColor.h/cxx. I'm not sure in what extend we could reuse/generalize that work. For information, vtkMRMLViewNode already hardcodes the light blue background color.
  • (question from Julien) Shall we make such a palette a singleton in MRML, or should it be a vtkMRMLScene member, other ideas ?
  • (from Jim) The colors for the various viewers feels more like "application settings" or "look and feel" than MRML. I don't feel strongly about this but I wonder if the colors just need to be accessible from the Application object. I guess since we store things like the layout in MRML, it would make sense for the available colors to decorate the UI also be established in MRML.

Guidelines for Developers of New Viewers