Difference between revisions of "Slicer3 Q&A 2008-11-18"

From NAMIC Wiki
Jump to: navigation, search
Line 55: Line 55:
 
* What existing modules in Slicer can serve as a good examples to follow (examples of good programming style, GUI, architecture, etc.)? (GradientAnisotropicDiffusion is one?) (Fedorov)
 
* What existing modules in Slicer can serve as a good examples to follow (examples of good programming style, GUI, architecture, etc.)? (GradientAnisotropicDiffusion is one?) (Fedorov)
  
* What are the prerequisites of what a novice Slicer developer should know/learn to program in Slicer? (C/C++, CMake, ITK, VTK, Tcl/Tk, KWWidgets (?)) (Fedorov)
+
* What are the prerequisites of what a novice Slicer developer should know/learn to program in Slicer? (C/C++, CMake, ITK, VTK, Tcl/Tk, KWWidgets (?)) (Fedorov/Haytham)
  
 
* Advantages and disadvantages of writing parts of the modules in Tcl (example advantage: no recompilation is needed to make changes) (Fedorov)
 
* Advantages and disadvantages of writing parts of the modules in Tcl (example advantage: no recompilation is needed to make changes) (Fedorov)
Line 65: Line 65:
 
* Memory management: how to avoid memory leaks, differences in memory management between different components (Fedorov)
 
* Memory management: how to avoid memory leaks, differences in memory management between different components (Fedorov)
  
* Overview of different classes of events in Slicer, and what action should be done in what observer (GUI events, MRML events, Logic events, Scene events, anything else?...) (Fedorov)
+
* Overview of different classes of events in Slicer, and what action should be done in what observer (GUI events, MRML events, Logic events, Scene events, anything else?...) (Fedorov/Haytham)
  
 
* How to track down memory leaks of a particular loadable module -- is it possible to get per-module leak report? (Fedorov)
 
* How to track down memory leaks of a particular loadable module -- is it possible to get per-module leak report? (Fedorov)
  
 
* Howto for Slicer Tcl interactor (Fedorov --  I would appreciate if someone help me documenting replies to this and other questions)
 
* Howto for Slicer Tcl interactor (Fedorov --  I would appreciate if someone help me documenting replies to this and other questions)
 +
 +
* How do the Logic Methods keep track of the MRML node events? Which Logic Methods are involved? Are Macros used, and if so, where are they defined? (Haytham)

Revision as of 19:58, 17 November 2008

Home < Slicer3 Q&A 2008-11-18

Logistics

3:30-5pm at the 2nd floor demo room at 1249 Boylston.

Attendees

Anyone is welcome, please sign up if you plan to attend:

Steve Pieper, Haytham Elhawary, Jan Gumprec, Andriy Fedorov, Jayender Jagadeesan

Questions

The name in parentheses defines the person who asks the question, and therefore is responsible for documenting the response.

  • Best debugging practices in Slicer (hints for debugging on Linux/Windows, debugging GUI event handling) (Fedorov)

In Linux, you can attach the debugger to Slicer as it is running. To do this, first find the process id (pid) of Slicer3-real, then start gdb and attach to pid. Tell gdb to continue, and once you have a crash, you can identify the faulting code line with gdb command 'where'. Here's an example:

[andrey@beat ~] ps -ef |grep Slicer3-real
andrey     486   443  0 13:21 pts/6    00:00:00 grep Slicer3-real
andrey   31341 31340 88 13:20 pts/2    00:00:59 /home/andrey/local/src/Slicer/Sl
icer3-build/bin/Slicer3-real
[andrey@beat ~] gdb
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
(gdb) attach 31341
Attaching to process 31341
Reading symbols from /home/andrey/local/src/Slicer/Slicer3-build/bin/Slicer3-real...done.
...
(gdb) c
Continuing.
[New Thread 0x437cb950 (LWP 493)]
[Thread 0x437cb950 (LWP 493) exited]
...
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f77be4de790 (LWP 31341)]
0x00007f77a93cd396 in __dynamic_cast () from /usr/lib64/libstdc++.so.6
(gdb) where
#0  0x00007f77a93cd396 in __dynamic_cast () from /usr/lib64/libstdc++.so.6
#1  0x000000000042e320 in Slicer3_main (argc=1, argv=0x7fffc6637d08)
    at /home/andrey/local/src/Slicer/Slicer3/Applications/GUI/Slicer3.cxx:1986
#2  0x000000000042f5c5 in main (argc=1, argv=0x7fffc6637d08)
    at /home/andrey/local/src/Slicer/Slicer3/Applications/GUI/Slicer3.cxx:2135
(gdb) q
The program is running.  Quit anyway (and detach it)? (y or n) y
Detaching from program: /home/andrey/local/src/Slicer/Slicer3-build/bin/Slicer3-real, process 31341
  • What existing modules in Slicer can serve as a good examples to follow (examples of good programming style, GUI, architecture, etc.)? (GradientAnisotropicDiffusion is one?) (Fedorov)
  • What are the prerequisites of what a novice Slicer developer should know/learn to program in Slicer? (C/C++, CMake, ITK, VTK, Tcl/Tk, KWWidgets (?)) (Fedorov/Haytham)
  • Advantages and disadvantages of writing parts of the modules in Tcl (example advantage: no recompilation is needed to make changes) (Fedorov)
  • High-level architecture/diagram of Slicer volume visualization: relationship between vtkMRMLScalarVolumeNode/vtkMRMLScalarVolumeDisplayNode/vtkMRMLScene, howto for volume rendering, ... (Fedorov)
  • Guidelines on the use of ITK filters from Slicer and what to expect. In case analogous functionality is available both in ITK and VTK, what should be used? (Fedorov)
  • Memory management: how to avoid memory leaks, differences in memory management between different components (Fedorov)
  • Overview of different classes of events in Slicer, and what action should be done in what observer (GUI events, MRML events, Logic events, Scene events, anything else?...) (Fedorov/Haytham)
  • How to track down memory leaks of a particular loadable module -- is it possible to get per-module leak report? (Fedorov)
  • Howto for Slicer Tcl interactor (Fedorov -- I would appreciate if someone help me documenting replies to this and other questions)
  • How do the Logic Methods keep track of the MRML node events? Which Logic Methods are involved? Are Macros used, and if so, where are they defined? (Haytham)