1 | .. _kernel-orfeotoolbox: |
---|
2 | |
---|
3 | How To Use the Orfeo Toolbox support |
---|
4 | ============================================= |
---|
5 | |
---|
6 | :Authors: Nicolas Bozon, Gérald Fenoy, Jeff McKenna |
---|
7 | :Last Updated: $Date: 2015-02-09 17:00:52 +0000 (Mon, 09 Feb 2015) $ |
---|
8 | |
---|
9 | The key idea of the ZOO `Orfeo Toolbox <http://orfeo-toolbox.org/otb/>`_ support implementation is to take advantage of the `OTB Applications <http://orfeo-toolbox.org/otb/otb-applications.html>`_ by using them directly as ZOO WPS Services, without any modifications. |
---|
10 | |
---|
11 | Here is an overview of the installation procedure and the required configuration to activate the OTB support in ZOO-Project. |
---|
12 | |
---|
13 | .. Note:: These installation steps were successfully tested on Ubuntu 14.4 LTS |
---|
14 | |
---|
15 | .. contents:: Table of Contents |
---|
16 | :depth: 3 |
---|
17 | :backlinks: top |
---|
18 | |
---|
19 | How to make it working ? |
---|
20 | ------------------------ |
---|
21 | |
---|
22 | Requirements |
---|
23 | ************** |
---|
24 | |
---|
25 | * latest `ZOO-Kernel <http://zoo-project.org/trac/browser/trunk/zoo-project/zoo-kernel>`_ trunk version |
---|
26 | * Orfeo Toolbox (`OTB 4.2.1 <http://orfeo-toolbox.org/otb/>`_ ) |
---|
27 | * Insight Segmentation and Registration Toolkit (`ITK-4.7 <http://itk.org/ITK/resources/software.html/>`_ ) |
---|
28 | |
---|
29 | Installation steps |
---|
30 | ******************** |
---|
31 | |
---|
32 | .. Note:: For OTB and ITK, the CMAKE_C_FLAGS and CMAKE_CXX_FLAGS must first be set to ``-fPIC`` |
---|
33 | |
---|
34 | Download lastest ZOO-Kernel code from SVN. |
---|
35 | |
---|
36 | .. code-block:: guess |
---|
37 | |
---|
38 | svn checkout http://svn.zoo-project.org/svn/trunk/zoo-kernel zoo-kernel |
---|
39 | |
---|
40 | Then compile ZOO-Kernel using the needed configuration options as shown bellow: |
---|
41 | |
---|
42 | .. code-block:: guess |
---|
43 | |
---|
44 | cd zoo-kernel |
---|
45 | autoconf |
---|
46 | ./configure --with-otb=/usr/local --with-itk=/usr/local --with-itk-version=4.7 |
---|
47 | make |
---|
48 | cp zoo_loader.cgi /usr/lib/cgi-bin |
---|
49 | |
---|
50 | Configuration steps |
---|
51 | ************************* |
---|
52 | |
---|
53 | Main configuration file |
---|
54 | ^^^^^^^^^^^^^^^^^^^^^^^ |
---|
55 | |
---|
56 | Add the following content to your ``/usr/lib/cgi-bin/main.cfg`` file |
---|
57 | in the ``[env]`` section: |
---|
58 | |
---|
59 | .. code-block:: guess |
---|
60 | |
---|
61 | ITK_AUTOLOAD_PATH=/usr/local/lib/otb/applications |
---|
62 | |
---|
63 | Services configuration file |
---|
64 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
---|
65 | |
---|
66 | The build of the `otb2zcfg <http://zoo-project.org/trac/browser/trunk/thirds/otb2zcfg>`_ utility is required to activate the available OTB Applications as WPS services. This can be done using the following command: |
---|
67 | |
---|
68 | .. code-block:: guess |
---|
69 | |
---|
70 | mkdir build |
---|
71 | cd build |
---|
72 | ccmake .. |
---|
73 | make |
---|
74 | |
---|
75 | Run the following command to generate all the needed zcfg files for the available OTB Application: |
---|
76 | |
---|
77 | .. code-block:: guess |
---|
78 | |
---|
79 | mkdir zcfgs |
---|
80 | cd zcfgs |
---|
81 | export ITK_AUTOLOAD_PATH=/your/path/to/otb/applications |
---|
82 | ../build/otb2zcfg |
---|
83 | cp *zcfg /location/to/your/cgi-bin |
---|
84 | |
---|
85 | .. warning |
---|
86 | |
---|
87 | The ITK_AUTOLOAD_PATH environment variable is required in the [env] section of your main.cfg. |
---|
88 | |
---|
89 | Services configuration file |
---|
90 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
---|
91 | |
---|
92 | Once done, OTB Applications should be listed as available WPS Services when runing a GetCapabilities request |
---|
93 | |
---|
94 | .. code-block:: guess |
---|
95 | |
---|
96 | http://localhost/cgi-bin/zoo_loader.cgi?request=GetCapabilities&service=WPS |
---|
97 | |
---|
98 | Each OTB Service can then be described individually using the DescribeProcess request, as for example: |
---|
99 | |
---|
100 | .. code-block:: guess |
---|
101 | |
---|
102 | http://localhost/cgi-bin/zoo_loader.cgi?request=DescribeProcess&service=WPS&version=1.0.0&Identifier=OTB.BandMath |
---|
103 | |
---|
104 | And executed according to your needs, as for the following example executing OTB.BandMath with the OTB sample data as input |
---|
105 | |
---|
106 | .. code-block:: guess |
---|
107 | |
---|
108 | http://localhost/cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=OTB.BandMath&DataInputs=il=Reference@xlink:href=http://hg.orfeo-toolbox.org/OTB-Data/raw-file/ca154074b282/Examples/verySmallFSATSW.tif;il=Reference@xlink:href=http://hg.orfeo-toolbox.org/OTB-Data/raw-file/ca154074b282/Examples/verySmallFSATSW_nir.tif;out=float;exp=im1b3*cos%28im1b1%29,im1b2*cos%28im1b1%29,im1b1*cos%28im1b1%29&RawDataOutput=out@mimeType=image/png |
---|
109 | |
---|
110 | When executing OTB applications as WPS Services, it is also possible to check the OTB process status, as the following example suggests: |
---|
111 | |
---|
112 | .. code-block:: guess |
---|
113 | |
---|
114 | http://localhost/cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=GetStatus&DataInputs=sid=1424457886&RawDataOutput=Result |
---|
115 | |
---|
116 | |
---|
117 | |
---|
118 | |
---|
119 | |
---|
120 | |
---|
121 | |
---|
122 | |
---|