]> Creatis software - gdcm.git/blob - DEVELOPPER
* Doc/CMakeLists.txt: the main page is now properly differentiated
[gdcm.git] / DEVELOPPER
1 The following comments are intended for core gdcm developpers.
2
3 * Compiling gdcm:
4   - Checkout the sources to an arbitrary directory noted GDCM (e.g. ~/cvs/gdcm).
5   - Checkout the test images to an arbitrary directory noted GDCMDATA
6     (e.g. ~/cvs/gdcm/gdcmData).
7   - Optionally create a temporary installation directory GDCMINSTALL e.g.
8     mkdir /tmp/gdcminstall
9   - Create a target directory GDCMBIN e.g.
10     mkdir /tmp/gdcmbin
11   - Configure cmake from GDCMBIN:
12     cd GDCMBIN
13     ccmake GDCM
14       * Toggle and adjust the required options and parameters, mainly
15         -- GDCM_DATA_ROOT should be set to GDCMDATA
16         -- CMAKE_INSTALL_PREFIX (equivalent of --prefix of the autotools)
17            should be set to GDCMINSTALL
18         -- CMAKE_BUILD_TYPE set to Debug or Release
19         -- GDCM_DOXYGEN 
20         -- GDCM_VTK When this option is on VTK_DIR might require manual
21            configuration
22         -- GDCM_WRAP_PYTHON
23       * Configure cmake: hit c
24       * Generate the makefiles (or dsw): hit g
25   - Compile gdcm
26     make  
27   - Run the tests manually (optional):
28     Caveat: if you run the tests before installing, you NEED to positionate
29             the environment variable GDCM_DICT_PATH to GDCM/Dicts e.g.
30             export GDCM_DICT_PATH=~/cvs/gdcm/Dicts
31     Assuming your cwd is GDCMBIN, three modes are then available:
32     -- 1/ acces to a by number:
33           ./Test/gdcmCxxTests
34     -- 2/ acces to a test by it's name, by passing it as argument to
35           gdcmCxxTests e.g.
36           ./Test/gdcmCxxTests hashtest
37     -- 3/ launch all the full test suite (again we assume cwd is GDCMBIN):
38           ctest
39           This is equivalent to "make test".
40           Note: ctest supports the argument filtering with regexp and
41                 the verbose mode e.g.
42                    ctest -R print -V
43                 proposes the tests containing "print" in their name and
44                 makes a verbose output. For other options refer to the
45                 documentation at http://www.cmake.org.
46
47 * Sending the result to kitware's dashboard (optional)
48   ctest -D Experimental
49   The results should appear in
50      http://public.kitware.com/dashboard.php?name=public
51      under the name of your machine (uname), but for ease of use you can
52      change the SITE variable in your CMakeCache.txt to something more 
53      accurate such as: GDCM-my_machine_name. The entry will then be within 
54      the "Experimental Builds" entry.
55
56 * Install gdcm (as specified by CMAKE_INSTALL_PREFIX)
57   make install
58   Note: the dictionaries used by gdcm are now located in
59         CMAKE_INSTALL_PREFIX + /share/ (i.e. GDCMINSTALL + /share/ if you
60         followed the above instructions).
61
62 * Python related section.
63   Depending on the cmake flags you used in order to compile gdcm could
64   be wrapped in two ways:
65   - the first python wrappers of gdcm uses Swig (http://www.swig.org). These
66     are the one generated when using autogen.sh --enable-python. 
67     The entry point here is the file gdcmPython/gdcm.i which uses the
68     Swig syntax. As the last lines of this file (the ones starting
69     with the %include directive) only some classes are wrapped for python.
70     In theory only the library interface (basically the classes gdcmHeader
71     and gdcmFile) should be wrapped, but the time being some additional
72     classes are added (just to make sure those classes are Swig compatible:
73     swig is here used as some link checker!?).
74     Since gdcm is written in C++, Swig will produce two different outputs:
75       -- some C based low level wrapper (see gdcmPython/gdcm_wrap.c)
76       -- some Python based object oriented so called "shadow classes" (see
77          file gdcmPython/gdcm.py)
78     We also added the file gdcmPython/__init__.py which is the one that
79     actually gets loaded when one uses the gdcmPython Python package.
80     The file __init__.py loads the Swig generated shadow classes (gdcm.py)
81     but will only re-export the interface of gdcm which corresponds to
82     the lines :
83        gdcmHeader = gdcm.gdcmHeader
84        gdcmDictSet = gdcm.gdcmDictSet
85        gdcmFile = gdcm.gdcmFile
86        [etc.]
87     Hence this whole Swig wrapping process is quite odd since we shall
88     wrap more classes (%include in swig.i) that eventually get exported to
89     the final user by gdcmPython/__init__.py.
90   - the second python wrappers uses the vtk (http://public.kitware.com/VTK/)
91     native wrappers i.e. the binary vtkWrapPython. But it should be noticed
92     that the purpose is here a bit different than the one of the Swig
93     generated Python wrappers. When using vtkWrapPython the goal is to
94     wrap a single vtk class namely vtkGdcmReader as defined in files
95     vtk/vtkGdcmReader.h and vtk/vtkGdcmReader.cxx (and of course those
96     files are hand made vtk oriented wrappers of gdcm).
97     Those wrappers are the one generated when using
98        autogen.sh --enable-python --enable-vtk
99   - In order to understand the difference between both wrappers you should 
100     compare both demo scripts gdcmPython/demo/vtkGdcmDemo.py and
101     gdcmPython/demo/vtkGdcmReader.py. The first one only uses the
102     Swig wrapped classes ("from gdcmPython import gdcmHeader') as opposed
103     to vtkGdcmReader.py which also uses vtkWrapPython wrapped classes
104     ("from gdcmPython.vtkgdcmPython import *").
105