diff --git a/Documentation/Cookbook/rst/Installation.rst b/Documentation/Cookbook/rst/Installation.rst index 973783f63321df3fded8e591a0dec9846a751304..e37fd817b6046e39319e6502f05f4825a9e7c4da 100644 --- a/Documentation/Cookbook/rst/Installation.rst +++ b/Documentation/Cookbook/rst/Installation.rst @@ -87,7 +87,7 @@ You can add it by using these command-lines: sudo aptitude install add-apt-repository sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable -After you can run: +You will then need to run: :: @@ -114,8 +114,8 @@ OpenSuse 12.X and higher For OpenSuse 12.X and higher, OTB Applications packages are available through *zypper*. -First, you need to add the appropriate repositories with these -command-lines (please replace :math:`11.4` by your OpenSuse version): +First, you need to add the appropriate repositories with the following +commands (please replace :math:`11.4` with your version of OpenSuse): :: @@ -126,7 +126,7 @@ command-lines (please replace :math:`11.4` by your OpenSuse version): sudo zypper ar http://download.opensuse.org/repositories/home:/tzotsos/openSUSE_11.4/ tzotsos -Now run: +You should then run: :: diff --git a/Documentation/Cookbook/rst/Installation_Linux.txt b/Documentation/Cookbook/rst/Installation_Linux.txt index c4eb913166f05a59ea93471a2f6abac81beddc7b..bc238f41188379a7e082f6df34cf30180bc519f9 100644 --- a/Documentation/Cookbook/rst/Installation_Linux.txt +++ b/Documentation/Cookbook/rst/Installation_Linux.txt @@ -1,24 +1,24 @@ We provide a binary package for GNU/Linux x86_64. This package includes -all of OTB applications along with commandline and graphical launchers. -Download it from `OTB's download page +all of the OTB applications along with command line and graphical launchers. +It can be downloaded from `OTB's download page <https://www.orfeo-toolbox.org/download>`__. -This package is a self-extractible archive. You may uncompress it with a -double-click on the file, or with the command line: +This package is a self-extractable archive. You may uncompress it with a +double-click on the file, or from the command line as follows: .. parsed-literal:: chmod +x OTB-|release|-Linux64.run ./OTB-|release|-Linux64.run -The self-extractible archive only needs common tools found on most Linux +The self-extractable archive only needs common tools found on most Linux distributions ("sed", "grep", "find", "cat", "printf", "ln", ...). However, be aware that it requires tools such as "which" and "file" (they are not always present, for instance when building a container). Please note that the resulting installation is not meant to be moved, you should uncompress the archive in its final location. Once the -archive is extracted, the directory structure is made of: +archive is extracted, the directory structure consists of: - ``monteverdi.sh``: A launcher script for Monteverdi @@ -38,9 +38,9 @@ archive is extracted, the directory structure is made of: In order to run the command line launchers, this package doesn’t require any special library that is not present in most modern Linux -distributions. There is a small caveat for "expat" though. The binaries depend +distributions. There is a small caveat for "expat" though as these binaries depend on "libexpat.so", which can be supplied by most package managers (apt, yum, ...). -If not already present, look for one of the following packages: +If not already present, it is necessary to install one of the following packages: :: @@ -65,14 +65,14 @@ with ``source otbenv.profile``. Python bindings ~~~~~~~~~~~~~~~ -Starting from OTB 5.8.0, OTB python bindings are distributed with binary package. -currently only Python 2.x is supported. If no compatible python is found, installation -notify you about it. If everything works fine, you will be given information about -using python bindings. +Starting from OTB 5.8.0, OTB Python bindings are distributed with binary package. +Currently only Python 2.x is supported and if no compatible Python version is found a +notification is generated during the installation process. If the installation completes +without issue, information relating to your Python bindings will be provided. -You must have python numpy bindings installed in your system. you can install it locally -without admin rights with "pip install --user numpy". This is to give users to choose -their own existing python installation rather than distributing one in OTB package +You must have Python numpy bindings installed in your system. They can be installed locally +without admin rights as follows: "pip install --user numpy". This is to give users the option +to select their own existing Python installation rather than the one dibstributed by the OTB package. Notes: diff --git a/Documentation/Cookbook/rst/Installation_Macx.txt b/Documentation/Cookbook/rst/Installation_Macx.txt index c142851cefee0ea80700ba48eb020051f05efd29..c004af64d3f1d0679015b608fba8f753ab5c1457 100644 --- a/Documentation/Cookbook/rst/Installation_Macx.txt +++ b/Documentation/Cookbook/rst/Installation_Macx.txt @@ -35,7 +35,7 @@ using python bindings. You must have python numpy bindings installed in your system. you can install it locally without admin rights with "pip install --user numpy". This is to give users to choose -their own existing python installation rather than distributing one in OTB package +their own existing python installation rather than distributing one in OTB package. Notes: diff --git a/Documentation/Cookbook/rst/Installation_Windows.txt b/Documentation/Cookbook/rst/Installation_Windows.txt index d9a72803aa4b5a0d61eb2adb4906e2ee4d50415d..d49f183da74fce0cfa575f2c8c1004fbcb6aa622 100644 --- a/Documentation/Cookbook/rst/Installation_Windows.txt +++ b/Documentation/Cookbook/rst/Installation_Windows.txt @@ -25,14 +25,14 @@ with ``otbenv.bat``. Python bindings ~~~~~~~~~~~~~~~ -Starting from OTB 5.8.0, OTB python bindings are distributed with binary package. -currently only Python 2.x is supported. If no compatible python is found, installation -notify you about it. If everything works fine, you will be given information about -using python bindings. - -You must have python numpy bindings installed in your system. you can install it locally -without admin rights with "pip install --user numpy". This is to give users to choose -their own existing python installation rather than distributing one in OTB package +Starting from OTB 5.8.0, OTB Python bindings are distributed with binary package. +Currently only Python 2.x is supported and if no compatible Python version is found a +notification is generated during the installation process. If the installation completes +without issue, information relating to your Python bindings will be provided. + +You must have Python numpy bindings installed in your system. They can be installed locally +without admin rights as follows: "pip install --user numpy". This is to give users the option +to select their own existing Python installation rather than the one dibstributed by the OTB package. Notes ~~~~~ diff --git a/Documentation/Cookbook/rst/Monteverdi.rst b/Documentation/Cookbook/rst/Monteverdi.rst index 991b4d6e7c5b81ab8ee90fe899aa17de91558734..257ae1a017a0bac15cadf68443a6a5cdf6d236a4 100644 --- a/Documentation/Cookbook/rst/Monteverdi.rst +++ b/Documentation/Cookbook/rst/Monteverdi.rst @@ -72,11 +72,11 @@ Image displaying This part of the main window is intended to display the images loaded by the user. There are many nice keyboard shortcuts or mouse tricks that let the user have a better experience in navigating throughout the -loaded images. These shortcuts and tricks are given within the Help item -of the main menu, by clicking Keymap; here is a short list of the most -useful ones: +loaded images. These shortcuts and tricks are provided within the Help item +of the main menu under Keymap. Here is a short list of the most +commonly used ones: -The classical ones: +The standard ones: - CTRL+O = Open file(s) @@ -108,8 +108,8 @@ Right side dock The dock on the right side is divided into four tabs: -- Quicklook: gives the user a degraded view of the whole extent, - letting him/her easily select the area to be displayed +- Quicklook: provides an overview of the full extent of the image, + and allows one to easily select the area to be displayed. - Histogram: gives the user information about the value distribution of the selected channels. By clicking the mouse’s left button, user @@ -208,21 +208,20 @@ BandMath BandMath application is intended to apply mathematical operations on pixels (launch it with shortcut CTRL+A). In this example, we are going to use this application to change the dynamics of an image, and check -the result by looking at histogram tab, in the right side dock. The +the result by looking at the histogram tab on the right-hand side of the GUI. The formula used is the following: :math:`\text{im1b1} \times 1000`. In the figures below ( [fig:BM]), one can notice that the mode of the distribution is located at position :math:`356.0935`, whereas in the transformed image, the mode is located at position :math:`354737.1454`, -that’s to say 1000 times farther away approximately (the cursors aren’t +that’s to say approximately 1000 times further away (the cursors aren’t placed exactly at the same position in the screenshots). .. figure:: Art/MonteverdiImages/BM.png Segmentation ~~~~~~~~~~~~ - -Now, let’s use the segmentation application (launch it with shortcut -CTRL+A). We let the user take a look at the application’s documentation; +From within Monteverdi, the Segmentation application can be launched using the +shortcut CTRL+A. We let the user take a look at the application’s documentation; let’s simply say that as we wish we could display the segmentation with , we must tell the application to output the segmentation in raster format. Thus, the value of the mode option must be set to raster. The diff --git a/Documentation/Cookbook/rst/OTB-Applications.rst b/Documentation/Cookbook/rst/OTB-Applications.rst index 9d218f15fa2a65c1d52bc691a24a19373b80a737..55d0f53dd1043442aa4ecd488337de5fe774bfbd 100644 --- a/Documentation/Cookbook/rst/OTB-Applications.rst +++ b/Documentation/Cookbook/rst/OTB-Applications.rst @@ -3,15 +3,16 @@ A brief tour of OTB Applications OTB ships with more than 90 ready to use applications for remote sensing tasks. They usually expose existing processing functions from the underlying C++ -library, or compose them into high level pipelines. OTB applications allow to: +library, or integrate them into high level pipelines. OTB applications allow the user +to: -- Combine together two or more functions from the Orfeo Toolbox, +- Combine two or more functions from the Orfeo ToolBox, -- Provide a nice high level interface to handle: parameters, input - data, output data and communication with the user. +- Provide a high level interface to handle: input and output data, + definition of parameters and communication with the user. OTB applications can be launched in different ways, and accessed from different -entry points. The framework can be extended, but Orfeo Toolbox ships with the following: +entry points. While the framework can be extended, the Orfeo ToolBox ships with the following: - A command-line launcher, to call applications from the terminal, @@ -50,16 +51,15 @@ results in the following help to be displayed: Usage: ./otbApplicationLauncherCommandLine module_name [MODULEPATH] [arguments] The ``module_name`` parameter corresponds to the application name. The -``[MODULEPATH]`` argument is optional and allows to pass to the launcher -a path where the shared library (or plugin) corresponding to -``module_name`` is. +``[MODULEPATH]`` argument is optional and allows the path to the shared library +(or plugin) correpsonding to the ``module_name`` to be passed to the launcher. It is also possible to set this path with the environment variable ``OTB_APPLICATION_PATH``, making the ``[MODULEPATH]`` optional. This variable is checked by default when no ``[MODULEPATH]`` argument is given. When using multiple paths in ``OTB_APPLICATION_PATH``, one must make sure to use the standard path separator of the target system, which -is ``:`` on Unix, and ``;`` on Windows. +is ``:`` on Unix and ``;`` on Windows. An error in the application name (i.e. in parameter ``module_name``) will make the ``otbApplicationLauncherCommandLine`` lists the name of @@ -73,12 +73,12 @@ standard application installation path to the ``OTB_APPLICATION_PATH`` environment variable. These scripts are named ``otbcli_<ApplicationName>`` and do not need any -path settings. For example you can start the Orthorectification +path settings. For example, you can start the Orthorectification application with the script called ``otbcli_Orthorectification``. -Launching an application with no or incomplete parameters will make the -launcher display a summary of the parameters, indicating the mandatory -parameters missing to allow for application execution. Here is an +Launching an application without parameters, or with incomplete parameters, will cause the +launcher to display a summary of the parameters. This summary will display the minimum set +of parameters that are required to execute the application. Here is an example with the OrthoRectification application: :: @@ -129,7 +129,7 @@ chapter [chap:apprefdoc], page or follow the ``DOCUMENTATION`` hyperlink provided in ``otbApplicationLauncherCommandLine`` output. Parameters are passed to the application using the parameter key (which might include one or several ``.`` character), prefixed by a ``-``. -Command-line examples are provided in chapter [chap:apprefdoc], page . +Command-line examples are provided in chapter [chap:apprefdoc], page. Graphical launcher ------------------ @@ -138,8 +138,7 @@ The graphical interface for the applications provides a useful interactive user interface to set the parameters, choose files, and monitor the execution progress. -This launcher needs the same two arguments as the command line launcher -: +This launcher needs the same two arguments as the command line launcher: :: @@ -207,10 +206,10 @@ configured automatically so you don’t need to tweak In the ``otbApplication`` module, two main classes can be manipulated : - ``Registry``, which provides access to the list of available - applications, and can create applications + applications, and can create applications. - ``Application``, the base class for all applications. This allows to - interact with an application instance created by the ``Registry`` + interact with an application instance created by the ``Registry``. Here is one example of how to use Python to run the ``Smoothing`` application, changing the algorithm at each iteration. @@ -372,7 +371,7 @@ The processing toolbox OTB applications are available from QGIS. Use them from the processing toolbox, which is accessible with Processing :math:`\rightarrow` -Toolbox. Switch to “advanced interface†in the bottom of the application +ToolBox. Switch to “advanced interface†in the bottom of the application widget and OTB applications will be there. .. figure:: Art/QtImages/qgis-otb.png @@ -492,7 +491,7 @@ Here is an example of MPI call on a cluster:: ------------ END JOB INFO 1043196.tu-adm01 --------- One can see that the registration and pan-sharpening of the -panchromatic and multi-spectral bands of a Pleiades image has bee split +panchromatic and multi-spectral bands of a Pleiades image has been split among 560 cpus and took only 56 seconds. Note that this MPI parallel invocation of applications is only diff --git a/Documentation/Cookbook/rst/Recipes.rst b/Documentation/Cookbook/rst/Recipes.rst index 6550a09b2623d76c4f334f0d69bf01ee9ae81ac6..fa9478d5abf7698b4abbdcf806d625a0ab220cba 100644 --- a/Documentation/Cookbook/rst/Recipes.rst +++ b/Documentation/Cookbook/rst/Recipes.rst @@ -1,11 +1,10 @@ Recipes ======= -This chapter presents guideline to perform various remote sensing and +This chapter presents guidelines to perform various remote sensing and image processing tasks with either , or both. Its goal is not to be -exhaustive, but rather to help the non-developer user to get familiar -with these two packages, so that he can use and explore them for his -future needs. +exhaustive, but rather to familiarise users with the OTB package functionality +and demonstrate how the can be applied. .. toctree:: :maxdepth: 6 diff --git a/Documentation/Cookbook/rst/recipes/featextract.rst b/Documentation/Cookbook/rst/recipes/featextract.rst index 3d5e1af59d23df22aff23be8ce7d3d67f5727252..4bf18f042a688a55d7bf16ec4a99e66a18404a45 100644 --- a/Documentation/Cookbook/rst/recipes/featextract.rst +++ b/Documentation/Cookbook/rst/recipes/featextract.rst @@ -139,8 +139,8 @@ relevant channels in brackets are: Soil:BI - Brightness index (Red, Green) Soil:BI2 - Brightness index 2 (NIR, Red, Green) -The application can be used like this, which leads to an output image -with 3 bands, respectively with the Vegetation:NDVI, Vegetation:RVI and +The application can be used as follows, which would produce an output image +containing 3 bands, respectively with the Vegetation:NDVI, Vegetation:RVI and Vegetation:IPVI radiometric indices in this exact order: :: @@ -153,8 +153,8 @@ Vegetation:IPVI radiometric indices in this exact order: -list Vegetation:NDVI Vegetation:RVI Vegetation:IPVI -or like this, which leads to a single band output image with the -Water:NDWI2 radiometric indice: +or as follows, which would produce a single band output image with the +Water:NDWI2 radiometric index: :: diff --git a/Documentation/Cookbook/rst/recipes/optpreproc.rst b/Documentation/Cookbook/rst/recipes/optpreproc.rst index b6b1f2ba2d09713bf1f1541a58f9b663cd15686a..013152ad9282ab62b163555ee0fe34ae0ac232f5 100644 --- a/Documentation/Cookbook/rst/recipes/optpreproc.rst +++ b/Documentation/Cookbook/rst/recipes/optpreproc.rst @@ -2,14 +2,14 @@ From raw image to calibrated product ==================================== This section presents various pre-processing tasks that are presented in -a classical order to obtain a calibrated, pan-sharpened image. +a standard order to obtain a calibrated, pan-sharpened image. Optical radiometric calibration ------------------------------- -In remote sensing imagery, pixel values are called DN (for Digital -Numbers) and can not be physically interpreted and compared: they are -influenced by various factors such as the amount of light flowing trough +In remote sensing imagery, pixel values are referred to as Digital +Numbers (DN) and they cannot be physically interpreted or compared. They are +influenced by various factors such as the amount of light flowing through the sensor, the gain of the detectors and the analogic to numeric converter. @@ -87,14 +87,14 @@ Pan-sharpening Because of physical constrains on the sensor design, it is difficult to achieve high spatial and spectral resolution at the same time: a better -spatial resolution means a smaller detector, which in turns means lesser +spatial resolution means a smaller detector, which in turn means lesser optical flow on the detector surface. On the contrary, spectral bands are obtained through filters applied on the detector surface, that lowers the optical flow, so that it is necessary to increase the detector size to achieve an acceptable signal to noise ratio. For these reasons, many high resolution satellite payload are composed -of two sets of detectors, which in turns delivers two different kind of +of two sets of detectors, which in turn delivers two different kind of images: - The multi-spectral (XS) image, composed of 3 to 8 spectral bands @@ -194,7 +194,7 @@ Figure 5: Pan-sharpened image using Orfeo ToolBox. Please also note that since registration and zooming of the multi-spectral image with the panchromatic image relies on sensor modelling, this tool will work only for images whose sensor models is -available in **Orfeo Toolbox** (see :ref:`section3` for a detailed +available in **Orfeo ToolBox** (see :ref:`section3` for a detailed list). It will also work with ortho-ready products in cartographic projection. @@ -207,37 +207,37 @@ A Digital Elevation Model (DEM) is a georeferenced image (or collection of images) where each pixel corresponds to a local elevation. DEM are useful for tasks involving sensor to ground and ground to sensor coordinate transforms, like during ortho-rectification (see :ref:`section3`). These transforms need to find the intersection -between the line of sight of the sensor and the earth geoid. If a simple -spheroid is used as the earth model, potentially high localisation +between the line of sight of the sensor and the Earth geoid. If a simple +spheroid is used as the Earth model, potentially high localisation errors can be made in areas where elevation is high or perturbed. Of course, DEM accuracy and resolution have a great impact on the precision -of these transforms. +of these transformations. Two main available DEM, free of charges, and with worldwide cover, are both delivered as 1 degree by 1 degree tiles: - `The Shuttle Radar topographic Mission - (SRTM) <http://www2.jpl.nasa.gov/srtm/>`_ is a 90 meters resolution - DEM, obtained by radar interferometry during a campaign of the + (SRTM) <http://www2.jpl.nasa.gov/srtm/>`_ is a DEM with a resolution of 90 metres, + obtained by radar interferometry during a campaign of the Endeavour space shuttle from NASA in 2000. - The `Advanced Spaceborne Thermal Emission and Reflection Radiometer - (ASTER) <http://www.ersdac.or.jp/GDEM/E/2.html>`_ is a 30 meters - resolution DEM obtained by stereoscopic processing of the archive of + (ASTER) <http://www.ersdac.or.jp/GDEM/E/2.html>`_ is a DEM with a resolution of + 30 metres obtained by stereoscopic processing of the archive of the ASTER instrument. -The **Orfeo Toolbox** relies on `OSSIM <http://www.ossim.org/>`_ +The **Orfeo ToolBox** relies on `OSSIM <http://www.ossim.org/>`_ capabilities for sensor modelling and DEM handling. Tiles of a given DEM are supposed to be located within a single directory. General elevation support is also supported from GeoTIFF files. Whenever an application or **Monteverdi** module requires a DEM, the option **elev.dem** allows set the DEM directory. This directory must -contains the DEM tiles, either in DTED or SRTM format, either as GeoTIFF -files. Subdirectories are not supported. +contain the DEM tiles, either in DTED or SRTM format or as a GeoTIFF. +Subdirectories are not supported. Depending on the reference of the elevation, you also need to use a -geoid to manage elevation accurately. For this, you need to specify a +geoid to accurately manage the elevation. For this, you need to specify a path to a file which contains the geoid. `Geoid <http://en.wikipedia.org/wiki/Geoid>`_ corresponds to the equipotential surface that would coincide with the mean ocean surface of the Earth. @@ -290,7 +290,7 @@ Ortho-rectification can be performed either with **OTB Applications** or **Monteverdi** . Sensor parameters and image meta-data are seamlessly read from the image files without needing any user interaction, provided that all auxiliary files are available. The sensor for which **Orfeo -Toolbox** supports ortho-rectification of raw products are the +ToolBox** supports ortho-rectification of raw products are the following: - Pleiades @@ -306,7 +306,7 @@ following: - WorldView In addition, GeoTiff and other file format with geographical information -are seamlessly read by **Orfeo Toolbox** , and the ortho-rectification +are seamlessly read by **Orfeo ToolBox** , and the ortho-rectification tools can be used to re-sample these images in another map projection. Beware of “ortho-ready†products @@ -331,7 +331,7 @@ it. Obviously, this map projection is not as accurate as the sensor parameters of the raw geometry. In addition, the impact of the elevation model can’t be observed if the map projection is used. In order to perform an ortho-rectification on this type of product, the map -projection has to be hidden from **Orfeo Toolbox** . +projection has to be hidden from **Orfeo ToolBox** . You can see if a product is an “ortho-ready†product by using ``gdalinfo`` or OTB ReadImageInfo application. @@ -343,7 +343,7 @@ Check if your product verifies following two conditions: - The product has a map projection: you should see a projection name with physical origin and spacing. -In that case, you can hide the map projection from the **Orfeo Toolbox** +In that case, you can hide the map projection from the **Orfeo ToolBox** by using *extended* filenames. Instead of using the plain input image path, you append a specific key at the end: diff --git a/Documentation/Cookbook/rst/recipes/pbclassif.rst b/Documentation/Cookbook/rst/recipes/pbclassif.rst index 320e3e4796e3429d43d74820c70b8b63b04b7b92..d82ef45724aca938be69b9733988489476f68982 100644 --- a/Documentation/Cookbook/rst/recipes/pbclassif.rst +++ b/Documentation/Cookbook/rst/recipes/pbclassif.rst @@ -33,7 +33,7 @@ model algorithm to train. You have the possibility to do the unsupervised classification,for it, you must to choose the Shark kmeans classifier. Please refer to the ``TrainVectorClassifier`` application reference documentation. -In case of multiple samples files, you can add them to the ``-io.vd`` +In case of multiple sample files, you can add them to the ``-io.vd`` parameter. The feature to be used for training must be explicitly listed using @@ -49,14 +49,14 @@ can be set using the ``-cfield`` option. By default, the application will estimate the trained classifier performances on the same set of samples that has been used for -training. The ``-io.vd`` parameter allows to specify a different -samples file for this purpose, for a more fair estimation of the -performances. Note that this performances estimation scheme can also -be estimated afterward (see `Validating the classification model`_ +training. The ``-io.vd`` parameter allows for the specification of different +sample files for this purpose, for a more fair estimation of the +performances. Note that this scheme to estimate the performance can also +be carried out afterwards (see `Validating the classification model`_ section). -Features classification +Feature classification ~~~~~~~~~~~~~~~~~~~~~~~ Once the classifier has been trained, one can apply the model to @@ -71,8 +71,8 @@ classify a set of features on a new vector data file using the -cfield predicted -out classifiedData.shp -This application output a vector data file storing sample values -and classification label. The output is optional, in this case the +This application outputs a vector data file storing sample values +and classification labels. The output is optional, in this case the input vector data classification label field is updated. Validating classification @@ -83,7 +83,7 @@ or *TrainImagesClassifier* applications is directly estimated by the application itself, which displays the precision, recall and F-score of each class, and can generate the global confusion matrix for supervised algorithms. For unsupervised algorithms a contingency table -is generated. Those results are output as an \*.CSV file. +is generated. These results are output as an \*.CSV file. Pixel based classification -------------------------- @@ -173,13 +173,13 @@ The output XML file will look like this:: -Samples selection +Sample selection ~~~~~~~~~~~~~~~~~ Now, we know exactly how many samples are available in the image for -each class and each geometry in the training set. From this +each class and each geometry in the training set. From these statistics, we can now compute the sampling rates to apply for each -classes, and perform the sample selection. This will be done by the +class, and perform the sample selection. This will be done by the ``SampleSelection`` application. There are several strategies to compute those sampling rates: @@ -192,27 +192,27 @@ There are several strategies to compute those sampling rates: * **Percent strategy:** Each class will be sampled with a user-defined percentage (same value for all classes) of samples available in this class. -* **Total strategy:** A global number of samples to generate is - divided proportionally among each class (classes proportions are +* **Total strategy:** A global number of samples to select is + divided proportionally among each class (class proportions are enforced). -* **Take all strategy:** Take all the available samples +* **Take all strategy:** Take all the available samples. * **By class strategy:** Set a target number of samples for each class. The number of samples for each class is read from a CSV file. To actually select the sample positions, there are two available -sampler: +sampling techniques: * **Random:** Randomly select samples while respecting the sampling - rate -* **Periodic:** Sample periodically using the sampling rate + rate. +* **Periodic:** Sample periodically using the sampling rate. The application will make sure that samples spans the whole training set extent by adjusting the sampling rate. Depending on the strategy to determine the sampling rate, some geometries of the training set -might not be sampled. +may not be sampled. The application will accept as input the input image and training -geometries, as well class statistics XML file computed during previous +geometries, as well class statistics XML file computed during the previous step. It will output a vector file containing point geometries which indicate the location of the samples. @@ -227,7 +227,7 @@ indicate the location of the samples. -out samples.sqlite The csv file written by the optional ``-outrates`` parameter sums-up what -has been done during samples selection:: +has been done during sample selection:: #className requiredSamples totalSamples rate 11 941 56774 0.0165745 @@ -253,8 +253,8 @@ has been done during samples selection:: Samples extraction ~~~~~~~~~~~~~~~~~~ -Now that we selected the location of the samples, we will attach -measurement to them. This is the purpose of the ``SampleExtraction`` +Now that the locations of the samples are selected, we will attach +measurements to them. This is the purpose of the ``SampleExtraction`` application. It will walk through the list of samples and extract the underlying pixel values. If no ``-out`` parameter is given, the ``SampleExtraction`` application can work in update mode, thus allowing @@ -286,8 +286,7 @@ Working with several images If the training set spans several images, the ``MultiImageSamplingRate`` application allows to compute the appropriate sampling rates per image -and per class, in order to get samples that spans the whole images -coverage. +and per class, in order to get samples that span the entire extents of the images. It is first required to run the ``PolygonClassStatistics`` application on each image of the set separately. The ``MultiImageSamplingRate`` diff --git a/Documentation/Cookbook/rst/recipes/residual_registration.rst b/Documentation/Cookbook/rst/recipes/residual_registration.rst index 5bae14b3d6b46e1a295a36d1338448abff80a41f..d01cb0734b615db35257263a17a50e82271ae13e 100644 --- a/Documentation/Cookbook/rst/recipes/residual_registration.rst +++ b/Documentation/Cookbook/rst/recipes/residual_registration.rst @@ -173,7 +173,7 @@ Orthorecrtify image using the affine geometry Now we will show how we can use this new sensor model. In our case we’ll use this sensor model to orthorectify the image over the Pléiades -reference. **Orfeo Toolbox** offers since version 3.16 the possibility +reference. **Orfeo ToolBox** offers since version 3.16 the possibility to use hrefhttp://wiki.orfeo-toolbox.org/index.php/ExtendedFileNameextend image path to use different metadata file as input. That’s what we are going diff --git a/Documentation/Cookbook/rst/recipes/sarprocessing.rst b/Documentation/Cookbook/rst/recipes/sarprocessing.rst index f61bbb4a90e32e0c00ae732d9b2e7cca4fb347b4..9d74c1bbc7b364f5c62d36e0c824de85b94ba528 100644 --- a/Documentation/Cookbook/rst/recipes/sarprocessing.rst +++ b/Documentation/Cookbook/rst/recipes/sarprocessing.rst @@ -20,7 +20,7 @@ If SARimg.tif is a TerraSAR-X or a COSMO-SkyMed image: otbcli_SarRadiometricCalibration -in SARimg.tif -out SARimg-calibrated.tif -If SARimg.tif is a RadarSat2 or a Sentinel1 image, it ’s possible to +If SARimg.tif is a RadarSat2 or a Sentinel1 image, it is possible to specify the look-up table (automatically found in the metadata provided with such image): diff --git a/Documentation/Cookbook/rst/recipes/stereo.rst b/Documentation/Cookbook/rst/recipes/stereo.rst index 2c868a753698214beaec22e8a1836b381647f890..c25b3f74a880296bf8053cdd1737fbfa2b8f412b 100644 --- a/Documentation/Cookbook/rst/recipes/stereo.rst +++ b/Documentation/Cookbook/rst/recipes/stereo.rst @@ -194,7 +194,7 @@ can be directly linked to the local elevation An almost complete spectrum of `stereo correspondence algorithms <http://vision.middlebury.edu/stereo/eval3/>`_ has been published and it is still augmented at a significant rate! -The **Orfeo Toolbox** implements different local strategies for block +The **Orfeo ToolBox** implements different local strategies for block matching: - Sum of Square Distances block-matching (SSD) diff --git a/Documentation/SoftwareGuide/Latex/ContributorList.tex b/Documentation/SoftwareGuide/Latex/ContributorList.tex index 347a2bd7cfc0ccb656576f3f6e6abf27a78ac74b..8f34a6e134c565737bfa4edc4313219968fb53b2 100644 --- a/Documentation/SoftwareGuide/Latex/ContributorList.tex +++ b/Documentation/SoftwareGuide/Latex/ContributorList.tex @@ -13,6 +13,7 @@ Christophe Lay, Christophe Palmann (CS), Conrad Bielski (JRC), Cyrille Valladeau (CS), +Daniel McInerney, David Dubois, David Youssefi (CNES Intern, then CS), Edouard Barthelet (Telecom Bretagne and Thales Communications), diff --git a/Examples/Radiometry/AtmosphericCorrectionSequencement.cxx b/Examples/Radiometry/AtmosphericCorrectionSequencement.cxx index a0656056d40be1dea298da8fd4ed14f5b72e7405..9fa1862ed227a563c131ae46d90d981cfe5424c9 100644 --- a/Examples/Radiometry/AtmosphericCorrectionSequencement.cxx +++ b/Examples/Radiometry/AtmosphericCorrectionSequencement.cxx @@ -38,8 +38,8 @@ // an optical multispectral image similar to Pleiades. // These corrections are made in four steps : // \begin{itemize} -// \item digital number to luminance correction; -// \item luminance to refletance image conversion; +// \item digital number to radiance correction; +// \item radiance to refletance image conversion; // \item atmospheric correction for TOA (top of atmosphere) to TOC (top of canopy) // reflectance estimation; // \item correction of the adjacency effects taking into account the neighborhood contribution. @@ -61,15 +61,15 @@ // Let's look at the minimal code required to use this // algorithm. First, the following header defining the // \doxygen{otb}{AtmosphericCorrectionSequencement} class must be -// included. For the numerical to luminance image, luminance to +// included. For the numerical to radiance image, radiance to // refletance image, and reflectance to atmospheric correction image // corrections and the neighborhood correction, four header files are // required. // Software Guide : EndLatex // Software Guide : BeginCodeSnippet -#include "otbImageToLuminanceImageFilter.h" -#include "otbLuminanceToReflectanceImageFilter.h" +#include "otbImageToRadianceImageFilter.h" +#include "otbRadianceToReflectanceImageFilter.h" #include "otbReflectanceToSurfaceReflectanceImageFilter.h" #include "otbSurfaceAdjacencyEffectCorrectionSchemeFilter.h" // Software Guide : EndCodeSnippet @@ -178,7 +178,7 @@ int main(int argc, char *argv[]) //------------------------------- // Software Guide : BeginLatex // - // The \doxygen{otb}{ImageToLuminanceImageFilter} + // The \doxygen{otb}{ImageToRadianceImageFilter} // type is defined and instancied. This class uses a functor applied // to each component of each pixel ($\mathbf{X^{k}}$) whose formula is: // @@ -188,7 +188,7 @@ int main(int argc, char *argv[]) // // Where : // \begin{itemize} - // \item $\mathbf{L_{TOA}^{k}}$ is the incident luminance (in + // \item $\mathbf{L_{TOA}^{k}}$ is the incident radiance (in // $W.m^{-2}.sr^{-1}.\mu m^{-1}$); // \item $\mathbf{X^{k}}$ is the measured digital number (ie. the input image pixel component); // \item $\alpha_{k}$ is the absolute calibration gain for the channel k; @@ -198,13 +198,13 @@ int main(int argc, char *argv[]) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - typedef otb::ImageToLuminanceImageFilter<ImageType, ImageType> - ImageToLuminanceImageFilterType; + typedef otb::ImageToRadianceImageFilter<ImageType, ImageType> + ImageToRadianceImageFilterType; - ImageToLuminanceImageFilterType::Pointer filterImageToLuminance - = ImageToLuminanceImageFilterType::New(); + ImageToRadianceImageFilterType::Pointer filterImageToRadiance + = ImageToRadianceImageFilterType::New(); // Software Guide : EndCodeSnippet - typedef ImageToLuminanceImageFilterType::VectorType VectorType; + typedef ImageToRadianceImageFilterType::VectorType VectorType; VectorType alpha(nbOfComponent); VectorType beta(nbOfComponent); alpha.Fill(0); @@ -227,17 +227,17 @@ int main(int argc, char *argv[]) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - filterImageToLuminance->SetAlpha(alpha); - filterImageToLuminance->SetBeta(beta); + filterImageToRadiance->SetAlpha(alpha); + filterImageToRadiance->SetBeta(beta); // Software Guide : EndCodeSnippet //------------------------------- // Software Guide : BeginLatex // - // The \doxygen{otb}{LuminanceToReflectanceImageFilter} + // The \doxygen{otb}{RadianceToReflectanceImageFilter} // type is defined and instancied. // This class used a functor applied to each component of each pixel - // of the luminance filter output ($\mathbf{L_{TOA}^{k}}$): + // of the radiance filter output ($\mathbf{L_{TOA}^{k}}$): // // \begin{equation} // \rho_{TOA}^{k} = \frac{ \pi.\mathbf{L_{TOA}^{k}} } { E_{S}^{k}.cos(\theta_{S}).d/d_{0} }. @@ -259,13 +259,13 @@ int main(int argc, char *argv[]) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - typedef otb::LuminanceToReflectanceImageFilter<ImageType, ImageType> - LuminanceToReflectanceImageFilterType; - LuminanceToReflectanceImageFilterType::Pointer filterLuminanceToReflectance - = LuminanceToReflectanceImageFilterType::New(); + typedef otb::RadianceToReflectanceImageFilter<ImageType, ImageType> + RadianceToReflectanceImageFilterType; + RadianceToReflectanceImageFilterType::Pointer filterRadianceToReflectance + = RadianceToReflectanceImageFilterType::New(); // Software Guide : EndCodeSnippet - typedef LuminanceToReflectanceImageFilterType::VectorType VectorType; + typedef RadianceToReflectanceImageFilterType::VectorType VectorType; VectorType solarIllumination(nbOfComponent); solarIllumination.Fill(0); @@ -287,11 +287,11 @@ int main(int argc, char *argv[]) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - filterLuminanceToReflectance->SetZenithalSolarAngle( + filterRadianceToReflectance->SetZenithalSolarAngle( static_cast<double>(atof(argv[6]))); - filterLuminanceToReflectance->SetDay(atoi(argv[7])); - filterLuminanceToReflectance->SetMonth(atoi(argv[8])); - filterLuminanceToReflectance->SetSolarIllumination(solarIllumination); + filterRadianceToReflectance->SetDay(atoi(argv[7])); + filterRadianceToReflectance->SetMonth(atoi(argv[8])); + filterRadianceToReflectance->SetSolarIllumination(solarIllumination); // Software Guide : EndCodeSnippet //------------------------------- @@ -635,10 +635,10 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet writer->SetFileName(argv[2]); - filterImageToLuminance->SetInput(reader->GetOutput()); - filterLuminanceToReflectance->SetInput(filterImageToLuminance->GetOutput()); + filterImageToRadiance->SetInput(reader->GetOutput()); + filterRadianceToReflectance->SetInput(filterImageToRadiance->GetOutput()); filterReflectanceToSurfaceReflectanceImageFilter->SetInput( - filterLuminanceToReflectance->GetOutput()); + filterRadianceToReflectance->GetOutput()); filterSurfaceAdjacencyEffectCorrectionSchemeFilter->SetInput( filterReflectanceToSurfaceReflectanceImageFilter->GetOutput()); diff --git a/Examples/Radiometry/test/CMakeLists.txt b/Examples/Radiometry/test/CMakeLists.txt index 67e6f396bbf2c1eb68104d7ab70717ade2a4f4da..43c5edcffc2988d6bb2a30135536085e731f78c8 100644 --- a/Examples/Radiometry/test/CMakeLists.txt +++ b/Examples/Radiometry/test/CMakeLists.txt @@ -84,8 +84,8 @@ otb_add_test(NAME raTeAtmosphericCorrectionSequencementTest COMMAND ${OTB_TEST_D ${INPUTDATA}/atmosphericCorrectionSequencement_solar_illumination.txt ${INPUTDATA}/atmosphericCorrectionSequencement_wavelength_spectral_bands_spot4_1.txt - # ImageToLuminance parameters - # LuminanceToReflectance parameters + # ImageToRadiance parameters + # RadianceToReflectance parameters 27.3 #solar azimuthal elevation 4 #day 12 #month diff --git a/Modules/Applications/AppClassification/app/otbComputeOGRLayersFeaturesStatistics.cxx b/Modules/Applications/AppClassification/app/otbComputeOGRLayersFeaturesStatistics.cxx index c9afc715e9f28a85260245a65d0a354bdcc26264..5f108a9a13e1ee408449082bb89f980b00761c94 100644 --- a/Modules/Applications/AppClassification/app/otbComputeOGRLayersFeaturesStatistics.cxx +++ b/Modules/Applications/AppClassification/app/otbComputeOGRLayersFeaturesStatistics.cxx @@ -94,12 +94,23 @@ private: otb::ogr::Feature feature = layer.ogr().GetNextFeature(); ClearChoices("feat"); + + std::vector<std::string> choiceKeys; + for(int iField=0; iField<feature.ogr().GetFieldCount(); iField++) { std::string key, item = feature.ogr().GetFieldDefnRef(iField)->GetNameRef(); key = item; - key.erase(std::remove(key.begin(), key.end(), ' '), key.end()); + + // Transform chain : lowercase and alphanumerical + key.erase(std::remove_if(key.begin(), key.end(), std::not1(std::ptr_fun(::isalnum))), key.end()); std::transform(key.begin(), key.end(), key.begin(), tolower); + + // Key must be unique + choiceKeys = GetChoiceKeys("feat"); + while(choiceKeys.end() != std::find(choiceKeys.begin(), choiceKeys.end(), key) ) + key.append("0"); + key="feat."+key; AddChoice(key,item); } diff --git a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx index 971c79a427a44e1064f75c194e2630ebfa73affb..eb58a7e0ac4371d6c0fa4830f457bf36c11d426f 100644 --- a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx @@ -113,12 +113,22 @@ private: otb::ogr::Feature feature = layer.ogr().GetNextFeature(); ClearChoices("feat"); + std::vector<std::string> choiceKeys; + for(int iField=0; iField<feature.ogr().GetFieldCount(); iField++) { std::string key, item = feature.ogr().GetFieldDefnRef(iField)->GetNameRef(); key = item; - key.erase(std::remove(key.begin(), key.end(), ' '), key.end()); + + // Transform chain : lowercase and alphanumerical + key.erase(std::remove_if(key.begin(), key.end(), std::not1(std::ptr_fun(::isalnum))), key.end()); std::transform(key.begin(), key.end(), key.begin(), tolower); + + // Key must be unique + choiceKeys = GetChoiceKeys("feat"); + while(choiceKeys.end() != std::find(choiceKeys.begin(), choiceKeys.end(), key) ) + key.append("0"); + key="feat."+key; AddChoice(key,item); } diff --git a/Modules/Applications/AppImageUtils/app/otbConvert.cxx b/Modules/Applications/AppImageUtils/app/otbConvert.cxx index 8298c8877aa3355a71df8138f65413b2ee976bab..4c50e1a2e7b17488d7fc9f8885e762e623c7d46f 100644 --- a/Modules/Applications/AppImageUtils/app/otbConvert.cxx +++ b/Modules/Applications/AppImageUtils/app/otbConvert.cxx @@ -21,17 +21,16 @@ #include "otbWrapperApplication.h" #include "otbWrapperApplicationFactory.h" -#include "itkCastImageFilter.h" - - #include "otbVectorRescaleIntensityImageFilter.h" -#include "itkCastImageFilter.h" #include "otbUnaryImageFunctorWithVectorImageFilter.h" #include "otbStreamingShrinkImageFilter.h" #include "itkListSample.h" #include "otbListSampleToHistogramListGenerator.h" #include "itkImageRegionConstIterator.h" +#include "otbImageListToVectorImageFilter.h" +#include "otbMultiToMonoChannelExtractROI.h" +#include "otbImageList.h" namespace otb { @@ -71,13 +70,19 @@ public: /** Filters typedef */ typedef itk::Statistics::ListSample<FloatVectorImageType::PixelType> ListSampleType; typedef itk::Statistics::DenseFrequencyContainer2 DFContainerType; - typedef ListSampleToHistogramListGenerator<ListSampleType, FloatVectorImageType::InternalPixelType, DFContainerType> HistogramsGeneratorType; - typedef StreamingShrinkImageFilter<FloatVectorImageType, FloatVectorImageType> ShrinkFilterType; + typedef ListSampleToHistogramListGenerator<ListSampleType, + FloatVectorImageType::InternalPixelType, + DFContainerType> HistogramsGeneratorType; + typedef StreamingShrinkImageFilter<FloatVectorImageType, + FloatVectorImageType> ShrinkFilterType; typedef Functor::LogFunctor<FloatVectorImageType::InternalPixelType> TransferLogFunctor; - typedef UnaryImageFunctorWithVectorImageFilter<FloatVectorImageType, FloatVectorImageType, TransferLogFunctor> TransferLogType; + typedef UnaryImageFunctorWithVectorImageFilter<FloatVectorImageType, + FloatVectorImageType, + TransferLogFunctor> TransferLogType; private: + void DoInit() ITK_OVERRIDE { SetName("Convert"); @@ -85,16 +90,26 @@ private: " and/or changing the pixel type."); // Documentation SetDocName("Image Conversion"); - SetDocLongDescription("This application performs an image pixel type conversion (short, ushort, uchar, int, uint, float and double types are handled). The output image is written in the specified format (ie. that corresponds to the given extension).\n The conversion can include a rescale using the image 2 percent minimum and maximum values. The rescale can be linear or log2."); + SetDocLongDescription("This application performs an image pixel type conversion " + "(short, ushort, uchar, int, uint, float and double types are handled). " + "The output image is written in the specified format (ie. that corresponds " + "to the given extension).\n The conversion can include a rescale of the data range, " + "by default it's set from 2% to 98% of the data values. The rescale can be linear or log2. \n " + "The choice of the output channels can be done with the extended filename, " + "but less easy to handle. To do this, a 'channels' parameter allows you to select " + "the desired bands at the output. There are 3 modes, the available choices are: \n" + " * grayscale : to display mono image as standard color image \n" + " * rgb : select 3 bands in the input image (multi-bands) \n" + " * all : keep all bands."); SetDocLimitations("None"); SetDocAuthors("OTB-Team"); SetDocSeeAlso("Rescale"); - AddDocTag(Tags::Manip); + AddDocTag(Tags::Manip); AddDocTag("Conversion"); AddDocTag("Image Dynamic"); - AddParameter(ParameterType_InputImage, "in", "Input image"); + AddParameter(ParameterType_InputImage, "in", "Input image"); SetParameterDescription("in", "Input image"); AddParameter(ParameterType_Choice, "type", "Rescale type"); @@ -110,7 +125,8 @@ private: MandatoryOff("type.linear.gamma"); AddParameter(ParameterType_InputImage, "mask", "Input mask"); - SetParameterDescription("mask", "The masked pixels won't be used to adapt the dynamic (the mask must have the same dimensions as the input image)"); + SetParameterDescription("mask", "The masked pixels won't be used to adapt the dynamic " + "(the mask must have the same dimensions as the input image)"); MandatoryOff("mask"); DisableParameter("mask"); @@ -118,40 +134,90 @@ private: SetParameterDescription("hcp","Parameters to cut the histogram edges before rescaling"); AddParameter(ParameterType_Float, "hcp.high", "High Cut Quantile"); - SetParameterDescription("hcp.high", "Quantiles to cut from histogram high values before computing min/max rescaling (in percent, 2 by default)"); + SetParameterDescription("hcp.high", "Quantiles to cut from histogram high values " + "before computing min/max rescaling (in percent, 2 by default)"); MandatoryOff("hcp.high"); SetDefaultParameterFloat("hcp.high", 2.0); DisableParameter("hcp.high"); AddParameter(ParameterType_Float, "hcp.low", "Low Cut Quantile"); - SetParameterDescription("hcp.low", "Quantiles to cut from histogram low values before computing min/max rescaling (in percent, 2 by default)"); + SetParameterDescription("hcp.low", "Quantiles to cut from histogram low values " + "before computing min/max rescaling (in percent, 2 by default)"); MandatoryOff("hcp.low"); SetDefaultParameterFloat("hcp.low", 2.0); DisableParameter("hcp.low"); AddParameter(ParameterType_OutputImage, "out", "Output Image"); SetParameterDescription("out", "Output image"); + SetDefaultOutputPixelType("out",ImagePixelType_uint8); + + AddParameter(ParameterType_Choice, "channels", "Channels selection"); + SetParameterDescription("channels", "It's possible to select the channels " + "of the output image. There are 3 modes, the available choices are:"); + + AddChoice("channels.all", "Default mode"); + SetParameterDescription("channels.all", "Select all bands in the input image, (1,...,n)."); + + AddChoice("channels.grayscale", "Grayscale mode"); + SetParameterDescription("channels.grayscale", "Display single channel as standard color image."); + AddParameter(ParameterType_Int, "channels.grayscale.channel", "Grayscale channel"); + SetDefaultParameterInt("channels.grayscale.channel", 1); + SetMinimumParameterIntValue("channels.grayscale.channel", 1); + + AddChoice("channels.rgb", "RGB composition"); + SetParameterDescription("channels.rgb", "Select 3 bands in the input image " + "(multi-bands), by default (1,2,3)."); + + AddParameter(ParameterType_Int, "channels.rgb.red", "Red Channel"); + SetParameterDescription("channels.rgb.red", "Red channel index."); + SetMinimumParameterIntValue("channels.rgb.red", 1); + AddParameter(ParameterType_Int, "channels.rgb.green", "Green Channel"); + SetParameterDescription("channels.rgb.green", "Green channel index."); + SetMinimumParameterIntValue("channels.rgb.green", 1); + AddParameter(ParameterType_Int, "channels.rgb.blue", "Blue Channel"); + SetParameterDescription("channels.rgb.blue", "Blue channel index."); + SetMinimumParameterIntValue("channels.rgb.blue", 1); AddRAMParameter(); // Doc example parameter settings SetDocExampleParameterValue("in", "QB_Toulouse_Ortho_XS.tif"); - SetDocExampleParameterValue("out", "otbConvertWithScalingOutput.png uint8"); + SetDocExampleParameterValue("out", "otbConvertWithScalingOutput.png"); SetDocExampleParameterValue("type", "linear"); + SetDocExampleParameterValue("channels", "rgb"); SetOfficialDocLink(); } void DoUpdateParameters() ITK_OVERRIDE { - // Nothing to do here for the parameters : all are independent + // Read information + typedef otb::ImageMetadataInterfaceBase ImageMetadataInterfaceType; + ImageMetadataInterfaceType::Pointer metadataInterface = + ImageMetadataInterfaceFactory::CreateIMI(GetParameterImage("in")->GetMetaDataDictionary()); + + int nbBand = GetParameterImage("in")->GetNumberOfComponentsPerPixel(); + SetMaximumParameterIntValue("channels.grayscale.channel", nbBand); + SetMaximumParameterIntValue("channels.rgb.red", nbBand); + SetMaximumParameterIntValue("channels.rgb.green", nbBand); + SetMaximumParameterIntValue("channels.rgb.blue", nbBand); + + if (nbBand > 1) + { + // get band index : Red/Green/Blue + int bandRed = metadataInterface->GetDefaultDisplay()[0] + 1; + int bandGreen = metadataInterface->GetDefaultDisplay()[1] + 1; + int bandBlue = metadataInterface->GetDefaultDisplay()[2] + 1; + SetDefaultParameterInt("channels.rgb.red", bandRed); + SetDefaultParameterInt("channels.rgb.green", bandGreen); + SetDefaultParameterInt("channels.rgb.blue", bandBlue); + } + } template<class TImageType> void GenericDoExecute() { - typename TImageType::Pointer castIm; - std::string rescaleType = this->GetParameterString("type"); if( (rescaleType != "none") && (rescaleType != "linear") && (rescaleType != "log2") ) @@ -161,21 +227,24 @@ private: if( rescaleType == "none" ) { - castIm = this->GetParameterImage<TImageType>("in"); + // selected channel + typename TImageType::Pointer tempImage; + tempImage = GetSelectedChannels<TImageType>(); + + SetParameterOutputImage<TImageType>("out", tempImage); + } - else + else // linear or log2 { - FloatVectorImageType::Pointer input = this->GetParameterImage("in"); - FloatVectorImageType::Pointer mask; - bool useMask = false; - if (IsParameterEnabled("mask")) - { - mask = this->GetParameterImage("mask"); - useMask = true; - } - const unsigned int nbComp(input->GetNumberOfComponentsPerPixel()); + if (IsParameterEnabled("mask")) mask = this->GetParameterImage("mask"); + + // selected channel + typename FloatVectorImageType::Pointer tempImage; + tempImage = GetSelectedChannels<FloatVectorImageType>(); + + const unsigned int nbComp(tempImage->GetNumberOfComponentsPerPixel()); typedef otb::VectorRescaleIntensityImageFilter<FloatVectorImageType, TImageType> RescalerType; typename TImageType::PixelType minimum; @@ -197,8 +266,9 @@ private: // Shrink factor is computed so as to load a quicklook of 1000 // pixels square at most - typename FloatVectorImageType::SizeType imageSize = input->GetLargestPossibleRegion().GetSize(); - unsigned int shrinkFactor = std::max(imageSize[0], imageSize[1]) < 1000 ? 1 : std::max(imageSize[0], imageSize[1])/1000; + typename FloatVectorImageType::SizeType imageSize = tempImage->GetLargestPossibleRegion().GetSize(); + unsigned int shrinkFactor = + std::max(imageSize[0], imageSize[1]) < 1000 ? 1 : std::max(imageSize[0], imageSize[1])/1000; otbAppLogDEBUG( << "Shrink factor used to compute Min/Max: "<<shrinkFactor ); @@ -212,7 +282,7 @@ private: { //define the transfer log m_TransferLog = TransferLogType::New(); - m_TransferLog->SetInput(input); + m_TransferLog->SetInput(tempImage); m_TransferLog->UpdateOutputInformation(); shrinkFilter->SetInput(m_TransferLog->GetOutput()); @@ -221,37 +291,32 @@ private: } else { - shrinkFilter->SetInput(input); - rescaler->SetInput(input); + shrinkFilter->SetInput(tempImage); + rescaler->SetInput(tempImage); shrinkFilter->Update(); } ShrinkFilterType::Pointer maskShrinkFilter = ShrinkFilterType::New(); - if (useMask) - { - maskShrinkFilter->SetShrinkFactor(shrinkFactor); - maskShrinkFilter->SetInput(mask); - maskShrinkFilter->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram")); - maskShrinkFilter->Update(); - } - - otbAppLogDEBUG( << "Shrink done" ); - otbAppLogDEBUG( << "Evaluating input Min/Max..." ); - itk::ImageRegionConstIterator<FloatVectorImageType> it(shrinkFilter->GetOutput(), shrinkFilter->GetOutput()->GetLargestPossibleRegion()); + itk::ImageRegionConstIterator<FloatVectorImageType> + it(shrinkFilter->GetOutput(), shrinkFilter->GetOutput()->GetLargestPossibleRegion()); itk::ImageRegionConstIterator<FloatVectorImageType> itMask; - if (useMask) - { - itMask = itk::ImageRegionConstIterator<FloatVectorImageType>(maskShrinkFilter->GetOutput(),maskShrinkFilter->GetOutput()->GetLargestPossibleRegion()); - } typename ListSampleType::Pointer listSample = ListSampleType::New(); - listSample->SetMeasurementVectorSize(input->GetNumberOfComponentsPerPixel()); + listSample->SetMeasurementVectorSize(tempImage->GetNumberOfComponentsPerPixel()); // Now we generate the list of samples - if (useMask) + if (IsParameterEnabled("mask")) { + maskShrinkFilter->SetShrinkFactor(shrinkFactor); + maskShrinkFilter->SetInput(mask); + maskShrinkFilter->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram")); + maskShrinkFilter->Update(); + + itMask = itk::ImageRegionConstIterator<FloatVectorImageType>( + maskShrinkFilter->GetOutput(),maskShrinkFilter->GetOutput()->GetLargestPossibleRegion()); + // Remove masked pixels it.GoToBegin(); itMask.GoToBegin(); @@ -265,19 +330,16 @@ private: ++it; ++itMask; } - } - else - { - for(it.GoToBegin(); !it.IsAtEnd(); ++it) + if (listSample->Size() == 0) { - listSample->PushBack(it.Get()); + otbAppLogINFO( << "All pixels were masked, the application assume a wrong mask " + "and include all the image"); } } - // if all pixels were masked, we assume a wrong mask and then include all image - if (listSample->Size() == 0) + // if mask is disable and all pixels were masked + if ((!IsParameterEnabled("mask")) || (listSample->Size() == 0)) { - otbAppLogINFO( << "All pixels were masked, the application assume a wrong mask and include all the image"); for(it.GoToBegin(); !it.IsAtEnd(); ++it) { listSample->PushBack(it.Get()); @@ -294,10 +356,15 @@ private: // And extract the lower and upper quantile typename FloatVectorImageType::PixelType inputMin(nbComp), inputMax(nbComp); + auto histOutput = histogramsGenerator->GetOutput(); + assert(histOutput); + for(unsigned int i = 0; i < nbComp; ++i) { - inputMin[i] = histogramsGenerator->GetOutput()->GetNthElement(i)->Quantile(0, 0.01 * GetParameterFloat("hcp.low")); - inputMax[i] = histogramsGenerator->GetOutput()->GetNthElement(i)->Quantile(0, 1.0 - 0.01 * GetParameterFloat("hcp.high")); + auto && elm = histOutput->GetNthElement(i); + assert(elm); + inputMin[i] = elm->Quantile(0, 0.01 * GetParameterFloat("hcp.low")); + inputMax[i] = elm->Quantile(0, 1.0 - 0.01 * GetParameterFloat("hcp.high")); } otbAppLogDEBUG( << std::setprecision(5) << "Min/Max computation done : min=" << inputMin @@ -313,15 +380,99 @@ private: } m_TmpFilter = rescaler; - castIm = rescaler->GetOutput(); + + SetParameterOutputImage<TImageType>("out", rescaler->GetOutput()); } + } + // Get the bands order + std::vector<int> GetChannels() + { + std::vector<int> channels; + + int nbChan = GetParameterImage("in")->GetNumberOfComponentsPerPixel(); + std::string channelMode = GetParameterString("channels"); - SetParameterOutputImage<TImageType>("out", castIm); + if(channelMode == "grayscale") + { + if (GetParameterInt("channels.grayscale.channel") <= nbChan) + { + channels = {GetParameterInt("channels.grayscale.channel"), + GetParameterInt("channels.grayscale.channel"), + GetParameterInt("channels.grayscale.channel")}; + } + else + { + itkExceptionMacro(<< "The channel has an invalid index"); + } + } + else if (channelMode == "rgb") + { + if ((GetParameterInt("channels.rgb.red") <= nbChan) + && ( GetParameterInt("channels.rgb.green") <= nbChan) + && ( GetParameterInt("channels.rgb.blue") <= nbChan)) + { + channels = {GetParameterInt("channels.rgb.red"), + GetParameterInt("channels.rgb.green"), + GetParameterInt("channels.rgb.blue")}; + } + else + { + itkExceptionMacro(<< "At least one needed channel has an invalid index"); + } + } + else if (channelMode == "all") + { + // take all bands + channels.resize(nbChan); + std::iota(channels.begin(), channels.end(), 1); + } + return channels; + } + + // return an image with the bands order modified of the input image + template<class TImageType> + typename TImageType::Pointer GetSelectedChannels() + { + typedef MultiToMonoChannelExtractROI<FloatVectorImageType::InternalPixelType, + typename TImageType::InternalPixelType> ExtractROIFilterType; + typedef ObjectList<ExtractROIFilterType> ExtractROIFilterListType; + typedef otb::ImageList<otb::Image<typename TImageType::InternalPixelType> > ImageListType; + typedef ImageListToVectorImageFilter<ImageListType, + TImageType > ListConcatenerFilterType; + + typename ImageListType::Pointer imageList; + typename ListConcatenerFilterType::Pointer concatener; + typename ExtractROIFilterListType::Pointer extractorList; + + imageList = ImageListType::New(); + concatener = ListConcatenerFilterType::New(); + extractorList = ExtractROIFilterListType::New(); + + const bool monoChannel = IsParameterEnabled("channels.grayscale"); + + // get band order + std::vector<int> channels = GetChannels(); + + for (auto && channel : channels) + { + typename ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); + extractROIFilter->SetInput(GetParameterImage("in")); + if (!monoChannel) extractROIFilter->SetChannel(channel); + extractROIFilter->UpdateOutputInformation(); + extractorList->PushBack(extractROIFilter); + imageList->PushBack(extractROIFilter->GetOutput()); + } + + concatener->SetInput(imageList); + concatener->UpdateOutputInformation(); + concatener->Update(); + + return concatener->GetOutput(); } - void DoExecute() ITK_OVERRIDE + void DoExecute() ITK_OVERRIDE { switch ( this->GetParameterOutputImagePixelType("out") ) { diff --git a/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx b/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx index 3296b1742877c97e04af6b0035f796461fbea9f4..1bca9241ea384ab9210913f1ca7949e68178142c 100644 --- a/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx +++ b/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx @@ -22,6 +22,7 @@ #include "otbWrapperApplicationFactory.h" #include "otbMultiChannelExtractROI.h" +#include "otbGenericRSTransform.h" namespace otb { @@ -32,14 +33,15 @@ class PixelValue : public Application { public: /** Standard class typedefs. */ - typedef PixelValue Self; + typedef PixelValue Self; typedef Application Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; typedef otb::MultiChannelExtractROI<FloatVectorImageType::InternalPixelType, - FloatVectorImageType::InternalPixelType> ExtractROIFilterType; + FloatVectorImageType::InternalPixelType> ExtractROIFilterType; + typedef otb::GenericRSTransform<> RSTransformType; /** Standard macro */ itkNewMacro(Self); @@ -53,26 +55,53 @@ private: // Documentation SetDocName("Pixel Value"); - SetDocLongDescription("Get the value of a pixel.\nPay attention, index starts at 0."); + SetDocLongDescription("This application gives the value of a selected " + "pixel. There are three ways to designate a pixel, with its index, " + "its physical coordinate (in the physical space attached to the image), " + "and with geographical coordinate system. Coordinates will be " + "interpreted differently depending on which mode is chosen."); SetDocLimitations("None"); SetDocAuthors("OTB-Team"); SetDocSeeAlso(" "); - AddDocTag("Miscellaneous"); + AddDocTag("Miscellaneous"); AddDocTag("Utilities"); AddDocTag("Coordinates"); AddDocTag("Raster"); - AddParameter(ParameterType_InputImage, "in", "Input Image"); - SetParameterDescription("in", "Input image"); - - AddParameter(ParameterType_Int,"coordx","Col index"); - SetParameterDescription("coordx","Column index of the wanted pixel (starts at 0)."); - SetMinimumParameterIntValue("coordx", 0); - - AddParameter(ParameterType_Int,"coordy","Line index"); - SetParameterDescription("coordy","Line index of the wanted pixel (starts at 0)."); - SetMinimumParameterIntValue("coordy", 0); + AddParameter(ParameterType_InputImage , "in", "Input Image"); + SetParameterDescription("in" , "Input image"); + + AddParameter(ParameterType_Float , "coordx" , "X coordinate" ); + SetParameterDescription("coordx" , + "This will be the X coordinate interpreted depending on the " + "chosen mode"); + AddParameter(ParameterType_Float , "coordy" , "Y coordinate" ); + SetParameterDescription("coordy" , + "This will be the Y coordinate interpreted depending on the " + "chosen mode"); + + AddParameter(ParameterType_Choice , "mode" , + "Coordinate system used to designate the pixel"); + SetParameterDescription( "mode" , + "Different modes can be selected, default mode is Index."); + AddChoice( "mode.index" , "Index"); + SetParameterDescription( "mode.index" , + "This mode uses the given coordinates as index to locate the pixel."); + AddChoice( "mode.physical" , "Image physical space"); + SetParameterDescription( "mode.physical" , + "This mode interprets the given coordinates in the image " + "physical space."); + AddChoice( "mode.epsg" , "EPSG coordinates"); + SetParameterDescription( "mode.epsg" , + "This mode interprets the given coordinates in the specified " + "geographical coordinate system by the EPSG code."); + + AddParameter(ParameterType_Int , "mode.epsg.code" , "EPSG code"); + SetParameterDescription("mode.epsg.code" , + "This code is used to define a geographical coordinate system. " + "If no system is specified, WGS84 (EPSG : 4326) is used by default."); + MandatoryOff("mode.epsg.code"); AddParameter(ParameterType_ListView,"cl","Channels"); SetParameterDescription("cl","Displayed channels"); @@ -95,7 +124,7 @@ private: { if ( HasValue("in") ) { - ExtractROIFilterType::InputImageType* inImage = GetParameterImage("in"); + ExtractROIFilterType::InputImageType * inImage = GetParameterImage("in"); // Update the values of the channels to be selected unsigned int nbComponents = inImage->GetNumberOfComponentsPerPixel(); @@ -107,53 +136,163 @@ private: item<<"Channel"<<idx+1; AddChoice(key.str(), item.str()); } - - ExtractROIFilterType::InputImageType::RegionType largestRegion = inImage->GetLargestPossibleRegion(); - SetMaximumParameterIntValue("coordx", largestRegion.GetSize(0)-1); - SetMaximumParameterIntValue("coordy", largestRegion.GetSize(1)-1); } } - void DoExecute() ITK_OVERRIDE + std::string CreateBoundaryBox( const std::string & mode ) { - std::ostringstream ossOutput; FloatVectorImageType::Pointer inImage = GetParameterImage("in"); + FloatVectorImageType::IndexType min , max; + min.Fill(0); + max[0] = inImage->GetLargestPossibleRegion().GetSize()[0] - 1; + max[1] = inImage->GetLargestPossibleRegion().GetSize()[1] - 1; + std::string boundaries[4]; + if (mode == "index") + { + boundaries[0] = std::to_string(max[0]); + boundaries[1] = std::to_string(max[1]); + boundaries[2] = std::to_string(min[0]); + boundaries[3] = std::to_string(min[1]); + } + else if (mode == "physical") + { + itk::Point< float, 2 > minP(0) , maxP(0); + inImage->TransformIndexToPhysicalPoint(min,minP); + inImage->TransformIndexToPhysicalPoint(max,maxP); + boundaries[0] = std::to_string(std::max(minP[0],maxP[0])); + boundaries[1] = std::to_string(std::max(minP[1],maxP[1])); + boundaries[2] = std::to_string(std::min(minP[0],maxP[0])); + boundaries[3] = std::to_string(std::min(minP[1],maxP[1])); + } + else if (mode == "epsg") + { + RSTransformType::Pointer inverse = RSTransformType::New(); + if ( HasUserValue("mode.epsg.code") ) + { + std::string wktFromEpsg = + otb::GeoInformationConversion::ToWKT(GetParameterInt( "mode.epsg.code" )); + inverse->SetOutputProjectionRef(wktFromEpsg); + } + inverse->SetInputKeywordList( inImage->GetImageKeywordlist() ); + inverse->SetInputProjectionRef( inImage->GetProjectionRef() ); + inverse->InstantiateTransform(); + itk::Point< float, 2 > minPOut(0) , maxPOut(0) , minP(0) , maxP(0); + inImage->TransformIndexToPhysicalPoint(min,minP); + inImage->TransformIndexToPhysicalPoint(max,maxP); + minPOut = inverse->TransformPoint( minP ); + maxPOut = inverse->TransformPoint( maxP ); + boundaries[0] = std::to_string(std::max(minPOut[0],maxPOut[0])); + boundaries[1] = std::to_string(std::max(minPOut[1],maxPOut[1])); + boundaries[2] = std::to_string(std::min(minPOut[0],maxPOut[0])); + boundaries[3] = std::to_string(std::min(minPOut[1],maxPOut[1])); + } - ExtractROIFilterType::Pointer extractor = ExtractROIFilterType::New(); - extractor->SetInput(inImage); + for (int i = 0 ; i<4 ; i++) + { + std::size_t coma = boundaries[i].find("."); + if ( coma != std::string::npos ) + { + std::size_t zero = boundaries[i].find_last_not_of("0"); + if ( zero != std::string::npos ) + boundaries[i].erase(zero + 1); + else + boundaries[i] = "0"; + } + } + + std::string box = ""; + box += "["+boundaries[2]+" , "+boundaries[0]+"] x "; + box += "["+boundaries[3]+" , "+boundaries[1]+"]"; + return box; + } - // Create the region - FloatVectorImageType::IndexType id; - id[0] = GetParameterInt("coordx"); - id[1] = GetParameterInt("coordy"); + void DoExecute() ITK_OVERRIDE + { + std::string mode = GetParameterString( "mode" ); + FloatVectorImageType::Pointer inImage = GetParameterImage("in"); + FloatVectorImageType::IndexType id ; + id.Fill(0); + bool isPixelIn( false ); + if ( mode == "index" ) + { + id[0] = static_cast< int >( GetParameterFloat( "coordx" ) ); + id[1] = static_cast< int >( GetParameterFloat( "coordy" ) ); + if (static_cast< unsigned int >( id[0] ) >= + inImage->GetLargestPossibleRegion().GetSize()[0] + || static_cast< unsigned int >( id[1] ) >= + inImage->GetLargestPossibleRegion().GetSize()[1] + || id[0] < 0 || id[1] < 0 ) + { + id.Fill(0); + isPixelIn = false; + } + else + { + isPixelIn = true; + } + } - FloatVectorImageType::SizeType size; - size.Fill(0); + else if ( mode == "physical" ) + { + itk::Point<float, 2> pixel(0); + pixel[ 0 ] = GetParameterFloat( "coordx" ); + pixel[ 1 ] = GetParameterFloat( "coordy" ); + isPixelIn = inImage->TransformPhysicalPointToIndex(pixel,id); + } + + else if ( mode == "epsg" ) + { + RSTransformType::Pointer rsTransform = RSTransformType::New(); + if ( HasUserValue("mode.epsg.code") ) + { + std::string wktFromEpsg = + otb::GeoInformationConversion::ToWKT( GetParameterInt( "mode.epsg.code" ) ); + rsTransform->SetInputProjectionRef(wktFromEpsg); + } + rsTransform->SetOutputKeywordList( inImage->GetImageKeywordlist() ); + rsTransform->SetOutputProjectionRef( inImage->GetProjectionRef() ); + rsTransform->InstantiateTransform(); + itk::Point<float, 2> pixelIn(0) , pixelOut(0); + pixelIn[ 0 ] = GetParameterFloat( "coordx" ); + pixelIn[ 1 ] = GetParameterFloat( "coordy" ); + rsTransform->InstantiateTransform(); + pixelOut = rsTransform->TransformPoint(pixelIn); + isPixelIn = inImage->TransformPhysicalPointToIndex(pixelOut,id); + } - FloatVectorImageType::RegionType region; - region.SetSize(size); - region.SetIndex(id); + if ( !isPixelIn ) + { + std::string why = "Accessible pixels are in "; + why += CreateBoundaryBox( GetParameterString( "mode" ) ); + why += " for the selected mode."; + otbAppLogFATAL(<<"Specified position out of bound.\n" + why); + } - extractor->SetExtractionRegion(region); + ExtractROIFilterType::Pointer extractor = ExtractROIFilterType::New(); + extractor->SetInput(inImage); // Extract the channels if needed if ( GetParameterByKey("cl")->GetActive() ) { - for (unsigned int idx = 0; idx < GetSelectedItems("cl").size(); ++idx) + for (unsigned int idx = 0; idx < GetSelectedItems("cl").size(); ++idx) { extractor->SetChannel(GetSelectedItems("cl")[idx] + 1 ); } } + FloatVectorImageType::SizeType size; + size.Fill(1); + FloatVectorImageType::RegionType region; + region.SetSize(size); + region.SetIndex(id); - extractor->Update(); + extractor->SetExtractionRegion(region); + extractor->Update(); // Display the pixel value id.Fill(0); std::ostringstream oss; - oss << extractor->GetOutput()->GetPixel(id)<<std::endl; - + oss << extractor->GetOutput()->GetPixel(id); SetParameterString("value", oss.str(), false); - //Display image information in the dedicated logger otbAppLogINFO( << oss.str() ); } diff --git a/Modules/Applications/AppImageUtils/test/CMakeLists.txt b/Modules/Applications/AppImageUtils/test/CMakeLists.txt index 9b6c1fcfaa328929e193c072e0e67307c9940a33..7c33a6b68e7078ab32d85c1890ac21e16df9859a 100644 --- a/Modules/Applications/AppImageUtils/test/CMakeLists.txt +++ b/Modules/Applications/AppImageUtils/test/CMakeLists.txt @@ -34,7 +34,7 @@ otb_test_application(NAME apTuUtDownloadSRTMTiles otb_test_application(NAME apTvUtConvertBasic APP Convert OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif - -out ${TEMP}/apTvUtConvertBasicOutput.tif + -out ${TEMP}/apTvUtConvertBasicOutput.tif float VALID --compare-image ${NOTOL} ${INPUTDATA}/apTvUtConvertBasicOutput.tif ${TEMP}/apTvUtConvertBasicOutput.tif @@ -49,7 +49,7 @@ otb_test_application(NAME apTuUtConvertExtendedFilename_writer otb_test_application(NAME apTvUtConvertWithScaling APP Convert OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif - -out ${TEMP}/apTvUtConvertWithScalingOutput.tif uint8 + -out ${TEMP}/apTvUtConvertWithScalingOutput.tif -type linear VALID --compare-image ${NOTOL} ${INPUTDATA}/apTvUtConvertWithScalingOutput.tif @@ -64,6 +64,28 @@ otb_test_application(NAME apTvUtConvertExtendedFilename_readerGEOM ${INPUTDATA}/ToulouseExtract_ModifiedGeom.geom ${TEMP}/apTvUtGeomExtendedFilename.geom) +otb_test_application(NAME apTvUtConvertSelectChannels + APP Convert + OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif + -out ${TEMP}/apTvUtConvertSelectChannelsRgbOutput.tif + -channels rgb + -channels.rgb.red 2 + -channels.rgb.green 3 + -channels.rgb.blue 1 + -type linear + VALID --compare-image ${NOTOL} + ${INPUTDATA}/apTvUtConvertSelectChannelsRgbOutput.tif + ${TEMP}/apTvUtConvertSelectChannelsRgbOutput.tif) + +otb_test_application(NAME apTvUtConvertMonoChannel + APP Convert + OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif + -out ${TEMP}/apTvUtConvertMonoChannelOutput.tif + -channels grayscale + -type linear + VALID --compare-image ${NOTOL} + ${INPUTDATA}/apTvUtConvertMonoChannelOutput.tif + ${TEMP}/apTvUtConvertMonoChannelOutput.tif) #----------- PixelInfo TESTS ---------------- @@ -236,16 +258,43 @@ otb_test_application(NAME apTvUtConcatenateImages_1Image #----------- MultiResolutionPyramid TESTS ---------------- #----------- PixelValue TESTS ---------------- -OTB_TEST_APPLICATION(NAME apTvUtPixelValue +OTB_TEST_APPLICATION(NAME apTvUtPixelValueIndex APP PixelValue OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif -coordx 30 -coordy 30 + -mode index + -cl Channel1 Channel3 Channel4 + TESTENVOPTIONS ${TEMP}/apTvUtPixelValueIndex.txt + VALID --compare-ascii ${EPSILON_7} + ${BASELINE_FILES}/apTvUtPixelValue.txt + ${TEMP}/apTvUtPixelValueIndex.txt + ) +OTB_TEST_APPLICATION(NAME apTvUtPixelValuePhys + APP PixelValue + OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif + -coordx 374168 + -coordy 4829165.5 + -mode physical + -cl Channel1 Channel3 Channel4 + TESTENVOPTIONS ${TEMP}/apTvUtPixelValuePhys.txt + VALID --compare-ascii ${EPSILON_7} + ${BASELINE_FILES}/apTvUtPixelValue.txt + ${TEMP}/apTvUtPixelValuePhys.txt + ) + +OTB_TEST_APPLICATION(NAME apTvUtPixelValueEpsg + APP PixelValue + OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif + -coordx 1.4408400058746337890625 + -coordy 43.604839324951171875 + -mode epsg + -mode.epsg.code 4326 -cl Channel1 Channel3 Channel4 - TESTENVOPTIONS ${TEMP}/apTvUtPixelValue.txt + TESTENVOPTIONS ${TEMP}/apTvUtPixelValueEpsg.txt VALID --compare-ascii ${EPSILON_7} ${BASELINE_FILES}/apTvUtPixelValue.txt - ${TEMP}/apTvUtPixelValue.txt + ${TEMP}/apTvUtPixelValueEpsg.txt ) #----------- ColorMapping TESTS ---------------- diff --git a/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx b/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx index b4253f066542b5eb1cb0186d2f1dd1d94fb6c124..7707ead17102762c4c8a23ceb60833d2e61549d8 100644 --- a/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx +++ b/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx @@ -23,10 +23,10 @@ #include "otbWrapperApplication.h" #include "otbWrapperApplicationFactory.h" -#include "otbImageToLuminanceImageFilter.h" -#include "otbLuminanceToReflectanceImageFilter.h" -#include "otbLuminanceToImageImageFilter.h" -#include "otbReflectanceToLuminanceImageFilter.h" +#include "otbImageToRadianceImageFilter.h" +#include "otbRadianceToReflectanceImageFilter.h" +#include "otbRadianceToImageImageFilter.h" +#include "otbReflectanceToRadianceImageFilter.h" #include "otbReflectanceToSurfaceReflectanceImageFilter.h" #include "itkMultiplyImageFilter.h" #include "otbClampVectorImageFilter.h" @@ -78,17 +78,17 @@ public: itkTypeMacro(OpticalCalibration, Application); - typedef ImageToLuminanceImageFilter<FloatVectorImageType, - DoubleVectorImageType> ImageToLuminanceImageFilterType; + typedef ImageToRadianceImageFilter<FloatVectorImageType, + DoubleVectorImageType> ImageToRadianceImageFilterType; - typedef LuminanceToReflectanceImageFilter<DoubleVectorImageType, - DoubleVectorImageType> LuminanceToReflectanceImageFilterType; + typedef RadianceToReflectanceImageFilter<DoubleVectorImageType, + DoubleVectorImageType> RadianceToReflectanceImageFilterType; - typedef LuminanceToImageImageFilter<DoubleVectorImageType, - DoubleVectorImageType> LuminanceToImageImageFilterType; + typedef RadianceToImageImageFilter<DoubleVectorImageType, + DoubleVectorImageType> RadianceToImageImageFilterType; - typedef ReflectanceToLuminanceImageFilter<FloatVectorImageType, - DoubleVectorImageType> ReflectanceToLuminanceImageFilterType; + typedef ReflectanceToRadianceImageFilter<FloatVectorImageType, + DoubleVectorImageType> ReflectanceToRadianceImageFilterType; typedef itk::MultiplyImageFilter<DoubleVectorImageType,DoubleImageType,DoubleVectorImageType> ScaleFilterOutDoubleType; @@ -381,7 +381,7 @@ private: { ossOutput << std::endl << "File: " << m_inImageName << std::endl; - //Check if valid metadata information are available to compute ImageToLuminance and LuminanceToReflectance + //Check if valid metadata information are available to compute ImageToRadiance and RadianceToReflectance FloatVectorImageType::Pointer inImage = GetParameterFloatVectorImage("in"); itk::MetaDataDictionary dict = inImage->GetMetaDataDictionary(); OpticalImageMetadataInterface::Pointer lImageMetadataInterface = OpticalImageMetadataInterfaceFactory::CreateIMI(dict); @@ -566,11 +566,11 @@ private: void DoExecute() ITK_OVERRIDE { //Main filters instantiations - m_ImageToLuminanceFilter = ImageToLuminanceImageFilterType::New(); - m_LuminanceToReflectanceFilter = LuminanceToReflectanceImageFilterType::New(); + m_ImageToRadianceFilter = ImageToRadianceImageFilterType::New(); + m_RadianceToReflectanceFilter = RadianceToReflectanceImageFilterType::New(); m_ReflectanceToSurfaceReflectanceFilter = ReflectanceToSurfaceReflectanceImageFilterType::New(); - m_ReflectanceToLuminanceFilter = ReflectanceToLuminanceImageFilterType::New(); - m_LuminanceToImageFilter = LuminanceToImageImageFilterType::New(); + m_ReflectanceToRadianceFilter = ReflectanceToRadianceImageFilterType::New(); + m_RadianceToImageFilter = RadianceToImageImageFilterType::New(); //Other instantiations m_ScaleFilter = ScaleFilterOutDoubleType::New(); @@ -590,22 +590,22 @@ private: // Set (Date and Day) OR FluxNormalizationCoef to corresponding filters if ( !IsParameterEnabled("acqui.fluxnormcoeff") ) { - m_LuminanceToReflectanceFilter->SetDay(GetParameterInt("acqui.day")); - m_LuminanceToReflectanceFilter->SetMonth(GetParameterInt("acqui.month")); + m_RadianceToReflectanceFilter->SetDay(GetParameterInt("acqui.day")); + m_RadianceToReflectanceFilter->SetMonth(GetParameterInt("acqui.month")); - m_ReflectanceToLuminanceFilter->SetDay(GetParameterInt("acqui.day")); - m_ReflectanceToLuminanceFilter->SetMonth(GetParameterInt("acqui.month")); + m_ReflectanceToRadianceFilter->SetDay(GetParameterInt("acqui.day")); + m_ReflectanceToRadianceFilter->SetMonth(GetParameterInt("acqui.month")); } else { - m_LuminanceToReflectanceFilter->SetFluxNormalizationCoefficient(GetParameterFloat("acqui.fluxnormcoeff")); + m_RadianceToReflectanceFilter->SetFluxNormalizationCoefficient(GetParameterFloat("acqui.fluxnormcoeff")); - m_ReflectanceToLuminanceFilter->SetFluxNormalizationCoefficient(GetParameterFloat("acqui.fluxnormcoeff")); + m_ReflectanceToRadianceFilter->SetFluxNormalizationCoefficient(GetParameterFloat("acqui.fluxnormcoeff")); } // Set Sun Elevation Angle to corresponding filters - m_LuminanceToReflectanceFilter->SetElevationSolarAngle(GetParameterFloat("acqui.sun.elev")); - m_ReflectanceToLuminanceFilter->SetElevationSolarAngle(GetParameterFloat("acqui.sun.elev")); + m_RadianceToReflectanceFilter->SetElevationSolarAngle(GetParameterFloat("acqui.sun.elev")); + m_ReflectanceToRadianceFilter->SetElevationSolarAngle(GetParameterFloat("acqui.sun.elev")); // Set Gain and Bias to corresponding filters if (IsParameterEnabled("acqui.gainbias") && HasValue("acqui.gainbias")) @@ -644,14 +644,14 @@ private: switch (numLine) { case 1 : - m_ImageToLuminanceFilter->SetAlpha(vlvector); - m_LuminanceToImageFilter->SetAlpha(vlvector); + m_ImageToRadianceFilter->SetAlpha(vlvector); + m_RadianceToImageFilter->SetAlpha(vlvector); GetLogger()->Info("Trying to get gains/biases information... OK (1/2)\n"); break; case 2 : - m_ImageToLuminanceFilter->SetBeta(vlvector); - m_LuminanceToImageFilter->SetBeta(vlvector); + m_ImageToRadianceFilter->SetBeta(vlvector); + m_RadianceToImageFilter->SetBeta(vlvector); GetLogger()->Info("Trying to get gains/biases information... OK (2/2)\n"); break; @@ -669,11 +669,11 @@ private: //Try to retrieve information from image metadata if (IMIName != IMIOptDfltName) { - m_ImageToLuminanceFilter->SetAlpha(lImageMetadataInterface->GetPhysicalGain()); - m_LuminanceToImageFilter->SetAlpha(lImageMetadataInterface->GetPhysicalGain()); + m_ImageToRadianceFilter->SetAlpha(lImageMetadataInterface->GetPhysicalGain()); + m_RadianceToImageFilter->SetAlpha(lImageMetadataInterface->GetPhysicalGain()); - m_ImageToLuminanceFilter->SetBeta(lImageMetadataInterface->GetPhysicalBias()); - m_LuminanceToImageFilter->SetBeta(lImageMetadataInterface->GetPhysicalBias()); + m_ImageToRadianceFilter->SetBeta(lImageMetadataInterface->GetPhysicalBias()); + m_RadianceToImageFilter->SetBeta(lImageMetadataInterface->GetPhysicalBias()); } else itkExceptionMacro(<< "Please, provide a type of sensor supported by OTB for automatic metadata extraction! "); @@ -711,8 +711,8 @@ private: itk::VariableLengthVector<double> vlvector; vlvector.SetData(values.data(),values.size(),false); - m_LuminanceToReflectanceFilter->SetSolarIllumination(vlvector); - m_ReflectanceToLuminanceFilter->SetSolarIllumination(vlvector); + m_RadianceToReflectanceFilter->SetSolarIllumination(vlvector); + m_ReflectanceToRadianceFilter->SetSolarIllumination(vlvector); } } file.close(); @@ -725,8 +725,8 @@ private: //Try to retrieve information from image metadata if (IMIName != IMIOptDfltName) { - m_LuminanceToReflectanceFilter->SetSolarIllumination(lImageMetadataInterface->GetSolarIrradiance()); - m_ReflectanceToLuminanceFilter->SetSolarIllumination(lImageMetadataInterface->GetSolarIrradiance()); + m_RadianceToReflectanceFilter->SetSolarIllumination(lImageMetadataInterface->GetSolarIrradiance()); + m_ReflectanceToRadianceFilter->SetSolarIllumination(lImageMetadataInterface->GetSolarIrradiance()); } else itkExceptionMacro(<< "Please, provide a type of sensor supported by OTB for automatic metadata extraction! "); @@ -748,17 +748,17 @@ private: GetLogger()->Info("Compute Top of Atmosphere reflectance\n"); //Pipeline - m_ImageToLuminanceFilter->SetInput(inImage); - m_LuminanceToReflectanceFilter->SetInput(m_ImageToLuminanceFilter->GetOutput()); + m_ImageToRadianceFilter->SetInput(inImage); + m_RadianceToReflectanceFilter->SetInput(m_ImageToRadianceFilter->GetOutput()); if (IsParameterEnabled("clamp")) { GetLogger()->Info("Clamp values between [0, 100]\n"); } - m_LuminanceToReflectanceFilter->SetUseClamp(IsParameterEnabled("clamp")); - m_LuminanceToReflectanceFilter->UpdateOutputInformation(); - m_ScaleFilter->SetInput(m_LuminanceToReflectanceFilter->GetOutput()); + m_RadianceToReflectanceFilter->SetUseClamp(IsParameterEnabled("clamp")); + m_RadianceToReflectanceFilter->UpdateOutputInformation(); + m_ScaleFilter->SetInput(m_RadianceToReflectanceFilter->GetOutput()); } break; case Level_TOA_IM: @@ -766,10 +766,10 @@ private: GetLogger()->Info("Convert Top of Atmosphere reflectance to image DN\n"); //Pipeline - m_ReflectanceToLuminanceFilter->SetInput(inImage); - m_LuminanceToImageFilter->SetInput(m_ReflectanceToLuminanceFilter->GetOutput()); - m_LuminanceToImageFilter->UpdateOutputInformation(); - m_ScaleFilter->SetInput(m_LuminanceToImageFilter->GetOutput()); + m_ReflectanceToRadianceFilter->SetInput(inImage); + m_RadianceToImageFilter->SetInput(m_ReflectanceToRadianceFilter->GetOutput()); + m_RadianceToImageFilter->UpdateOutputInformation(); + m_ScaleFilter->SetInput(m_RadianceToImageFilter->GetOutput()); } break; case Level_TOC: @@ -777,9 +777,9 @@ private: GetLogger()->Info("Compute Top of Canopy reflectance\n"); //Pipeline - m_ImageToLuminanceFilter->SetInput(inImage); - m_LuminanceToReflectanceFilter->SetInput(m_ImageToLuminanceFilter->GetOutput()); - m_ReflectanceToSurfaceReflectanceFilter->SetInput(m_LuminanceToReflectanceFilter->GetOutput()); + m_ImageToRadianceFilter->SetInput(inImage); + m_RadianceToReflectanceFilter->SetInput(m_ImageToRadianceFilter->GetOutput()); + m_ReflectanceToSurfaceReflectanceFilter->SetInput(m_RadianceToReflectanceFilter->GetOutput()); m_ReflectanceToSurfaceReflectanceFilter->SetAcquiCorrectionParameters(m_paramAcqui); m_ReflectanceToSurfaceReflectanceFilter->SetAtmoCorrectionParameters(m_paramAtmo); @@ -934,10 +934,10 @@ private: } //Keep object references as a members of the class, else the pipeline will be broken after exiting DoExecute(). - ImageToLuminanceImageFilterType ::Pointer m_ImageToLuminanceFilter; - LuminanceToReflectanceImageFilterType::Pointer m_LuminanceToReflectanceFilter; - ReflectanceToLuminanceImageFilterType::Pointer m_ReflectanceToLuminanceFilter; - LuminanceToImageImageFilterType::Pointer m_LuminanceToImageFilter; + ImageToRadianceImageFilterType ::Pointer m_ImageToRadianceFilter; + RadianceToReflectanceImageFilterType::Pointer m_RadianceToReflectanceFilter; + ReflectanceToRadianceImageFilterType::Pointer m_ReflectanceToRadianceFilter; + RadianceToImageImageFilterType::Pointer m_RadianceToImageFilter; ReflectanceToSurfaceReflectanceImageFilterType::Pointer m_ReflectanceToSurfaceReflectanceFilter; ScaleFilterOutDoubleType::Pointer m_ScaleFilter; AtmoCorrectionParametersPointerType m_paramAtmo; diff --git a/Modules/Applications/AppOpticalCalibration/test/CMakeLists.txt b/Modules/Applications/AppOpticalCalibration/test/CMakeLists.txt index b5df61f0596399e35679cb52af0698130a3ad7e7..a3068e1a64d109373ccb799f839f62a9c74c03b1 100644 --- a/Modules/Applications/AppOpticalCalibration/test/CMakeLists.txt +++ b/Modules/Applications/AppOpticalCalibration/test/CMakeLists.txt @@ -27,7 +27,7 @@ otb_test_application(NAME apTvRaOpticalCalibration_QuickbirdXS -clamp false -out ${TEMP}/apTvRaOpticalCalibration_QuickbirdXS.tif VALID --compare-image ${EPSILON_7} - ${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoQuickbirdXS.tif + ${BASELINE}/raTvRadianceToReflectanceImageFilterAutoQuickbirdXS.tif ${TEMP}/apTvRaOpticalCalibration_QuickbirdXS.tif ) otb_test_application(NAME apTvRaOpticalCalibration_WV2PAN @@ -36,7 +36,7 @@ otb_test_application(NAME apTvRaOpticalCalibration_WV2PAN -level toa -out ${TEMP}/apTvRaOpticalCalibration_WV2PAN.tif VALID --compare-image ${EPSILON_7} - ${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoWV2PAN.tif + ${BASELINE}/raTvRadianceToReflectanceImageFilterAutoWV2PAN.tif ${TEMP}/apTvRaOpticalCalibration_WV2PAN.tif ) otb_test_application(NAME apTvRaOpticalCalibration_WV2Multi @@ -45,7 +45,7 @@ otb_test_application(NAME apTvRaOpticalCalibration_WV2Multi -level toa -out ${TEMP}/apTvRaOpticalCalibration_WV2Multi.tif VALID --compare-image ${EPSILON_7} - ${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoWV2Multi.tif + ${BASELINE}/raTvRadianceToReflectanceImageFilterAutoWV2Multi.tif ${TEMP}/apTvRaOpticalCalibration_WV2Multi.tif ) otb_test_application(NAME apTvRaOpticalCalibration_Formosat @@ -54,7 +54,7 @@ otb_test_application(NAME apTvRaOpticalCalibration_Formosat -level toa -out ${TEMP}/apTvRaOpticalCalibration_Formosat.img VALID --compare-image ${EPSILON_7} - ${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoFormosat.tif + ${BASELINE}/raTvRadianceToReflectanceImageFilterAutoFormosat.tif ${TEMP}/apTvRaOpticalCalibration_Formosat.img ) otb_test_application(NAME apTvRaOpticalCalibration_QuickbirdPAN @@ -63,7 +63,7 @@ otb_test_application(NAME apTvRaOpticalCalibration_QuickbirdPAN -level toa -out ${TEMP}/apTvRaOpticalCalibration_QuickbirdPAN.tif VALID --compare-image ${EPSILON_7} - ${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoQuickbirdPAN.tif + ${BASELINE}/raTvRadianceToReflectanceImageFilterAutoQuickbirdPAN.tif ${TEMP}/apTvRaOpticalCalibration_QuickbirdPAN.tif ) otb_test_application(NAME apTvRaOpticalCalibration_Spot5 @@ -72,7 +72,7 @@ otb_test_application(NAME apTvRaOpticalCalibration_Spot5 -level toa -out ${TEMP}/apTvRaOpticalCalibration_Spot5.img VALID --compare-image ${EPSILON_7} - ${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoSpot5.tif + ${BASELINE}/raTvRadianceToReflectanceImageFilterAutoSpot5.tif ${TEMP}/apTvRaOpticalCalibration_Spot5.img ) otb_test_application(NAME apTvRaOpticalCalibration_UnknownSensor @@ -106,7 +106,7 @@ otb_test_application(NAME apTvRaOpticalCalibration_UnknownSensor otb_test_application(NAME apTvRaOpticalCalibration_Reverse_UnknownSensor APP OpticalCalibration OPTIONS - -in ${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoQuickbirdXS.tif + -in ${BASELINE}/raTvRadianceToReflectanceImageFilterAutoQuickbirdXS.tif -out ${TEMP}/apTvRaOpticalCalibration_Rev_QB-XS_UnknownSensor_test.tif -level toatoim -acqui.gainbias ${INPUTDATA}/apTvRaOpticalCalibrationUnknownSensorGainsBiases.txt @@ -126,6 +126,6 @@ otb_test_application(NAME apTvRaOpticalCalibration_Ikonos -level toa -out ${TEMP}/apTvRaOpticalCalibration_Ikonos.tif VALID --compare-image ${EPSILON_7} - ${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoIkonos.tif + ${BASELINE}/raTvRadianceToReflectanceImageFilterAutoIkonos.tif ${TEMP}/apTvRaOpticalCalibration_Ikonos.tif ) diff --git a/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx b/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx index 1313e70650cb4748f66d19f59de968dd31bba812..2dc6a6119f70ce75cd81e2483d32392e10933fc6 100644 --- a/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx +++ b/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx @@ -91,7 +91,7 @@ private: { SetName("OrthoRectification"); std::ostringstream oss; - oss << "This application allows ortho-rectification of optical images from supported sensors." << std::endl; + oss << "This application allows ortho-rectification of optical and radar images from supported sensors." << std::endl; SetDescription(oss.str()); // Documentation SetDocName("Ortho-rectification"); @@ -101,7 +101,7 @@ private: oss<<"A Digital Elevation Model can be specified to account for terrain deformations. "<<std::endl; oss<<"In case of SPOT5 images, the sensor model can be approximated by an RPC model in order to speed-up computation."; SetDocLongDescription(oss.str()); - SetDocLimitations("Supported sensors are Pleiades, SPOT5 (TIF format), SPOT6/7, Ikonos, Quickbird, Worldview2, Worldview3, GeoEye, Sentinel1."); + SetDocLimitations("Supported sensors (both optical and radar) are: GeoEye, Ikonos, Pleiades, Quickbird, RadarSat, Sentinel-1, SPOT5 (TIF format), SPOT6/7, TerraSAR-X, Worldview 1/2/3."); SetDocAuthors("OTB-Team"); SetDocSeeAlso("Ortho-rectification chapter from the OTB Software Guide"); diff --git a/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx b/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx index 1219f24c1a9876a30ba77a55277442247a43e26b..dee453835a8e034816bb943bce9b55e78bdad085 100644 --- a/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx +++ b/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx @@ -84,8 +84,8 @@ private: " may be innacurate and that techniques such as color space transform or image" " normalisation could be applied before using this application. Also" " note that most satellite images noise model is not gaussian, since" - " noise variance linearly depends on luminance (the higher the" - " luminance, the higher the noise variance). To account for such noise" + " noise variance linearly depends on radiance (the higher the" + " radiance, the higher the noise variance). To account for such noise" " model, the application provides the range radius ramp option" " (rangeramp), which will vary the range radius linearly with the" " central pixel intensity. Default value is 1. (no ramp).\n\n" diff --git a/Modules/Core/Transform/include/otbGeoInformationConversion.h b/Modules/Core/Transform/include/otbGeoInformationConversion.h index 3fd9b45d621a002fd68d08dc2f1093192144d18a..d20f786f7ccd2be7b4081e341fdadbbbb018d72e 100644 --- a/Modules/Core/Transform/include/otbGeoInformationConversion.h +++ b/Modules/Core/Transform/include/otbGeoInformationConversion.h @@ -33,7 +33,9 @@ namespace otb * \brief Helper functions to do the geo information conversions used frequently. * * This namespace provides helpers functions to build a WKT from a valid EPSG number using - * the method ToWKT(int srid). + * the method ToWKT(int srid), and also to retrieve an EPSG number from a WKT + * using the method ToEPSG(const std::string &) + * */ namespace GeoInformationConversion { @@ -43,6 +45,13 @@ namespace GeoInformationConversion /** this method try to morph a wkt to ESRI WKT format and returns the error code**/ OTBTransform_EXPORT bool IsESRIValidWKT(const std::string &Wkt); + + /** Function used to get an epsg number from a wkt string. + * Returns -1 if the wkt is neither a PROJCS nor a GEOGCS. + * Returns 0 if no authority code is found but wkt has a PROJCS or a GEOGCS. + * Otherwise the EPSG authority code is returned + */ + OTBTransform_EXPORT int ToEPSG(const std::string &wkt); } } // End namespace otb diff --git a/Modules/Core/Transform/src/otbGeoInformationConversion.cxx b/Modules/Core/Transform/src/otbGeoInformationConversion.cxx index 635b8cf8f89397fb4479a83c20d348fb8f3b672d..4beb0cd9ec0dfcfcd7278957d8b5b9899b9a9e31 100644 --- a/Modules/Core/Transform/src/otbGeoInformationConversion.cxx +++ b/Modules/Core/Transform/src/otbGeoInformationConversion.cxx @@ -73,4 +73,35 @@ bool GeoInformationConversion::IsESRIValidWKT(const std::string &wkt) return SRS.Validate()==OGRERR_NONE; } +int GeoInformationConversion::ToEPSG(const std::string &wkt) +{ + int code = -1; + OGRSpatialReference srs(wkt.c_str()); + srs.Fixup(); + srs.AutoIdentifyEPSG(); + const char * epsg = nullptr; + if (srs.IsGeographic()) + { + code = 0; + epsg = srs.GetAuthorityCode("GEOGCS"); + } + else if (srs.IsProjected()) + { + code = 0; + epsg = srs.GetAuthorityCode("PROJCS"); + } + if (epsg!=nullptr && strcmp( epsg, "" )!=0 ) + { + try + { + code = boost::lexical_cast<int>(epsg); + } + catch(boost::bad_lexical_cast &) + { + code = 0; + } + } + return code; +} + } // End namespace otb diff --git a/Modules/IO/ImageIO/include/otbImageFileReader.txx b/Modules/IO/ImageIO/include/otbImageFileReader.txx index f701d882571bd7c17dbd6dd90e162b19f450e21b..966fe434b9ebf1ab7fd58711e55f9e171d7575f3 100644 --- a/Modules/IO/ImageIO/include/otbImageFileReader.txx +++ b/Modules/IO/ImageIO/include/otbImageFileReader.txx @@ -734,7 +734,7 @@ ImageFileReader<TOutputImage, ConvertPixelTraits> // TODO: // Pass down the PixelType (RGB, VECTOR, etc.) so that any vector to // scalar conversion be type specific. i.e. RGB to scalar would use - // a formula to convert to luminance, VECTOR to scalar would use + // a formula to convert to radiance, VECTOR to scalar would use // vector magnitude. diff --git a/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.txx b/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.txx index 1a442a249a7ace0ad8768ec2ecac7be1b077cce8..7fa8822ec670b416ed36e9b7eab478afca57fccb 100644 --- a/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.txx +++ b/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.txx @@ -725,19 +725,22 @@ PersistentSamplingFilterBase<TInputImage,TMaskImage> { tmpLayers.push_back(this->GetInMemoryInput(i)); } - + + const unsigned int nbFeatThread = std::ceil(inLayer.GetFeatureCount(true) / (float) numberOfThreads); + assert(nbFeatThread > 0); + OGRFeatureDefn &layerDefn = inLayer.GetLayerDefn(); ogr::Layer::const_iterator featIt = inLayer.begin(); unsigned int counter=0; + unsigned int cptFeat = 0; for(; featIt!=inLayer.end(); ++featIt) { ogr::Feature dstFeature(layerDefn); dstFeature.SetFrom( *featIt, TRUE ); dstFeature.SetFID(featIt->GetFID()); tmpLayers[counter].CreateFeature( dstFeature ); - counter++; - if (counter >= tmpLayers.size()) - counter = 0; + cptFeat++; + if (cptFeat > nbFeatThread) counter++; cptFeat=0; } inLayer.SetSpatialFilter(ITK_NULLPTR); diff --git a/Modules/Radiometry/OpticalCalibration/include/otbImageToLuminanceImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbImageToRadianceImageFilter.h similarity index 84% rename from Modules/Radiometry/OpticalCalibration/include/otbImageToLuminanceImageFilter.h rename to Modules/Radiometry/OpticalCalibration/include/otbImageToRadianceImageFilter.h index d451f59441923a2b09a36bf81cacc16be99b7c38..fc8b7c3bbde428c1907ead63b869c77bd6707a78 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbImageToLuminanceImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbImageToRadianceImageFilter.h @@ -19,8 +19,8 @@ * limitations under the License. */ -#ifndef otbImageToLuminanceImageFilter_h -#define otbImageToLuminanceImageFilter_h +#ifndef otbImageToRadianceImageFilter_h +#define otbImageToRadianceImageFilter_h #include "otbUnaryImageFunctorWithVectorImageFilter.h" #include "itkNumericTraits.h" @@ -34,10 +34,10 @@ namespace otb namespace Functor { /** - * \class ImageToLuminanceImageFunctor + * \class ImageToRadianceImageFunctor * \brief Add beta to the quotient Input over alpha. * - * \sa ImageToLuminanceImageFilter + * \sa ImageToRadianceImageFilter * \ingroup Functor * \ingroup Radiometry * @@ -45,15 +45,15 @@ namespace Functor */ template <class TInput, class TOutput> -class ImageToLuminanceImageFunctor +class ImageToRadianceImageFunctor { public: - ImageToLuminanceImageFunctor() : + ImageToRadianceImageFunctor() : m_Alpha(1.), m_Beta(0.) {} - virtual ~ImageToLuminanceImageFunctor() {} + virtual ~ImageToRadianceImageFunctor() {} void SetAlpha(double alpha) { @@ -87,17 +87,17 @@ private: }; } -/** \class ImageToLuminanceImageFilter - * \brief Convert a raw value into a luminance value +/** \class ImageToRadianceImageFilter + * \brief Convert a raw value into a radiance value * - * Transform a classical image into the luminance image. For this it - * uses the functor ImageToLuminanceImageFunctor calling for each component of each pixel. + * Transform a classical image into the radiance image. For this it + * uses the functor ImageToRadianceImageFunctor calling for each component of each pixel. * * * For Spot image in the dimap format, the correction parameters are * retrieved automatically from the metadata * - * \ingroup ImageToLuminanceImageFunctor + * \ingroup ImageToRadianceImageFunctor * \ingroup Radiometry * * \example Radiometry/AtmosphericCorrectionSequencement.cxx @@ -105,10 +105,10 @@ private: * \ingroup OTBOpticalCalibration */ template <class TInputImage, class TOutputImage> -class ITK_EXPORT ImageToLuminanceImageFilter : +class ITK_EXPORT ImageToRadianceImageFilter : public UnaryImageFunctorWithVectorImageFilter<TInputImage, TOutputImage, - typename Functor::ImageToLuminanceImageFunctor<typename + typename Functor::ImageToRadianceImageFunctor<typename TInputImage:: InternalPixelType, typename @@ -123,11 +123,11 @@ public: /** "typedef" to simplify the variables definition and the declaration. */ typedef TInputImage InputImageType; typedef TOutputImage OutputImageType; - typedef typename Functor::ImageToLuminanceImageFunctor<typename InputImageType::InternalPixelType, + typedef typename Functor::ImageToRadianceImageFunctor<typename InputImageType::InternalPixelType, typename OutputImageType::InternalPixelType> FunctorType; /** "typedef" for standard classes. */ - typedef ImageToLuminanceImageFilter Self; + typedef ImageToRadianceImageFilter Self; typedef UnaryImageFunctorWithVectorImageFilter<InputImageType, OutputImageType, FunctorType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -136,7 +136,7 @@ public: itkNewMacro(Self); /** return class name. */ - itkTypeMacro(ImageToLuminanceImageFilter, UnaryImageFunctorWithVectorImageFiltermageFilter); + itkTypeMacro(ImageToRadianceImageFilter, UnaryImageFunctorWithVectorImageFiltermageFilter); /** Supported images definition. */ typedef typename InputImageType::PixelType InputPixelType; @@ -164,14 +164,14 @@ public: protected: /** Constructor */ - ImageToLuminanceImageFilter() + ImageToRadianceImageFilter() { m_Alpha.SetSize(0); m_Beta.SetSize(0); }; /** Destructor */ - ~ImageToLuminanceImageFilter() ITK_OVERRIDE {} + ~ImageToRadianceImageFilter() ITK_OVERRIDE {} /** Update the functor list and input parameters */ void BeforeThreadedGenerateData(void) ITK_OVERRIDE diff --git a/Modules/Radiometry/OpticalCalibration/include/otbImageToReflectanceImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbImageToReflectanceImageFilter.h index 024a72343815e62413aebee0a2a6b6c5725e40d9..6dbc688a7f1e0861f4624e0a14d2fab256a49293 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbImageToReflectanceImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbImageToReflectanceImageFilter.h @@ -22,22 +22,22 @@ #ifndef otbImageToReflectanceImageFilter_h #define otbImageToReflectanceImageFilter_h -#include "otbImageToLuminanceImageFilter.h" -#include "otbLuminanceToReflectanceImageFilter.h" +#include "otbImageToRadianceImageFilter.h" +#include "otbRadianceToReflectanceImageFilter.h" namespace otb { namespace Functor { /** \class ImageToReflectanceImageFunctor - * \brief Call the ImageToLuminanceFunctor over the input and the LuminanceToReflectanceFunctor to this result. + * \brief Call the ImageToRadianceFunctor over the input and the RadianceToReflectanceFunctor to this result. * * * \sa ImageToReflectanceImageFilter * * \ingroup Functor - * \ingroup ImageToLuminanceFunctor - * \ingroup LuminanceToReflectanceFunctor + * \ingroup ImageToRadianceFunctor + * \ingroup RadianceToReflectanceFunctor * \ingroup Radiometry * * \ingroup OTBOpticalCalibration @@ -49,8 +49,8 @@ public: ImageToReflectanceImageFunctor() {} virtual ~ImageToReflectanceImageFunctor() {} - typedef Functor::ImageToLuminanceImageFunctor<TInput, TOutput> ImToLumFunctorType; - typedef Functor::LuminanceToReflectanceImageFunctor<TInput, TOutput> LumToReflecFunctorType; + typedef Functor::ImageToRadianceImageFunctor<TInput, TOutput> ImToLumFunctorType; + typedef Functor::RadianceToReflectanceImageFunctor<TInput, TOutput> LumToReflecFunctorType; void SetAlpha(double alpha) { @@ -124,8 +124,8 @@ private: * retrieved automatically from the metadata * * \ingroup ImageToReflectanceImageFunctor - * \ingroup ImageToLuminanceImageFilter - * \ingroup ReflectanceToLuminanceImageFilter + * \ingroup ImageToRadianceImageFilter + * \ingroup ReflectanceToRadianceImageFilter * \ingroup Radiometry * * \ingroup OTBOpticalCalibration diff --git a/Modules/Radiometry/OpticalCalibration/include/otbLuminanceToImageImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbRadianceToImageImageFilter.h similarity index 84% rename from Modules/Radiometry/OpticalCalibration/include/otbLuminanceToImageImageFilter.h rename to Modules/Radiometry/OpticalCalibration/include/otbRadianceToImageImageFilter.h index c28fd72970594c3a28c844eeb596b9005ce7756d..dc135e3db45c436617f2afd8eed4da1e3193132f 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbLuminanceToImageImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbRadianceToImageImageFilter.h @@ -19,8 +19,8 @@ * limitations under the License. */ -#ifndef otbLuminanceToImageImageFilter_h -#define otbLuminanceToImageImageFilter_h +#ifndef otbRadianceToImageImageFilter_h +#define otbRadianceToImageImageFilter_h #include "otb_6S.h" #include "otbUnaryImageFunctorWithVectorImageFilter.h" @@ -35,10 +35,10 @@ namespace otb namespace Functor { /** - * \class LuminanceToImageImageFunctor + * \class RadianceToImageImageFunctor * \brief Subtract beta to the Input and multiply by alpha. * - * \sa LuminanceToImageImageFilter + * \sa RadianceToImageImageFilter * \ingroup Functor * \ingroup Radiometry * @@ -46,15 +46,15 @@ namespace Functor */ template <class TInput, class TOutput> -class LuminanceToImageImageFunctor +class RadianceToImageImageFunctor { public: - LuminanceToImageImageFunctor() : + RadianceToImageImageFunctor() : m_Alpha(1.), m_Beta(0.) {} - virtual ~LuminanceToImageImageFunctor() {} + virtual ~RadianceToImageImageFunctor() {} void SetAlpha(double alpha) { @@ -88,17 +88,17 @@ private: }; } -/** \class LuminanceToImageImageFilter - * \brief Convert a raw value into a luminance value +/** \class RadianceToImageImageFilter + * \brief Convert a raw value into a radiance value * - * Transform a luminance image into a classical image. For this it - * uses the functor LuminanceToImageImageFunctor calling for each component of each pixel. + * Transform a radiance image into a classical image. For this it + * uses the functor RadianceToImageImageFunctor calling for each component of each pixel. * * * For Spot image in the dimap format, the correction parameters are * retrieved automatically from the metadata * - * \ingroup LuminanceToImageImageFunctor + * \ingroup RadianceToImageImageFunctor * \ingroup Radiometry * * \example Radiometry/AtmosphericCorrectionSequencement.cxx @@ -106,10 +106,10 @@ private: * \ingroup OTBOpticalCalibration */ template <class TInputImage, class TOutputImage> -class ITK_EXPORT LuminanceToImageImageFilter : +class ITK_EXPORT RadianceToImageImageFilter : public UnaryImageFunctorWithVectorImageFilter<TInputImage, TOutputImage, - typename Functor::LuminanceToImageImageFunctor<typename + typename Functor::RadianceToImageImageFunctor<typename TInputImage:: InternalPixelType, typename @@ -124,11 +124,11 @@ public: /** "typedef" to simplify the variables definition and the declaration. */ typedef TInputImage InputImageType; typedef TOutputImage OutputImageType; - typedef typename Functor::LuminanceToImageImageFunctor<typename InputImageType::InternalPixelType, + typedef typename Functor::RadianceToImageImageFunctor<typename InputImageType::InternalPixelType, typename OutputImageType::InternalPixelType> FunctorType; /** "typedef" for standard classes. */ - typedef LuminanceToImageImageFilter Self; + typedef RadianceToImageImageFilter Self; typedef UnaryImageFunctorWithVectorImageFilter<InputImageType, OutputImageType, FunctorType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -137,7 +137,7 @@ public: itkNewMacro(Self); /** return class name. */ - itkTypeMacro(LuminanceToImageImageFilter, UnaryImageFunctorWithVectorImageFiltermageFilter); + itkTypeMacro(RadianceToImageImageFilter, UnaryImageFunctorWithVectorImageFiltermageFilter); /** Supported images definition. */ typedef typename InputImageType::PixelType InputPixelType; @@ -165,14 +165,14 @@ public: protected: /** Constructor */ - LuminanceToImageImageFilter() + RadianceToImageImageFilter() { m_Alpha.SetSize(0); m_Beta.SetSize(0); }; /** Destructor */ - ~LuminanceToImageImageFilter() ITK_OVERRIDE {} + ~RadianceToImageImageFilter() ITK_OVERRIDE {} /** Update the functor list and input parameters */ void BeforeThreadedGenerateData(void) ITK_OVERRIDE diff --git a/Modules/Radiometry/OpticalCalibration/include/otbLuminanceToReflectanceImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbRadianceToReflectanceImageFilter.h similarity index 88% rename from Modules/Radiometry/OpticalCalibration/include/otbLuminanceToReflectanceImageFilter.h rename to Modules/Radiometry/OpticalCalibration/include/otbRadianceToReflectanceImageFilter.h index 1d126c854ca068152e206f732065a1ce642e5960..9e4d667b5edaa63752e2ff746b7fad97e2e4c3bf 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbLuminanceToReflectanceImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbRadianceToReflectanceImageFilter.h @@ -19,8 +19,8 @@ * limitations under the License. */ -#ifndef otbLuminanceToReflectanceImageFilter_h -#define otbLuminanceToReflectanceImageFilter_h +#ifndef otbRadianceToReflectanceImageFilter_h +#define otbRadianceToReflectanceImageFilter_h #include "otbVarSol.h" #include "otbUnaryImageFunctorWithVectorImageFilter.h" @@ -33,14 +33,14 @@ namespace otb namespace Functor { /** - * \class LuminanceToReflectanceImageFunctor - * \brief Compupute reflectance from the luminance value + * \class RadianceToReflectanceImageFunctor + * \brief Compute reflectance from the radiance value * * Multiply by Pi and by an illumination correction coefficient the * quotient between the input and the given solar illumination. * * - * \sa LuminanceToReflectanceImageFilter + * \sa RadianceToReflectanceImageFilter * * \ingroup Functor * \ingroup Radiometry @@ -49,16 +49,16 @@ namespace Functor * \ingroup OTBOpticalCalibration */ template <class TInput, class TOutput> -class LuminanceToReflectanceImageFunctor +class RadianceToReflectanceImageFunctor { public: - LuminanceToReflectanceImageFunctor() : + RadianceToReflectanceImageFunctor() : m_SolarIllumination(1.0), m_IlluminationCorrectionCoefficient(1.0), m_UseClamp(true) {} - virtual ~LuminanceToReflectanceImageFunctor() {} + virtual ~RadianceToReflectanceImageFunctor() {} void SetSolarIllumination(double solarIllumination) { @@ -112,17 +112,17 @@ private: }; } -/** \class LuminanceToReflectanceImageFilter - * \brief Convert luminance value into reflectance value +/** \class RadianceToReflectanceImageFilter + * \brief Convert radiance value into reflectance value * - * Transform a luminance image into the reflectance. For this it uses the - * functor LuminanceToReflectanceImageFunctor calling for each component of each pixel. + * Transform a radiance image into the reflectance. For this it uses the + * functor RadianceToReflectanceImageFunctor calling for each component of each pixel. * * * For Spot image in the dimap format, the correction parameters are * retrieved automatically from the metadata * - * \ingroup ImageToLuminanceImageFunctor + * \ingroup ImageToRadianceImageFunctor * \ingroup Radiometry * * \example Radiometry/AtmosphericCorrectionSequencement.cxx @@ -130,10 +130,10 @@ private: * \ingroup OTBOpticalCalibration */ template <class TInputImage, class TOutputImage> -class ITK_EXPORT LuminanceToReflectanceImageFilter : +class ITK_EXPORT RadianceToReflectanceImageFilter : public UnaryImageFunctorWithVectorImageFilter<TInputImage, TOutputImage, - typename Functor::LuminanceToReflectanceImageFunctor<typename + typename Functor::RadianceToReflectanceImageFunctor<typename TInputImage:: InternalPixelType, typename @@ -148,12 +148,12 @@ public: /** "typedef" to simplify the variables definition and the declaration. */ typedef TInputImage InputImageType; typedef TOutputImage OutputImageType; - typedef typename Functor::LuminanceToReflectanceImageFunctor<typename InputImageType::InternalPixelType, + typedef typename Functor::RadianceToReflectanceImageFunctor<typename InputImageType::InternalPixelType, typename OutputImageType::InternalPixelType> FunctorType; /** "typedef" for standard classes. */ - typedef LuminanceToReflectanceImageFilter Self; + typedef RadianceToReflectanceImageFilter Self; typedef UnaryImageFunctorWithVectorImageFilter<InputImageType, OutputImageType, FunctorType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -162,7 +162,7 @@ public: itkNewMacro(Self); /** return class name. */ - itkTypeMacro(LuminanceToReflectanceImageFilter, UnaryImageFunctorWithVectorImageFiltermageFilter); + itkTypeMacro(RadianceToReflectanceImageFilter, UnaryImageFunctorWithVectorImageFiltermageFilter); /** Supported images definition. */ typedef typename InputImageType::PixelType InputPixelType; @@ -235,7 +235,7 @@ public: protected: /** Constructor */ - LuminanceToReflectanceImageFilter() : + RadianceToReflectanceImageFilter() : m_ZenithalSolarAngle(120.0), //invalid value which will lead to negative radiometry m_FluxNormalizationCoefficient(1.), m_Day(0), @@ -247,7 +247,7 @@ protected: }; /** Destructor */ - ~LuminanceToReflectanceImageFilter() ITK_OVERRIDE {} + ~RadianceToReflectanceImageFilter() ITK_OVERRIDE {} /** Update the functor list and input parameters */ void BeforeThreadedGenerateData(void) ITK_OVERRIDE diff --git a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToImageImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToImageImageFilter.h index 23fa33c2d069fb92686495f054858a716feadd15..6050d66777077a99b24d82a1baf04496947a2f1b 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToImageImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToImageImageFilter.h @@ -22,22 +22,22 @@ #ifndef otbReflectanceToImageImageFilter_h #define otbReflectanceToImageImageFilter_h -#include "otbLuminanceToImageImageFilter.h" -#include "otbReflectanceToLuminanceImageFilter.h" +#include "otbRadianceToImageImageFilter.h" +#include "otbReflectanceToRadianceImageFilter.h" namespace otb { namespace Functor { /** \class ReflectanceToImageImageFunctor - * \brief Call the ReflectanceToLuminanceFunctor over the input and the LuminanceToImageFunctor to this result. + * \brief Call the ReflectanceToRadianceFunctor over the input and the RadianceToImageFunctor to this result. * * * \sa ReflectanceToImageImageFilter * * \ingroup Functor - * \ingroup LuminanceToImageFunctor - * \ingroup ReflectanceToLuminanceFunctor + * \ingroup RadianceToImageFunctor + * \ingroup ReflectanceToRadianceFunctor * \ingroup Radiometry * * \ingroup OTBOpticalCalibration @@ -49,8 +49,8 @@ public: ReflectanceToImageImageFunctor() {} virtual ~ReflectanceToImageImageFunctor() {} - typedef Functor::LuminanceToImageImageFunctor<TInput, TOutput> LumToImFunctorType; - typedef Functor::ReflectanceToLuminanceImageFunctor<TInput, TOutput> ReflecToLumFunctorType; + typedef Functor::RadianceToImageImageFunctor<TInput, TOutput> LumToImFunctorType; + typedef Functor::ReflectanceToRadianceImageFunctor<TInput, TOutput> ReflecToLumFunctorType; void SetAlpha(double alpha) { @@ -116,8 +116,8 @@ private: * retrieved automatically from the metadata * * \ingroup ReflectanceToImageImageFunctor - * \ingroup LuminanceToImageImageFilter - * \ingroup ReflectanceToLuminanceImageFilter + * \ingroup RadianceToImageImageFilter + * \ingroup ReflectanceToRadianceImageFilter * \ingroup Radiometry * * \ingroup OTBOpticalCalibration diff --git a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToLuminanceImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToRadianceImageFilter.h similarity index 88% rename from Modules/Radiometry/OpticalCalibration/include/otbReflectanceToLuminanceImageFilter.h rename to Modules/Radiometry/OpticalCalibration/include/otbReflectanceToRadianceImageFilter.h index be524148c3155e0dab067dc0b8fc35e60fc87be7..69352382feae6b50c9679f93586b71cedb6366d0 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToLuminanceImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToRadianceImageFilter.h @@ -19,8 +19,8 @@ * limitations under the License. */ -#ifndef otbReflectanceToLuminanceImageFilter_h -#define otbReflectanceToLuminanceImageFilter_h +#ifndef otbReflectanceToRadianceImageFilter_h +#define otbReflectanceToRadianceImageFilter_h #include "otbVarSol.h" #include "otbUnaryImageFunctorWithVectorImageFilter.h" @@ -34,14 +34,14 @@ namespace otb namespace Functor { /** - * \class ReflectanceToLuminanceImageFunctor - * \brief Compupute luminance from the reflectance value + * \class ReflectanceToRadianceImageFunctor + * \brief Compute radiance from the reflectance value * * Divide by Pi and multiply by an illumination correction coefficient * and the given solar illumination. * * - * \sa ReflectanceToLuminanceImageFilter + * \sa ReflectanceToRadianceImageFilter * * \ingroup Functor * \ingroup Radiometry @@ -50,15 +50,15 @@ namespace Functor * \ingroup OTBOpticalCalibration */ template <class TInput, class TOutput> -class ReflectanceToLuminanceImageFunctor +class ReflectanceToRadianceImageFunctor { public: - ReflectanceToLuminanceImageFunctor() : + ReflectanceToRadianceImageFunctor() : m_SolarIllumination(1.0), m_IlluminationCorrectionCoefficient(1.0) {} - virtual ~ReflectanceToLuminanceImageFunctor() {} + virtual ~ReflectanceToRadianceImageFunctor() {} void SetSolarIllumination(double solarIllumination) { @@ -97,17 +97,17 @@ private: }; } -/** \class ReflectanceToLuminanceImageFilter - * \brief Convert reflectance value into luminance value +/** \class ReflectanceToRadianceImageFilter + * \brief Convert reflectance value into radiance value * - * Transform a reflectance image into the luminance. For this it uses the - * functor ReflectanceToLuminanceImageFunctor calling for each component of each pixel. + * Transform a reflectance image into the radiance. For this it uses the + * functor ReflectanceToRadianceImageFunctor calling for each component of each pixel. * * * For Spot image in the dimap format, the correction parameters are * retrieved automatically from the metadata * - * \ingroup ImageToLuminanceImageFunctor + * \ingroup ImageToRadianceImageFunctor * \ingroup Radiometry * * \example Radiometry/AtmosphericCorrectionSequencement.cxx @@ -115,10 +115,10 @@ private: * \ingroup OTBOpticalCalibration */ template <class TInputImage, class TOutputImage> -class ITK_EXPORT ReflectanceToLuminanceImageFilter : +class ITK_EXPORT ReflectanceToRadianceImageFilter : public UnaryImageFunctorWithVectorImageFilter<TInputImage, TOutputImage, - typename Functor::ReflectanceToLuminanceImageFunctor<typename + typename Functor::ReflectanceToRadianceImageFunctor<typename TInputImage:: InternalPixelType, typename @@ -133,12 +133,12 @@ public: /** "typedef" to simplify the variables definition and the declaration. */ typedef TInputImage InputImageType; typedef TOutputImage OutputImageType; - typedef typename Functor::ReflectanceToLuminanceImageFunctor<typename InputImageType::InternalPixelType, + typedef typename Functor::ReflectanceToRadianceImageFunctor<typename InputImageType::InternalPixelType, typename OutputImageType::InternalPixelType> FunctorType; /** "typedef" for standard classes. */ - typedef ReflectanceToLuminanceImageFilter Self; + typedef ReflectanceToRadianceImageFilter Self; typedef UnaryImageFunctorWithVectorImageFilter<InputImageType, OutputImageType, FunctorType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -147,7 +147,7 @@ public: itkNewMacro(Self); /** return class name. */ - itkTypeMacro(ReflectanceToLuminanceImageFilter, UnaryImageFunctorWithVectorImageFiltermageFilter); + itkTypeMacro(ReflectanceToRadianceImageFilter, UnaryImageFunctorWithVectorImageFiltermageFilter); /** Supported images definition. */ typedef typename InputImageType::PixelType InputPixelType; @@ -220,7 +220,7 @@ public: protected: /** Constructor */ - ReflectanceToLuminanceImageFilter() : + ReflectanceToRadianceImageFilter() : m_ZenithalSolarAngle(120.0), //invalid value which will lead to negative radiometry m_FluxNormalizationCoefficient(1.), m_Day(0), @@ -231,7 +231,7 @@ protected: }; /** Destructor */ - ~ReflectanceToLuminanceImageFilter() ITK_OVERRIDE {} + ~ReflectanceToRadianceImageFilter() ITK_OVERRIDE {} /** Update the functor list and input parameters */ void BeforeThreadedGenerateData(void) ITK_OVERRIDE diff --git a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.h index bf354881adb00d955b719c4ada42bf48f172d274..7fc9c223503f3d4f51da64949e15efb3f3297740 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.h @@ -119,7 +119,7 @@ private: * * \ingroup AtmosphericRadiativeTerms * \ingroup AtmosphericCorrectionParameters - * \ingroup LuminanceToReflectanceImageFilter + * \ingroup RadianceToReflectanceImageFilter * \ingroup ImageToReflectanceImageFilter * \ingroup ImageMetadataCorrectionParameters * \ingroup otbRadiometryCorrectionParametersToAtmosphericRadiativeTerms diff --git a/Modules/Radiometry/OpticalCalibration/otb-module.cmake b/Modules/Radiometry/OpticalCalibration/otb-module.cmake index 0df5e31decf78485c15018253a9ebd89015385a2..104d2b013b27cc66de92d43cb596f07629804ce7 100644 --- a/Modules/Radiometry/OpticalCalibration/otb-module.cmake +++ b/Modules/Radiometry/OpticalCalibration/otb-module.cmake @@ -18,7 +18,7 @@ # limitations under the License. # -set(DOCUMENTATION "Digital number to luminance correction. luminance to +set(DOCUMENTATION "Digital number to radiance correction. radiance to refletance image conversion. atmospheric correction for TOA (top of atmosphere) to TOC (top of canopy) reflectance estimation. correction of the adjacency effects taking into account the neighborhood contribution.") diff --git a/Modules/Radiometry/OpticalCalibration/test/CMakeLists.txt b/Modules/Radiometry/OpticalCalibration/test/CMakeLists.txt index dc0a87b1ec54d0fbce0e2e5e1b706cd73273f6dc..a835c8048cd531fa177fcb8b85743a1580e2bd1b 100644 --- a/Modules/Radiometry/OpticalCalibration/test/CMakeLists.txt +++ b/Modules/Radiometry/OpticalCalibration/test/CMakeLists.txt @@ -24,14 +24,14 @@ set(OTBOpticalCalibrationTests otbOpticalCalibrationTestDriver.cxx otbSpectralSensitivityReaderTest.cxx otbReflectanceToImageImageFilter.cxx -otbReflectanceToLuminanceImageFilterNew.cxx -otbLuminanceToReflectanceImageFilterNew.cxx -otbLuminanceToReflectanceImageFilterAuto.cxx -otbImageToLuminanceImageFilterNew.cxx +otbReflectanceToRadianceImageFilterNew.cxx +otbRadianceToReflectanceImageFilterNew.cxx +otbRadianceToReflectanceImageFilterAuto.cxx +otbImageToRadianceImageFilterNew.cxx otbRadiometryCorrectionParametersToAtmosphericRadiativeTermsNew.cxx -otbLuminanceToImageImageFilterAuto.cxx -otbLuminanceToImageImageFilterNew.cxx -otbReflectanceToLuminanceImageFilterAuto.cxx +otbRadianceToImageImageFilterAuto.cxx +otbRadianceToImageImageFilterNew.cxx +otbReflectanceToRadianceImageFilterAuto.cxx otbAeronetExtractDataBadData.cxx otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter.cxx otbRadiometryCorrectionParametersToAtmosphericRadiativeTerms.cxx @@ -42,21 +42,21 @@ otbImageToReflectanceImageFilterNew.cxx otbWavelengthSpectralBandsTest.cxx otbAtmosphericRadiativeTermsTest.cxx otbImageToReflectanceImageFilter.cxx -otbLuminanceToReflectanceImageFilter.cxx +otbRadianceToReflectanceImageFilter.cxx otbReflectanceToImageImageFilterAuto.cxx otbAeronetNew.cxx otbAeronetExtractData.cxx otbReflectanceToSurfaceReflectanceImageFilterTest.cxx otbImageMetadataCorrectionParametersNew.cxx -otbImageToLuminanceImageFilterAuto.cxx +otbImageToRadianceImageFilterAuto.cxx otbAtmosphericCorrectionSequencement.cxx otbSIXSTraitsTest.cxx otbSIXSTraitsComputeAtmosphericParameters.cxx otbReflectanceToImageImageFilterNew.cxx otbSurfaceAdjacencyEffectCorrectionSchemeFilter.cxx -otbLuminanceToImageImageFilter.cxx -otbReflectanceToLuminanceImageFilter.cxx -otbImageToLuminanceImageFilter.cxx +otbRadianceToImageImageFilter.cxx +otbReflectanceToRadianceImageFilter.cxx +otbImageToRadianceImageFilter.cxx ) add_executable(otbOpticalCalibrationTestDriver ${OTBOpticalCalibrationTests}) @@ -170,80 +170,80 @@ otb_add_test(NAME raTvRomaniaReflectanceToImage COMMAND otbOpticalCalibrationTes 0.9889145564708814 #= sqrt(0.977952) d/d0 corresponding to the date 03/05 ) -otb_add_test(NAME raTuReflectanceToLuminanceImageFilterNew COMMAND otbOpticalCalibrationTestDriver - otbReflectanceToLuminanceImageFilterNew +otb_add_test(NAME raTuReflectanceToRadianceImageFilterNew COMMAND otbOpticalCalibrationTestDriver + otbReflectanceToRadianceImageFilterNew ) -otb_add_test(NAME raTuLuminanceToReflectanceImageFilterNew COMMAND otbOpticalCalibrationTestDriver - otbLuminanceToReflectanceImageFilterNew +otb_add_test(NAME raTuRadianceToReflectanceImageFilterNew COMMAND otbOpticalCalibrationTestDriver + otbRadianceToReflectanceImageFilterNew ) -otb_add_test(NAME raTvLuminanceToReflectanceImageFilterAutoQuickbirdPAN COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoQuickbirdPAN.tif - ${TEMP}/raTvLuminanceToReflectanceImageFilterAutoQuickbirdPAN.tif - otbLuminanceToReflectanceImageFilterAuto +otb_add_test(NAME raTvRadianceToReflectanceImageFilterAutoQuickbirdPAN COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvRadianceToReflectanceImageFilterAutoQuickbirdPAN.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterAutoQuickbirdPAN.tif + otbRadianceToReflectanceImageFilterAuto LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF} - ${TEMP}/raTvLuminanceToReflectanceImageFilterAutoQuickbirdPAN.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterAutoQuickbirdPAN.tif ) -otb_add_test(NAME raTvLuminanceToReflectanceImageFilterAutoWV2PAN COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoWV2PAN.tif - ${TEMP}/raTvLuminanceToReflectanceImageFilterAutoWV2PAN.tif - otbLuminanceToReflectanceImageFilterAuto +otb_add_test(NAME raTvRadianceToReflectanceImageFilterAutoWV2PAN COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvRadianceToReflectanceImageFilterAutoWV2PAN.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterAutoWV2PAN.tif + otbRadianceToReflectanceImageFilterAuto LARGEINPUT{WORLDVIEW2/ROME/WV-2_standard_8band_bundle_16bit/052298844010_01_P001_PAN/09DEC10103019-P2AS-052298844010_01_P001.TIF} - ${TEMP}/raTvLuminanceToReflectanceImageFilterAutoWV2PAN.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterAutoWV2PAN.tif ) -otb_add_test(NAME raTvLuminanceToReflectanceImageFilterAutoSpot5 COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoSpot5.tif - ${TEMP}/raTvLuminanceToReflectanceImageFilterAutoSpot5.img - otbLuminanceToReflectanceImageFilterAuto +otb_add_test(NAME raTvRadianceToReflectanceImageFilterAutoSpot5 COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvRadianceToReflectanceImageFilterAutoSpot5.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterAutoSpot5.img + otbRadianceToReflectanceImageFilterAuto LARGEINPUT{SPOT5/TEHERAN/IMAGERY.TIF} - ${TEMP}/raTvLuminanceToReflectanceImageFilterAutoSpot5.img + ${TEMP}/raTvRadianceToReflectanceImageFilterAutoSpot5.img ) -otb_add_test(NAME raTvLuminanceToReflectanceImageFilterAutoIkonos COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoIkonos.tif - ${TEMP}/raTvLuminanceToReflectanceImageFilterAutoIkonos.tif - otbLuminanceToReflectanceImageFilterAuto +otb_add_test(NAME raTvRadianceToReflectanceImageFilterAutoIkonos COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvRadianceToReflectanceImageFilterAutoIkonos.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterAutoIkonos.tif + otbRadianceToReflectanceImageFilterAuto LARGEINPUT{IKONOS/BLOSSEVILLE/po_2619900_pan_0000000.tif} - ${TEMP}/raTvLuminanceToReflectanceImageFilterAutoIkonos.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterAutoIkonos.tif ) -otb_add_test(NAME raTvLuminanceToReflectanceImageFilterAutoWV2MULTI COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoWV2Multi.tif - ${TEMP}/raTvLuminanceToReflectanceImageFilterAutoWV2Multi.tif - otbLuminanceToReflectanceImageFilterAuto +otb_add_test(NAME raTvRadianceToReflectanceImageFilterAutoWV2MULTI COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvRadianceToReflectanceImageFilterAutoWV2Multi.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterAutoWV2Multi.tif + otbRadianceToReflectanceImageFilterAuto LARGEINPUT{WORLDVIEW2/ROME/WV-2_standard_8band_bundle_16bit/052298844010_01_P001_MUL/09DEC10103019-M2AS-052298844010_01_P001.TIF} - ${TEMP}/raTvLuminanceToReflectanceImageFilterAutoWV2Multi.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterAutoWV2Multi.tif ) -otb_add_test(NAME raTvLuminanceToReflectanceImageFilterAutoQuickbirdXS COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoQuickbirdXS.tif - ${TEMP}/raTvLuminanceToReflectanceImageFilterAutoQuickbirdXS.tif - otbLuminanceToReflectanceImageFilterAuto +otb_add_test(NAME raTvRadianceToReflectanceImageFilterAutoQuickbirdXS COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvRadianceToReflectanceImageFilterAutoQuickbirdXS.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterAutoQuickbirdXS.tif + otbRadianceToReflectanceImageFilterAuto LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_MUL/02APR01105228-M1BS-000000128955_01_P001.TIF} - ${TEMP}/raTvLuminanceToReflectanceImageFilterAutoQuickbirdXS.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterAutoQuickbirdXS.tif ) -otb_add_test(NAME raTvLuminanceToReflectanceImageFilterAutoFORMOSAT COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoFormosat.tif - ${TEMP}/raTvLuminanceToReflectanceImageFilterAutoFormosat.img - otbLuminanceToReflectanceImageFilterAuto +otb_add_test(NAME raTvRadianceToReflectanceImageFilterAutoFORMOSAT COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvRadianceToReflectanceImageFilterAutoFormosat.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterAutoFormosat.img + otbRadianceToReflectanceImageFilterAuto LARGEINPUT{FORMOSAT/Sudouest_20071013_MS_fmsat/IMAGERY.TIF} - ${TEMP}/raTvLuminanceToReflectanceImageFilterAutoFormosat.img + ${TEMP}/raTvRadianceToReflectanceImageFilterAutoFormosat.img ) -otb_add_test(NAME raTuImageToLuminanceImageFilterNew COMMAND otbOpticalCalibrationTestDriver - otbImageToLuminanceImageFilterNew +otb_add_test(NAME raTuImageToRadianceImageFilterNew COMMAND otbOpticalCalibrationTestDriver + otbImageToRadianceImageFilterNew ) otb_add_test(NAME raTuRadiometryCorrectionParametersToAtmosphericRadiativeTermsNew COMMAND otbOpticalCalibrationTestDriver otbRadiometryCorrectionParametersToAtmosphericRadiativeTermsNew) -otb_add_test(NAME raTuLuminanceToImageImageFilterNew COMMAND otbOpticalCalibrationTestDriver - otbLuminanceToImageImageFilterNew +otb_add_test(NAME raTuRadianceToImageImageFilterNew COMMAND otbOpticalCalibrationTestDriver + otbRadianceToImageImageFilterNew ) #FIXME Those tests have performing local copies of header, baselines...They were migrate "as it" for now in version 5.0 but @@ -256,16 +256,16 @@ if(OTB_DATA_USE_LARGEINPUT AND OTB_DATA_ROOT) set(MTDATADIR ${OTB_DATA_LARGEINPUT_ROOT}/QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN) file(GLOB MTDATA ${MTDATADIR}/*TIL ${MTDATADIR}/*RPB ${MTDATADIR}/*XML ${MTDATADIR}/*IMD) file(COPY ${MTDATA} DESTINATION ${TOULOUSEQBDIR}) - otb_copy_rename(${BASELINE}/raTvImageToLuminanceImageFilterAutoQuickbirdPAN.tif ${TOULOUSEQBDIR}/02APR01105228-P1BS-000000128955_01_P001.TIF) + otb_copy_rename(${BASELINE}/raTvImageToRadianceImageFilterAutoQuickbirdPAN.tif ${TOULOUSEQBDIR}/02APR01105228-P1BS-000000128955_01_P001.TIF) - otb_add_test(NAME raTvLuminanceToImageImageFilterAutoQuickbirdPAN COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${TOULOUSEQBDIR}/raTvSMALLTOULOUSELuminanceToImageImageFilterAutoQuickbirdPAN.tif - ${TOULOUSEQBDIR}/raTvLuminanceToImageImageFilterAutoQuickbirdPAN.tif - otbLuminanceToImageImageFilterAuto + otb_add_test(NAME raTvRadianceToImageImageFilterAutoQuickbirdPAN COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${TOULOUSEQBDIR}/raTvSMALLTOULOUSERadianceToImageImageFilterAutoQuickbirdPAN.tif + ${TOULOUSEQBDIR}/raTvRadianceToImageImageFilterAutoQuickbirdPAN.tif + otbRadianceToImageImageFilterAuto ${TOULOUSEQBDIR}/02APR01105228-P1BS-000000128955_01_P001.TIF LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF} - ${TOULOUSEQBDIR}/raTvLuminanceToImageImageFilterAutoQuickbirdPAN.tif - ${TOULOUSEQBDIR}/raTvSMALLTOULOUSELuminanceToImageImageFilterAutoQuickbirdPAN.tif + ${TOULOUSEQBDIR}/raTvRadianceToImageImageFilterAutoQuickbirdPAN.tif + ${TOULOUSEQBDIR}/raTvSMALLTOULOUSERadianceToImageImageFilterAutoQuickbirdPAN.tif ) @@ -274,16 +274,16 @@ if(OTB_DATA_USE_LARGEINPUT AND OTB_DATA_ROOT) set(MTDATADIR ${OTB_DATA_LARGEINPUT_ROOT}/QUICKBIRD/TOULOUSE/000000128955_01_P001_MUL) file(GLOB MTDATA ${MTDATADIR}/*TIL ${MTDATADIR}/*RPB ${MTDATADIR}/*XML ${MTDATADIR}/*IMD) file(COPY ${MTDATA} DESTINATION ${TOULOUSEQBDIR}) - otb_copy_rename(${BASELINE}/raTvImageToLuminanceImageFilterAutoQuickbirdXS.tif ${TOULOUSEQBDIR}/02APR01105228-M1BS-000000128955_01_P001.TIF) + otb_copy_rename(${BASELINE}/raTvImageToRadianceImageFilterAutoQuickbirdXS.tif ${TOULOUSEQBDIR}/02APR01105228-M1BS-000000128955_01_P001.TIF) - otb_add_test(NAME raTvLuminanceToImageImageFilterAutoQuickbirdXS COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${TOULOUSEQBDIR}/raTvSMALLTOULOUSELuminanceToImageImageFilterAutoQuickbirdXS.tif - ${TOULOUSEQBDIR}/raTvLuminanceToImageImageFilterAutoQuickbirdXS.tif - otbLuminanceToImageImageFilterAuto + otb_add_test(NAME raTvRadianceToImageImageFilterAutoQuickbirdXS COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${TOULOUSEQBDIR}/raTvSMALLTOULOUSERadianceToImageImageFilterAutoQuickbirdXS.tif + ${TOULOUSEQBDIR}/raTvRadianceToImageImageFilterAutoQuickbirdXS.tif + otbRadianceToImageImageFilterAuto ${TOULOUSEQBDIR}/02APR01105228-M1BS-000000128955_01_P001.TIF LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_MUL/02APR01105228-M1BS-000000128955_01_P001.TIF} - ${TOULOUSEQBDIR}/raTvLuminanceToImageImageFilterAutoQuickbirdXS.tif - ${TOULOUSEQBDIR}/raTvSMALLTOULOUSELuminanceToImageImageFilterAutoQuickbirdXS.tif + ${TOULOUSEQBDIR}/raTvRadianceToImageImageFilterAutoQuickbirdXS.tif + ${TOULOUSEQBDIR}/raTvSMALLTOULOUSERadianceToImageImageFilterAutoQuickbirdXS.tif ) set(ROMEWV2DIR ${TEMP}/OpticalCalibLumToImWv2MULTI) @@ -291,48 +291,48 @@ if(OTB_DATA_USE_LARGEINPUT AND OTB_DATA_ROOT) set(MTDATADIR ${OTB_DATA_LARGEINPUT_ROOT}/WORLDVIEW2/ROME/WV-2_standard_8band_bundle_16bit/052298844010_01_P001_MUL) file(GLOB MTDATA ${MTDATADIR}/*TIL ${MTDATADIR}/*RPB ${MTDATADIR}/*XML ${MTDATADIR}/*IMD) file(COPY ${MTDATA} DESTINATION ${ROMEWV2DIR}) - otb_copy_rename(${BASELINE}/raTvImageToLuminanceImageFilterAutoWV2Multi.tif ${ROMEWV2DIR}/09DEC10103019-M2AS-052298844010_01_P001.TIF) + otb_copy_rename(${BASELINE}/raTvImageToRadianceImageFilterAutoWV2Multi.tif ${ROMEWV2DIR}/09DEC10103019-M2AS-052298844010_01_P001.TIF) - otb_add_test(NAME raTvLuminanceToImageImageFilterAutoWV2MULTI COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${ROMEWV2DIR}/raTvSMALLROMELuminanceToImageImageFilterAutoWV2Multi.tif - ${ROMEWV2DIR}/raTvLuminanceToImageImageFilterAutoWV2Multi.tif - otbLuminanceToImageImageFilterAuto + otb_add_test(NAME raTvRadianceToImageImageFilterAutoWV2MULTI COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${ROMEWV2DIR}/raTvSMALLROMERadianceToImageImageFilterAutoWV2Multi.tif + ${ROMEWV2DIR}/raTvRadianceToImageImageFilterAutoWV2Multi.tif + otbRadianceToImageImageFilterAuto ${ROMEWV2DIR}/09DEC10103019-M2AS-052298844010_01_P001.TIF LARGEINPUT{WORLDVIEW2/ROME/WV-2_standard_8band_bundle_16bit/052298844010_01_P001_MUL/09DEC10103019-M2AS-052298844010_01_P001.TIF} - ${ROMEWV2DIR}/raTvLuminanceToImageImageFilterAutoWV2Multi.tif - ${ROMEWV2DIR}/raTvSMALLROMELuminanceToImageImageFilterAutoWV2Multi.tif + ${ROMEWV2DIR}/raTvRadianceToImageImageFilterAutoWV2Multi.tif + ${ROMEWV2DIR}/raTvSMALLROMERadianceToImageImageFilterAutoWV2Multi.tif ) set(BLOSSEVILLEIKONOSDIR ${TEMP}/OpticalCalibLumToImIkonos) file(MAKE_DIRECTORY ${BLOSSEVILLEIKONOSDIR}) file(GLOB MTDATA ${OTB_DATA_LARGEINPUT_ROOT}/IKONOS/BLOSSEVILLE/*metadata.txt ${OTB_DATA_LARGEINPUT_ROOT}/IKONOS/BLOSSEVILLE/*pan*) file(COPY ${MTDATA} DESTINATION ${BLOSSEVILLEIKONOSDIR}) - otb_copy_rename(${BASELINE}/raTvImageToLuminanceImageFilterAutoIkonos.tif ${BLOSSEVILLEIKONOSDIR}/po_2619900_pan_0000000.tif) + otb_copy_rename(${BASELINE}/raTvImageToRadianceImageFilterAutoIkonos.tif ${BLOSSEVILLEIKONOSDIR}/po_2619900_pan_0000000.tif) - otb_add_test(NAME raTvLuminanceToImageImageFilterAutoIkonos COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BLOSSEVILLEIKONOSDIR}/raTvSMALLBLOSSEVILLELuminanceToImageImageFilterAutoIkonos.tif - ${BLOSSEVILLEIKONOSDIR}/raTvLuminanceToImageImageFilterAutoIkonos.tif - otbLuminanceToImageImageFilterAuto + otb_add_test(NAME raTvRadianceToImageImageFilterAutoIkonos COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BLOSSEVILLEIKONOSDIR}/raTvSMALLBLOSSEVILLERadianceToImageImageFilterAutoIkonos.tif + ${BLOSSEVILLEIKONOSDIR}/raTvRadianceToImageImageFilterAutoIkonos.tif + otbRadianceToImageImageFilterAuto ${BLOSSEVILLEIKONOSDIR}/po_2619900_pan_0000000.tif LARGEINPUT{IKONOS/BLOSSEVILLE/po_2619900_pan_0000000.tif} - ${BLOSSEVILLEIKONOSDIR}/raTvLuminanceToImageImageFilterAutoIkonos.tif - ${BLOSSEVILLEIKONOSDIR}/raTvSMALLBLOSSEVILLELuminanceToImageImageFilterAutoIkonos.tif + ${BLOSSEVILLEIKONOSDIR}/raTvRadianceToImageImageFilterAutoIkonos.tif + ${BLOSSEVILLEIKONOSDIR}/raTvSMALLBLOSSEVILLERadianceToImageImageFilterAutoIkonos.tif ) set(TEHERANSPOT5DIR ${TEMP}/OpticalCalibLumToImSPOT5) file(MAKE_DIRECTORY ${TEHERANSPOT5DIR}) file(GLOB MTDATA ${OTB_DATA_LARGEINPUT_ROOT}/SPOT5/TEHERAN/*.DIM) file(COPY ${MTDATA} DESTINATION ${TEHERANSPOT5DIR}) - otb_copy_rename(${BASELINE}/raTvImageToLuminanceImageFilterAutoSpot5.tif ${TEHERANSPOT5DIR}/IMAGERY.TIF) + otb_copy_rename(${BASELINE}/raTvImageToRadianceImageFilterAutoSpot5.tif ${TEHERANSPOT5DIR}/IMAGERY.TIF) - otb_add_test(NAME raTvLuminanceToImageImageFilterAutoSpot5 COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${TEHERANSPOT5DIR}/raTvSMALLTEHERANLuminanceToImageImageFilterAutoSpot5.img - ${TEHERANSPOT5DIR}/raTvLuminanceToImageImageFilterAutoSpot5.tif - otbLuminanceToImageImageFilterAuto + otb_add_test(NAME raTvRadianceToImageImageFilterAutoSpot5 COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${TEHERANSPOT5DIR}/raTvSMALLTEHERANRadianceToImageImageFilterAutoSpot5.img + ${TEHERANSPOT5DIR}/raTvRadianceToImageImageFilterAutoSpot5.tif + otbRadianceToImageImageFilterAuto ${TEHERANSPOT5DIR}/IMAGERY.TIF LARGEINPUT{SPOT5/TEHERAN/IMAGERY.TIF} - ${TEHERANSPOT5DIR}/raTvLuminanceToImageImageFilterAutoSpot5.tif - ${TEHERANSPOT5DIR}/raTvSMALLTEHERANLuminanceToImageImageFilterAutoSpot5.img + ${TEHERANSPOT5DIR}/raTvRadianceToImageImageFilterAutoSpot5.tif + ${TEHERANSPOT5DIR}/raTvSMALLTEHERANRadianceToImageImageFilterAutoSpot5.img ) set(ROMEWV2DIR ${TEMP}/OpticalCalibLumToImWv2PAN) @@ -340,16 +340,16 @@ if(OTB_DATA_USE_LARGEINPUT AND OTB_DATA_ROOT) set(MTDATADIR ${OTB_DATA_LARGEINPUT_ROOT}/WORLDVIEW2/ROME/WV-2_standard_8band_bundle_16bit/052298844010_01_P001_PAN) file(GLOB MTDATA ${MTDATADIR}/*TIL ${MTDATADIR}/*RPB ${MTDATADIR}/*XML ${MTDATADIR}/*IMD) file(COPY ${MTDATA} DESTINATION ${ROMEWV2DIR}) - otb_copy_rename(${BASELINE}/raTvImageToLuminanceImageFilterAutoWV2PAN.tif ${ROMEWV2DIR}/09DEC10103019-P2AS-052298844010_01_P001.TIF) + otb_copy_rename(${BASELINE}/raTvImageToRadianceImageFilterAutoWV2PAN.tif ${ROMEWV2DIR}/09DEC10103019-P2AS-052298844010_01_P001.TIF) - otb_add_test(NAME raTvLuminanceToImageImageFilterAutoWV2PAN COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${ROMEWV2DIR}/raTvSMALLROMELuminanceToImageImageFilterAutoWV2PAN.tif - ${ROMEWV2DIR}/raTvLuminanceToImageImageFilterAutoWV2PAN.tif - otbLuminanceToImageImageFilterAuto + otb_add_test(NAME raTvRadianceToImageImageFilterAutoWV2PAN COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${ROMEWV2DIR}/raTvSMALLROMERadianceToImageImageFilterAutoWV2PAN.tif + ${ROMEWV2DIR}/raTvRadianceToImageImageFilterAutoWV2PAN.tif + otbRadianceToImageImageFilterAuto ${ROMEWV2DIR}/09DEC10103019-P2AS-052298844010_01_P001.TIF LARGEINPUT{WORLDVIEW2/ROME/WV-2_standard_8band_bundle_16bit/052298844010_01_P001_PAN/09DEC10103019-P2AS-052298844010_01_P001.TIF} - ${ROMEWV2DIR}/raTvLuminanceToImageImageFilterAutoWV2PAN.tif - ${ROMEWV2DIR}/raTvSMALLROMELuminanceToImageImageFilterAutoWV2PAN.tif + ${ROMEWV2DIR}/raTvRadianceToImageImageFilterAutoWV2PAN.tif + ${ROMEWV2DIR}/raTvSMALLROMERadianceToImageImageFilterAutoWV2PAN.tif ) set(SUDOUESTFORMOSATDIR ${TEMP}/OpticalCalibLumToImFormosat) @@ -357,16 +357,16 @@ if(OTB_DATA_USE_LARGEINPUT AND OTB_DATA_ROOT) set(MTDATADIR ${OTB_DATA_LARGEINPUT_ROOT}/FORMOSAT/Sudouest_20071013_MS_fmsat) file(GLOB MTDATA ${MTDATADIR}/*.DIM) file(COPY ${MTDATA} DESTINATION ${SUDOUESTFORMOSATDIR}) - otb_copy_rename(${BASELINE}/raTvImageToLuminanceImageFilterAutoFormosat.tif ${SUDOUESTFORMOSATDIR}/IMAGERY.TIF) + otb_copy_rename(${BASELINE}/raTvImageToRadianceImageFilterAutoFormosat.tif ${SUDOUESTFORMOSATDIR}/IMAGERY.TIF) - otb_add_test(NAME raTvLuminanceToImageImageFilterAutoFORMOSAT COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${SUDOUESTFORMOSATDIR}/raTvSMALLSOLuminanceToImageImageFilterAutoFormosat.img - ${SUDOUESTFORMOSATDIR}/raTvLuminanceToImageImageFilterAutoFormosat.tif - otbLuminanceToImageImageFilterAuto + otb_add_test(NAME raTvRadianceToImageImageFilterAutoFORMOSAT COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${SUDOUESTFORMOSATDIR}/raTvSMALLSORadianceToImageImageFilterAutoFormosat.img + ${SUDOUESTFORMOSATDIR}/raTvRadianceToImageImageFilterAutoFormosat.tif + otbRadianceToImageImageFilterAuto ${SUDOUESTFORMOSATDIR}/IMAGERY.TIF LARGEINPUT{FORMOSAT/Sudouest_20071013_MS_fmsat/IMAGERY.TIF} - ${SUDOUESTFORMOSATDIR}/raTvLuminanceToImageImageFilterAutoFormosat.tif - ${SUDOUESTFORMOSATDIR}/raTvSMALLSOLuminanceToImageImageFilterAutoFormosat.img + ${SUDOUESTFORMOSATDIR}/raTvRadianceToImageImageFilterAutoFormosat.tif + ${SUDOUESTFORMOSATDIR}/raTvSMALLSORadianceToImageImageFilterAutoFormosat.img ) set(TOULOUSEQBDIR ${TEMP}/OpticalCalibRefToLumQBPAN) @@ -374,14 +374,14 @@ if(OTB_DATA_USE_LARGEINPUT AND OTB_DATA_ROOT) set(MTDATADIR ${OTB_DATA_LARGEINPUT_ROOT}/QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN) file(GLOB MTDATA ${MTDATADIR}/*TIL ${MTDATADIR}/*RPB ${MTDATADIR}/*XML ${MTDATADIR}/*IMD) file(COPY ${MTDATA} DESTINATION ${TOULOUSEQBDIR}) - otb_copy_rename(${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoQuickbirdPAN.tif ${TOULOUSEQBDIR}/02APR01105228-P1BS-000000128955_01_P001.TIF) + otb_copy_rename(${BASELINE}/raTvRadianceToReflectanceImageFilterAutoQuickbirdPAN.tif ${TOULOUSEQBDIR}/02APR01105228-P1BS-000000128955_01_P001.TIF) - otb_add_test(NAME raTvReflectanceToLuminanceImageFilterAutoQuickbirdPAN COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToLuminanceImageFilterAutoQuickbirdPAN.tif - ${TOULOUSEQBDIR}/raTvReflectanceToLuminanceImageFilterAutoQuickbirdPAN.tif - otbReflectanceToLuminanceImageFilterAuto + otb_add_test(NAME raTvReflectanceToRadianceImageFilterAutoQuickbirdPAN COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToRadianceImageFilterAutoQuickbirdPAN.tif + ${TOULOUSEQBDIR}/raTvReflectanceToRadianceImageFilterAutoQuickbirdPAN.tif + otbReflectanceToRadianceImageFilterAuto ${TOULOUSEQBDIR}/02APR01105228-P1BS-000000128955_01_P001.TIF - ${TOULOUSEQBDIR}/raTvReflectanceToLuminanceImageFilterAutoQuickbirdPAN.tif + ${TOULOUSEQBDIR}/raTvReflectanceToRadianceImageFilterAutoQuickbirdPAN.tif ) set(ROMEWV2DIR ${TEMP}/OpticalCalibRefToLumWv2PAN) @@ -389,42 +389,42 @@ if(OTB_DATA_USE_LARGEINPUT AND OTB_DATA_ROOT) set(MTDATADIR ${OTB_DATA_LARGEINPUT_ROOT}/WORLDVIEW2/ROME/WV-2_standard_8band_bundle_16bit/052298844010_01_P001_PAN) file(GLOB MTDATA ${MTDATADIR}/*TIL ${MTDATADIR}/*RPB ${MTDATADIR}/*XML ${MTDATADIR}/*IMD) file(COPY ${MTDATA} DESTINATION ${ROMEWV2DIR}) - otb_copy_rename(${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoWV2PAN.tif ${ROMEWV2DIR}/09DEC10103019-P2AS-052298844010_01_P001.TIF) + otb_copy_rename(${BASELINE}/raTvRadianceToReflectanceImageFilterAutoWV2PAN.tif ${ROMEWV2DIR}/09DEC10103019-P2AS-052298844010_01_P001.TIF) - otb_add_test(NAME raTvReflectanceToLuminanceImageFilterAutoWV2PAN COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToLuminanceImageFilterAutoWV2PAN.tif - ${ROMEWV2DIR}/raTvReflectanceToLuminanceImageFilterAutoWV2PAN.tif - otbReflectanceToLuminanceImageFilterAuto + otb_add_test(NAME raTvReflectanceToRadianceImageFilterAutoWV2PAN COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToRadianceImageFilterAutoWV2PAN.tif + ${ROMEWV2DIR}/raTvReflectanceToRadianceImageFilterAutoWV2PAN.tif + otbReflectanceToRadianceImageFilterAuto ${ROMEWV2DIR}/09DEC10103019-P2AS-052298844010_01_P001.TIF - ${ROMEWV2DIR}/raTvReflectanceToLuminanceImageFilterAutoWV2PAN.tif + ${ROMEWV2DIR}/raTvReflectanceToRadianceImageFilterAutoWV2PAN.tif ) set(TEHERANSPOT5DIR ${TEMP}/OpticalCalibRefToLumSPOT5) file(MAKE_DIRECTORY ${TEHERANSPOT5DIR}) file(GLOB MTDATA ${OTB_DATA_LARGEINPUT_ROOT}/SPOT5/TEHERAN/*.DIM) file(COPY ${MTDATA} DESTINATION ${TEHERANSPOT5DIR}) - otb_copy_rename(${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoSpot5.tif ${TEHERANSPOT5DIR}/IMAGERY.TIF) + otb_copy_rename(${BASELINE}/raTvRadianceToReflectanceImageFilterAutoSpot5.tif ${TEHERANSPOT5DIR}/IMAGERY.TIF) - otb_add_test(NAME raTvReflectanceToLuminanceImageFilterAutoSpot5 COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToLuminanceImageFilterAutoSpot5.tif - ${TEHERANSPOT5DIR}/raTvReflectanceToLuminanceImageFilterAutoSpot5.img - otbReflectanceToLuminanceImageFilterAuto + otb_add_test(NAME raTvReflectanceToRadianceImageFilterAutoSpot5 COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToRadianceImageFilterAutoSpot5.tif + ${TEHERANSPOT5DIR}/raTvReflectanceToRadianceImageFilterAutoSpot5.img + otbReflectanceToRadianceImageFilterAuto ${TEHERANSPOT5DIR}/IMAGERY.TIF - ${TEHERANSPOT5DIR}/raTvReflectanceToLuminanceImageFilterAutoSpot5.img + ${TEHERANSPOT5DIR}/raTvReflectanceToRadianceImageFilterAutoSpot5.img ) set(BLOSSEVILLEIKONOSDIR ${TEMP}/OpticalCalibRefToLumIkonos) file(MAKE_DIRECTORY ${BLOSSEVILLEIKONOSDIR}) file(GLOB MTDATA ${OTB_DATA_LARGEINPUT_ROOT}/IKONOS/BLOSSEVILLE/*metadata.txt ${OTB_DATA_LARGEINPUT_ROOT}/IKONOS/BLOSSEVILLE/*pan*) file(COPY ${MTDATA} DESTINATION ${BLOSSEVILLEIKONOSDIR}) - otb_copy_rename(${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoIkonos.tif ${BLOSSEVILLEIKONOSDIR}/po_2619900_pan_0000000.tif) + otb_copy_rename(${BASELINE}/raTvRadianceToReflectanceImageFilterAutoIkonos.tif ${BLOSSEVILLEIKONOSDIR}/po_2619900_pan_0000000.tif) - otb_add_test(NAME raTvReflectanceToLuminanceImageFilterAutoIkonos COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToLuminanceImageFilterAutoIkonos.tif - ${BLOSSEVILLEIKONOSDIR}/raTvReflectanceToLuminanceImageFilterAutoIkonos.tif - otbReflectanceToLuminanceImageFilterAuto + otb_add_test(NAME raTvReflectanceToRadianceImageFilterAutoIkonos COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToRadianceImageFilterAutoIkonos.tif + ${BLOSSEVILLEIKONOSDIR}/raTvReflectanceToRadianceImageFilterAutoIkonos.tif + otbReflectanceToRadianceImageFilterAuto ${BLOSSEVILLEIKONOSDIR}/po_2619900_pan_0000000.tif - ${BLOSSEVILLEIKONOSDIR}/raTvReflectanceToLuminanceImageFilterAutoIkonos.tif + ${BLOSSEVILLEIKONOSDIR}/raTvReflectanceToRadianceImageFilterAutoIkonos.tif ) set(TOULOUSEQBDIR ${TEMP}/OpticalCalibRefToLumQBXS) @@ -432,14 +432,14 @@ if(OTB_DATA_USE_LARGEINPUT AND OTB_DATA_ROOT) set(MTDATADIR ${OTB_DATA_LARGEINPUT_ROOT}/QUICKBIRD/TOULOUSE/000000128955_01_P001_MUL) file(GLOB MTDATA ${MTDATADIR}/*TIL ${MTDATADIR}/*RPB ${MTDATADIR}/*XML ${MTDATADIR}/*IMD) file(COPY ${MTDATA} DESTINATION ${TOULOUSEQBDIR}) - otb_copy_rename(${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoQuickbirdXS.tif ${TOULOUSEQBDIR}/02APR01105228-M1BS-000000128955_01_P001.TIF) + otb_copy_rename(${BASELINE}/raTvRadianceToReflectanceImageFilterAutoQuickbirdXS.tif ${TOULOUSEQBDIR}/02APR01105228-M1BS-000000128955_01_P001.TIF) - otb_add_test(NAME raTvReflectanceToLuminanceImageFilterAutoQuickbirdXS COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToLuminanceImageFilterAutoQuickbirdXS.tif - ${TOULOUSEQBDIR}/raTvReflectanceToLuminanceImageFilterAutoQuickbirdXS.tif - otbReflectanceToLuminanceImageFilterAuto + otb_add_test(NAME raTvReflectanceToRadianceImageFilterAutoQuickbirdXS COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToRadianceImageFilterAutoQuickbirdXS.tif + ${TOULOUSEQBDIR}/raTvReflectanceToRadianceImageFilterAutoQuickbirdXS.tif + otbReflectanceToRadianceImageFilterAuto ${TOULOUSEQBDIR}/02APR01105228-M1BS-000000128955_01_P001.TIF - ${TOULOUSEQBDIR}/raTvReflectanceToLuminanceImageFilterAutoQuickbirdXS.tif + ${TOULOUSEQBDIR}/raTvReflectanceToRadianceImageFilterAutoQuickbirdXS.tif ) set(ROMEWV2DIR ${TEMP}/OpticalCalibRefToLumWv2MULTI) @@ -447,14 +447,14 @@ if(OTB_DATA_USE_LARGEINPUT AND OTB_DATA_ROOT) set(MTDATADIR ${OTB_DATA_LARGEINPUT_ROOT}/WORLDVIEW2/ROME/WV-2_standard_8band_bundle_16bit/052298844010_01_P001_MUL) file(GLOB MTDATA ${MTDATADIR}/*TIL ${MTDATADIR}/*RPB ${MTDATADIR}/*XML ${MTDATADIR}/*IMD) file(COPY ${MTDATA} DESTINATION ${ROMEWV2DIR}) - otb_copy_rename(${BASELINE}/raTvLuminanceToReflectanceImageFilterAutoWV2Multi.tif ${ROMEWV2DIR}/09DEC10103019-M2AS-052298844010_01_P001.TIF) + otb_copy_rename(${BASELINE}/raTvRadianceToReflectanceImageFilterAutoWV2Multi.tif ${ROMEWV2DIR}/09DEC10103019-M2AS-052298844010_01_P001.TIF) - otb_add_test(NAME raTvReflectanceToLuminanceImageFilterAutoWV2MULTI COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToLuminanceImageFilterAutoWV2Multi.tif - ${ROMEWV2DIR}/raTvReflectanceToLuminanceImageFilterAutoWV2Multi.tif - otbReflectanceToLuminanceImageFilterAuto + otb_add_test(NAME raTvReflectanceToRadianceImageFilterAutoWV2MULTI COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToRadianceImageFilterAutoWV2Multi.tif + ${ROMEWV2DIR}/raTvReflectanceToRadianceImageFilterAutoWV2Multi.tif + otbReflectanceToRadianceImageFilterAuto ${ROMEWV2DIR}/09DEC10103019-M2AS-052298844010_01_P001.TIF - ${ROMEWV2DIR}/raTvReflectanceToLuminanceImageFilterAutoWV2Multi.tif + ${ROMEWV2DIR}/raTvReflectanceToRadianceImageFilterAutoWV2Multi.tif ) endif() @@ -621,12 +621,12 @@ otb_add_test(NAME raTvRomaniaImageToReflectance COMMAND otbOpticalCalibrationTes 0.9889145564708814 #= sqrt(0.977952) d/d0 corresponding to the date 03/05 ) -otb_add_test(NAME raTvLuminanceToReflectanceImageFilterDayMonth COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvLuminanceToReflectanceImageFilter.tif - ${TEMP}/raTvLuminanceToReflectanceImageFilterDayMonth.tif - otbLuminanceToReflectanceImageFilter +otb_add_test(NAME raTvRadianceToReflectanceImageFilterDayMonth COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvRadianceToReflectanceImageFilter.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterDayMonth.tif + otbRadianceToReflectanceImageFilter ${INPUTDATA}/verySmallFSATSW.tif - ${TEMP}/raTvLuminanceToReflectanceImageFilterDayMonth.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterDayMonth.tif 0.2 #radius 10 #channel 1 illumination 20 #channel 2 illumination @@ -636,12 +636,12 @@ otb_add_test(NAME raTvLuminanceToReflectanceImageFilterDayMonth COMMAND otbOptic 5 #month ) -otb_add_test(NAME raTvLuminanceToReflectanceImageFilter COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvLuminanceToReflectanceImageFilterDsol.tif - ${TEMP}/raTvLuminanceToReflectanceImageFilterDsol.tif - otbLuminanceToReflectanceImageFilter +otb_add_test(NAME raTvRadianceToReflectanceImageFilter COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvRadianceToReflectanceImageFilterDsol.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterDsol.tif + otbRadianceToReflectanceImageFilter ${INPUTDATA}/verySmallFSATSW.tif - ${TEMP}/raTvLuminanceToReflectanceImageFilterDsol.tif + ${TEMP}/raTvRadianceToReflectanceImageFilterDsol.tif 0.2 #radius 10 #channel 1 illumination 20 #channel 2 illumination @@ -748,60 +748,60 @@ otb_add_test(NAME raTuImageMetadataCorrectionParametersNew COMMAND otbOpticalCal otbImageMetadataCorrectionParametersNew ) -otb_add_test(NAME raTvImageToLuminanceImageFilterAutoFORMOSAT COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToLuminanceImageFilterAutoFormosat.tif - ${TEMP}/raTvImageToLuminanceImageFilterAutoFormosat.img - otbImageToLuminanceImageFilterAuto +otb_add_test(NAME raTvImageToRadianceImageFilterAutoFORMOSAT COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToRadianceImageFilterAutoFormosat.tif + ${TEMP}/raTvImageToRadianceImageFilterAutoFormosat.img + otbImageToRadianceImageFilterAuto LARGEINPUT{FORMOSAT/Sudouest_20071013_MS_fmsat/IMAGERY.TIF} - ${TEMP}/raTvImageToLuminanceImageFilterAutoFormosat.img + ${TEMP}/raTvImageToRadianceImageFilterAutoFormosat.img ) -otb_add_test(NAME raTvImageToLuminanceImageFilterAutoIkonos COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToLuminanceImageFilterAutoIkonos.tif - ${TEMP}/raTvImageToLuminanceImageFilterAutoIkonos.tif - otbImageToLuminanceImageFilterAuto +otb_add_test(NAME raTvImageToRadianceImageFilterAutoIkonos COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToRadianceImageFilterAutoIkonos.tif + ${TEMP}/raTvImageToRadianceImageFilterAutoIkonos.tif + otbImageToRadianceImageFilterAuto LARGEINPUT{IKONOS/BLOSSEVILLE/po_2619900_pan_0000000.tif} - ${TEMP}/raTvImageToLuminanceImageFilterAutoIkonos.tif + ${TEMP}/raTvImageToRadianceImageFilterAutoIkonos.tif ) -otb_add_test(NAME raTvImageToLuminanceImageFilterAutoQuickbirdXS COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToLuminanceImageFilterAutoQuickbirdXS.tif - ${TEMP}/raTvImageToLuminanceImageFilterAutoQuickbirdXS.tif - otbImageToLuminanceImageFilterAuto +otb_add_test(NAME raTvImageToRadianceImageFilterAutoQuickbirdXS COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToRadianceImageFilterAutoQuickbirdXS.tif + ${TEMP}/raTvImageToRadianceImageFilterAutoQuickbirdXS.tif + otbImageToRadianceImageFilterAuto LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_MUL/02APR01105228-M1BS-000000128955_01_P001.TIF} - ${TEMP}/raTvImageToLuminanceImageFilterAutoQuickbirdXS.tif + ${TEMP}/raTvImageToRadianceImageFilterAutoQuickbirdXS.tif ) -otb_add_test(NAME raTvImageToLuminanceImageFilterAutoQuickbirdPAN COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToLuminanceImageFilterAutoQuickbirdPAN.tif - ${TEMP}/raTvImageToLuminanceImageFilterAutoQuickbirdPAN.tif - otbImageToLuminanceImageFilterAuto +otb_add_test(NAME raTvImageToRadianceImageFilterAutoQuickbirdPAN COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToRadianceImageFilterAutoQuickbirdPAN.tif + ${TEMP}/raTvImageToRadianceImageFilterAutoQuickbirdPAN.tif + otbImageToRadianceImageFilterAuto LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF} - ${TEMP}/raTvImageToLuminanceImageFilterAutoQuickbirdPAN.tif + ${TEMP}/raTvImageToRadianceImageFilterAutoQuickbirdPAN.tif ) -otb_add_test(NAME raTvImageToLuminanceImageFilterAutoWV2MULTI COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToLuminanceImageFilterAutoWV2Multi.tif - ${TEMP}/raTvImageToLuminanceImageFilterAutoWV2Multi.tif - otbImageToLuminanceImageFilterAuto +otb_add_test(NAME raTvImageToRadianceImageFilterAutoWV2MULTI COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToRadianceImageFilterAutoWV2Multi.tif + ${TEMP}/raTvImageToRadianceImageFilterAutoWV2Multi.tif + otbImageToRadianceImageFilterAuto LARGEINPUT{WORLDVIEW2/ROME/WV-2_standard_8band_bundle_16bit/052298844010_01_P001_MUL/09DEC10103019-M2AS-052298844010_01_P001.TIF} - ${TEMP}/raTvImageToLuminanceImageFilterAutoWV2Multi.tif + ${TEMP}/raTvImageToRadianceImageFilterAutoWV2Multi.tif ) -otb_add_test(NAME raTvImageToLuminanceImageFilterAutoSpot5 COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToLuminanceImageFilterAutoSpot5.tif - ${TEMP}/raTvImageToLuminanceImageFilterAutoSpot5.img - otbImageToLuminanceImageFilterAuto +otb_add_test(NAME raTvImageToRadianceImageFilterAutoSpot5 COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToRadianceImageFilterAutoSpot5.tif + ${TEMP}/raTvImageToRadianceImageFilterAutoSpot5.img + otbImageToRadianceImageFilterAuto LARGEINPUT{SPOT5/TEHERAN/IMAGERY.TIF} - ${TEMP}/raTvImageToLuminanceImageFilterAutoSpot5.img + ${TEMP}/raTvImageToRadianceImageFilterAutoSpot5.img ) -otb_add_test(NAME raTvImageToLuminanceImageFilterAutoWV2PAN COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToLuminanceImageFilterAutoWV2PAN.tif - ${TEMP}/raTvImageToLuminanceImageFilterAutoWV2PAN.tif - otbImageToLuminanceImageFilterAuto +otb_add_test(NAME raTvImageToRadianceImageFilterAutoWV2PAN COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToRadianceImageFilterAutoWV2PAN.tif + ${TEMP}/raTvImageToRadianceImageFilterAutoWV2PAN.tif + otbImageToRadianceImageFilterAuto LARGEINPUT{WORLDVIEW2/ROME/WV-2_standard_8band_bundle_16bit/052298844010_01_P001_PAN/09DEC10103019-P2AS-052298844010_01_P001.TIF} - ${TEMP}/raTvImageToLuminanceImageFilterAutoWV2PAN.tif + ${TEMP}/raTvImageToRadianceImageFilterAutoWV2PAN.tif ) otb_add_test(NAME raTvAtmosphericCorrectionSequencementTest COMMAND otbOpticalCalibrationTestDriver @@ -860,11 +860,11 @@ otb_add_test(NAME raTvSurfaceAdjacencyEffectCorrectionSchemeFilter COMMAND otbOp ${TEMP}/raTvSurfaceAdjacencyEffect6SCorrectionSchemeFilterOutput6SVallues.txt ) -otb_add_test(NAME raTvLuminanceToImageImageFilter COMMAND otbOpticalCalibrationTestDriver +otb_add_test(NAME raTvRadianceToImageImageFilter COMMAND otbOpticalCalibrationTestDriver --compare-image ${EPSILON_12} ${INPUTDATA}/verySmallFSATSW.tif ${TEMP}/raTvverySmallFSATSWImageFilter.tif - otbLuminanceToImageImageFilter - ${BASELINE}/raTvImageToLuminanceImageFilter.tif + otbRadianceToImageImageFilter + ${BASELINE}/raTvImageToRadianceImageFilter.tif ${TEMP}/raTvverySmallFSATSWImageFilter.tif 10 #channel 1 alpha 20 #channel 2 alpha @@ -876,11 +876,11 @@ otb_add_test(NAME raTvLuminanceToImageImageFilter COMMAND otbOpticalCalibrationT 4 #channel 4 beta ) -otb_add_test(NAME raTvReflectanceToLuminanceImageFilter COMMAND otbOpticalCalibrationTestDriver +otb_add_test(NAME raTvReflectanceToRadianceImageFilter COMMAND otbOpticalCalibrationTestDriver --compare-image ${EPSILON_12} ${INPUTDATA}/verySmallFSATSW.tif ${TEMP}/raTvverySmallFSATSWImageFilterDsol.tif - otbReflectanceToLuminanceImageFilter - ${BASELINE}/raTvLuminanceToReflectanceImageFilterDsol.tif + otbReflectanceToRadianceImageFilter + ${BASELINE}/raTvRadianceToReflectanceImageFilterDsol.tif ${TEMP}/raTvverySmallFSATSWImageFilterDsol.tif 0.2 #radius 10 #channel 1 illumination @@ -890,11 +890,11 @@ otb_add_test(NAME raTvReflectanceToLuminanceImageFilter COMMAND otbOpticalCalibr 0.9923885328 ) -otb_add_test(NAME raTvReflectanceToLuminanceImageFilterDayMonth COMMAND otbOpticalCalibrationTestDriver +otb_add_test(NAME raTvReflectanceToRadianceImageFilterDayMonth COMMAND otbOpticalCalibrationTestDriver --compare-image ${EPSILON_12} ${INPUTDATA}/verySmallFSATSW.tif ${TEMP}/raTvverySmallFSATSWImageFilterDayMonth.tif - otbReflectanceToLuminanceImageFilter - ${BASELINE}/raTvLuminanceToReflectanceImageFilter.tif + otbReflectanceToRadianceImageFilter + ${BASELINE}/raTvRadianceToReflectanceImageFilter.tif ${TEMP}/raTvverySmallFSATSWImageFilterDayMonth.tif 0.2 #radius 10 #channel 1 illumination @@ -905,12 +905,12 @@ otb_add_test(NAME raTvReflectanceToLuminanceImageFilterDayMonth COMMAND otbOptic 5 #month ) -otb_add_test(NAME raTvImageToLuminanceImageFilter COMMAND otbOpticalCalibrationTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToLuminanceImageFilter.tif - ${TEMP}/raTvImageToLuminanceImageFilter.tif - otbImageToLuminanceImageFilter +otb_add_test(NAME raTvImageToRadianceImageFilter COMMAND otbOpticalCalibrationTestDriver + --compare-image ${EPSILON_12} ${BASELINE}/raTvImageToRadianceImageFilter.tif + ${TEMP}/raTvImageToRadianceImageFilter.tif + otbImageToRadianceImageFilter ${INPUTDATA}/verySmallFSATSW.tif - ${TEMP}/raTvImageToLuminanceImageFilter.tif + ${TEMP}/raTvImageToRadianceImageFilter.tif 10 #channel 1 alpha 20 #channel 2 alpha 30 #channel 3 alpha diff --git a/Modules/Radiometry/OpticalCalibration/test/otbAtmosphericCorrectionSequencement.cxx b/Modules/Radiometry/OpticalCalibration/test/otbAtmosphericCorrectionSequencement.cxx index 5603540ec5174a4f2c39ae927ecf1978ab30816a..0e1d8a94c3b8e30b856ff83f71531985bdb13dbf 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbAtmosphericCorrectionSequencement.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbAtmosphericCorrectionSequencement.cxx @@ -20,8 +20,8 @@ -#include "otbImageToLuminanceImageFilter.h" -#include "otbLuminanceToReflectanceImageFilter.h" +#include "otbImageToRadianceImageFilter.h" +#include "otbRadianceToReflectanceImageFilter.h" #include "otbReflectanceToSurfaceReflectanceImageFilter.h" #include "otbSurfaceAdjacencyEffectCorrectionSchemeFilter.h" @@ -63,9 +63,9 @@ int otbAtmosphericCorrectionSequencementTest(int argc, char *argv[]) //------------------------------- - typedef otb::ImageToLuminanceImageFilter<ImageType, ImageType> - ImageToLuminanceImageFilterType; - typedef ImageToLuminanceImageFilterType::VectorType VectorType; + typedef otb::ImageToRadianceImageFilter<ImageType, ImageType> + ImageToRadianceImageFilterType; + typedef ImageToRadianceImageFilterType::VectorType VectorType; VectorType alpha(nbOfComponent); VectorType beta(nbOfComponent); @@ -84,16 +84,16 @@ int otbAtmosphericCorrectionSequencementTest(int argc, char *argv[]) } fin.close(); - ImageToLuminanceImageFilterType::Pointer filterImageToLuminance = ImageToLuminanceImageFilterType::New(); - filterImageToLuminance->SetAlpha(alpha); - filterImageToLuminance->SetBeta(beta); - filterImageToLuminance->SetInput(reader->GetOutput()); + ImageToRadianceImageFilterType::Pointer filterImageToRadiance = ImageToRadianceImageFilterType::New(); + filterImageToRadiance->SetAlpha(alpha); + filterImageToRadiance->SetBeta(beta); + filterImageToRadiance->SetInput(reader->GetOutput()); //------------------------------- - typedef otb::LuminanceToReflectanceImageFilter<ImageType, ImageType> - LuminanceToReflectanceImageFilterType; + typedef otb::RadianceToReflectanceImageFilter<ImageType, ImageType> + RadianceToReflectanceImageFilterType; - typedef LuminanceToReflectanceImageFilterType::VectorType VectorType; + typedef RadianceToReflectanceImageFilterType::VectorType VectorType; VectorType solarIllumination(nbOfComponent); solarIllumination.Fill(0); @@ -107,16 +107,16 @@ int otbAtmosphericCorrectionSequencementTest(int argc, char *argv[]) } fin.close(); - LuminanceToReflectanceImageFilterType::Pointer filterLuminanceToReflectance = - LuminanceToReflectanceImageFilterType::New(); + RadianceToReflectanceImageFilterType::Pointer filterRadianceToReflectance = + RadianceToReflectanceImageFilterType::New(); const int day(atoi(argv[5])); const int month(atoi(argv[6])); - filterLuminanceToReflectance->SetZenithalSolarAngle(static_cast<double>(atof(argv[4]))); - filterLuminanceToReflectance->SetDay(day); - filterLuminanceToReflectance->SetMonth(month); - filterLuminanceToReflectance->SetSolarIllumination(solarIllumination); - filterLuminanceToReflectance->SetInput(filterImageToLuminance->GetOutput()); + filterRadianceToReflectance->SetZenithalSolarAngle(static_cast<double>(atof(argv[4]))); + filterRadianceToReflectance->SetDay(day); + filterRadianceToReflectance->SetMonth(month); + filterRadianceToReflectance->SetSolarIllumination(solarIllumination); + filterRadianceToReflectance->SetInput(filterImageToRadiance->GetOutput()); //------------------------------- /*typedef otb::RadiometryCorrectionParametersToAtmosphericRadiativeTerms RadiometryCorrectionParametersToRadiativeTermsType; @@ -189,7 +189,7 @@ int otbAtmosphericCorrectionSequencementTest(int argc, char *argv[]) fin.close(); // Set parameters - /*dataAtmosphericCorrectionParameters->SetSolarZenithalAngle(filterLuminanceToReflectance->GetZenithalSolarAngle()); + /*dataAtmosphericCorrectionParameters->SetSolarZenithalAngle(filterRadianceToReflectance->GetZenithalSolarAngle()); dataAtmosphericCorrectionParameters->SetSolarAzimutalAngle(static_cast<double>(atof(argv[8]))); dataAtmosphericCorrectionParameters->SetViewingZenithalAngle(static_cast<double>(atof(argv[9]))); dataAtmosphericCorrectionParameters->SetViewingAzimutalAngle(static_cast<double>(atof(argv[10]))); @@ -208,7 +208,7 @@ int otbAtmosphericCorrectionSequencementTest(int argc, char *argv[]) filterAtmosphericCorrectionParametersTo6SRadiativeTerms->SetInput(dataAtmosphericCorrectionParameters); filterAtmosphericCorrectionParametersTo6SRadiativeTerms->Update(); */ - paramAcqui->SetSolarZenithalAngle(filterLuminanceToReflectance->GetZenithalSolarAngle()); + paramAcqui->SetSolarZenithalAngle(filterRadianceToReflectance->GetZenithalSolarAngle()); paramAcqui->SetSolarAzimutalAngle(static_cast<double>(atof(argv[8]))); paramAcqui->SetViewingZenithalAngle(static_cast<double>(atof(argv[9]))); paramAcqui->SetViewingAzimutalAngle(static_cast<double>(atof(argv[10]))); @@ -231,7 +231,7 @@ int otbAtmosphericCorrectionSequencementTest(int argc, char *argv[]) ReflectanceToSurfaceReflectanceImageFilterType::New(); filterReflectanceToSurfaceReflectanceImageFilter->SetAtmosphericRadiativeTerms(radiative); - filterReflectanceToSurfaceReflectanceImageFilter->SetInput(filterLuminanceToReflectance->GetOutput()); + filterReflectanceToSurfaceReflectanceImageFilter->SetInput(filterRadianceToReflectance->GetOutput()); //------------------------------- typedef otb::SurfaceAdjacencyEffectCorrectionSchemeFilter<ImageType, diff --git a/Modules/Radiometry/OpticalCalibration/test/otbImageToLuminanceImageFilter.cxx b/Modules/Radiometry/OpticalCalibration/test/otbImageToRadianceImageFilter.cxx similarity index 84% rename from Modules/Radiometry/OpticalCalibration/test/otbImageToLuminanceImageFilter.cxx rename to Modules/Radiometry/OpticalCalibration/test/otbImageToRadianceImageFilter.cxx index ff31be6ee0bede01f03e50e013a5971ee25f157a..130e08b2af3bae75ef839a0fa0827bfb700616fd 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbImageToLuminanceImageFilter.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbImageToRadianceImageFilter.cxx @@ -20,11 +20,11 @@ #include "itkMacro.h" -#include "otbImageToLuminanceImageFilter.h" +#include "otbImageToRadianceImageFilter.h" #include "otbImageFileReader.h" #include "otbImageFileWriter.h" -int otbImageToLuminanceImageFilter(int itkNotUsed(argc), char * argv[]) +int otbImageToRadianceImageFilter(int itkNotUsed(argc), char * argv[]) { const char * inputFileName = argv[1]; const char * outputFileName = argv[2]; @@ -35,8 +35,8 @@ int otbImageToLuminanceImageFilter(int itkNotUsed(argc), char * argv[]) typedef otb::VectorImage<PixelType, Dimension> OutputImageType; typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; - typedef otb::ImageToLuminanceImageFilter<InputImageType, OutputImageType> ImageToLuminanceImageFilterType; - typedef ImageToLuminanceImageFilterType::VectorType VectorType; + typedef otb::ImageToRadianceImageFilter<InputImageType, OutputImageType> ImageToRadianceImageFilterType; + typedef ImageToRadianceImageFilterType::VectorType VectorType; ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); @@ -58,7 +58,7 @@ int otbImageToLuminanceImageFilter(int itkNotUsed(argc), char * argv[]) } // Instantiating object - ImageToLuminanceImageFilterType::Pointer filter = ImageToLuminanceImageFilterType::New(); + ImageToRadianceImageFilterType::Pointer filter = ImageToRadianceImageFilterType::New(); filter->SetAlpha(alpha); filter->SetBeta(beta); filter->SetInput(reader->GetOutput()); diff --git a/Modules/Radiometry/OpticalCalibration/test/otbImageToLuminanceImageFilterAuto.cxx b/Modules/Radiometry/OpticalCalibration/test/otbImageToRadianceImageFilterAuto.cxx similarity index 86% rename from Modules/Radiometry/OpticalCalibration/test/otbImageToLuminanceImageFilterAuto.cxx rename to Modules/Radiometry/OpticalCalibration/test/otbImageToRadianceImageFilterAuto.cxx index fccdd66e52d30d250bc835bd6aa07d59a611fb82..a5225ac94c108809cac4f8166e37f9778957fddf 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbImageToLuminanceImageFilterAuto.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbImageToRadianceImageFilterAuto.cxx @@ -19,13 +19,13 @@ */ -#include "otbImageToLuminanceImageFilter.h" +#include "otbImageToRadianceImageFilter.h" #include "otbImageFileReader.h" #include "otbImageFileWriter.h" #include "otbMultiChannelExtractROI.h" //Test the retrieval of parameters from the image metadata -int otbImageToLuminanceImageFilterAuto(int itkNotUsed(argc), char * argv[]) +int otbImageToRadianceImageFilterAuto(int itkNotUsed(argc), char * argv[]) { const char * inputFileName = argv[1]; const char * outputFileName = argv[2]; @@ -36,7 +36,7 @@ int otbImageToLuminanceImageFilterAuto(int itkNotUsed(argc), char * argv[]) typedef otb::VectorImage<PixelType, Dimension> OutputImageType; typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; - typedef otb::ImageToLuminanceImageFilter<InputImageType, OutputImageType> ImageToLuminanceImageFilterType; + typedef otb::ImageToRadianceImageFilter<InputImageType, OutputImageType> ImageToRadianceImageFilterType; typedef otb::MultiChannelExtractROI<PixelType, PixelType> RoiFilterType; ReaderType::Pointer reader = ReaderType::New(); @@ -46,7 +46,7 @@ int otbImageToLuminanceImageFilterAuto(int itkNotUsed(argc), char * argv[]) reader->UpdateOutputInformation(); // Instantiating object - ImageToLuminanceImageFilterType::Pointer filter = ImageToLuminanceImageFilterType::New(); + ImageToRadianceImageFilterType::Pointer filter = ImageToRadianceImageFilterType::New(); filter->SetInput(reader->GetOutput()); RoiFilterType::Pointer roiFilter = RoiFilterType::New(); diff --git a/Modules/Radiometry/OpticalCalibration/test/otbImageToLuminanceImageFilterNew.cxx b/Modules/Radiometry/OpticalCalibration/test/otbImageToRadianceImageFilterNew.cxx similarity index 75% rename from Modules/Radiometry/OpticalCalibration/test/otbImageToLuminanceImageFilterNew.cxx rename to Modules/Radiometry/OpticalCalibration/test/otbImageToRadianceImageFilterNew.cxx index ebc20d764e3e10c54cb42ec27cf845d335c367de..83086a2c3c69fcb25c04d367a35208cd0c810035 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbImageToLuminanceImageFilterNew.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbImageToRadianceImageFilterNew.cxx @@ -20,18 +20,18 @@ #include "itkMacro.h" -#include "otbImageToLuminanceImageFilter.h" +#include "otbImageToRadianceImageFilter.h" -int otbImageToLuminanceImageFilterNew(int itkNotUsed(argc), char * itkNotUsed(argv)[]) +int otbImageToRadianceImageFilterNew(int itkNotUsed(argc), char * itkNotUsed(argv)[]) { const unsigned int Dimension = 2; typedef double PixelType; typedef otb::VectorImage<PixelType, Dimension> InputImageType; - typedef otb::ImageToLuminanceImageFilter<InputImageType, InputImageType> ImageToLuminanceImageFilterType; + typedef otb::ImageToRadianceImageFilter<InputImageType, InputImageType> ImageToRadianceImageFilterType; // Instantiating object - ImageToLuminanceImageFilterType::Pointer filter = ImageToLuminanceImageFilterType::New(); + ImageToRadianceImageFilterType::Pointer filter = ImageToRadianceImageFilterType::New(); std::cout << filter << std::endl; diff --git a/Modules/Radiometry/OpticalCalibration/test/otbOpticalCalibrationTestDriver.cxx b/Modules/Radiometry/OpticalCalibration/test/otbOpticalCalibrationTestDriver.cxx index 244ebdc5c71e0199f4da97eeb262ce58cd69c877..d9d6d93a700f8d18e3bc0393602c9bac1432f456 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbOpticalCalibrationTestDriver.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbOpticalCalibrationTestDriver.cxx @@ -26,14 +26,14 @@ void RegisterTests() REGISTER_TEST(otbSpectralSensitivityReaderTest); REGISTER_TEST(otbSpectralSensitivityReaderGenericTest); REGISTER_TEST(otbReflectanceToImageImageFilter); - REGISTER_TEST(otbReflectanceToLuminanceImageFilterNew); - REGISTER_TEST(otbLuminanceToReflectanceImageFilterNew); - REGISTER_TEST(otbLuminanceToReflectanceImageFilterAuto); - REGISTER_TEST(otbImageToLuminanceImageFilterNew); + REGISTER_TEST(otbReflectanceToRadianceImageFilterNew); + REGISTER_TEST(otbRadianceToReflectanceImageFilterNew); + REGISTER_TEST(otbRadianceToReflectanceImageFilterAuto); + REGISTER_TEST(otbImageToRadianceImageFilterNew); REGISTER_TEST(otbRadiometryCorrectionParametersToAtmosphericRadiativeTermsNew); - REGISTER_TEST(otbLuminanceToImageImageFilterAuto); - REGISTER_TEST(otbLuminanceToImageImageFilterNew); - REGISTER_TEST(otbReflectanceToLuminanceImageFilterAuto); + REGISTER_TEST(otbRadianceToImageImageFilterAuto); + REGISTER_TEST(otbRadianceToImageImageFilterNew); + REGISTER_TEST(otbReflectanceToRadianceImageFilterAuto); REGISTER_TEST(otbAeronetExtractDataBadData); REGISTER_TEST(otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter); REGISTER_TEST(otbRadiometryCorrectionParametersToAtmosphericRadiativeTerms); @@ -47,7 +47,7 @@ void RegisterTests() REGISTER_TEST(otbAtmosphericRadiativeTermsSingleChannelNew); REGISTER_TEST(otbAtmosphericRadiativeTermsTest); REGISTER_TEST(otbImageToReflectanceImageFilter); - REGISTER_TEST(otbLuminanceToReflectanceImageFilter); + REGISTER_TEST(otbRadianceToReflectanceImageFilter); REGISTER_TEST(otbReflectanceToImageImageFilterAuto); REGISTER_TEST(otbAeronetNew); REGISTER_TEST(otbAeronetExtractData); @@ -55,13 +55,13 @@ void RegisterTests() REGISTER_TEST(otbReflectanceToSurfaceReflectanceImageFilterTest); REGISTER_TEST(otbReflectanceToSurfaceReflectanceImageFilterTest2); REGISTER_TEST(otbImageMetadataCorrectionParametersNew); - REGISTER_TEST(otbImageToLuminanceImageFilterAuto); + REGISTER_TEST(otbImageToRadianceImageFilterAuto); REGISTER_TEST(otbAtmosphericCorrectionSequencementTest); REGISTER_TEST(otbSIXSTraitsTest); REGISTER_TEST(otbSIXSTraitsComputeAtmosphericParametersTest); REGISTER_TEST(otbReflectanceToImageImageFilterNew); REGISTER_TEST(otbSurfaceAdjacencyEffectCorrectionSchemeFilter); - REGISTER_TEST(otbLuminanceToImageImageFilter); - REGISTER_TEST(otbReflectanceToLuminanceImageFilter); - REGISTER_TEST(otbImageToLuminanceImageFilter); + REGISTER_TEST(otbRadianceToImageImageFilter); + REGISTER_TEST(otbReflectanceToRadianceImageFilter); + REGISTER_TEST(otbImageToRadianceImageFilter); } diff --git a/Modules/Radiometry/OpticalCalibration/test/otbLuminanceToImageImageFilter.cxx b/Modules/Radiometry/OpticalCalibration/test/otbRadianceToImageImageFilter.cxx similarity index 84% rename from Modules/Radiometry/OpticalCalibration/test/otbLuminanceToImageImageFilter.cxx rename to Modules/Radiometry/OpticalCalibration/test/otbRadianceToImageImageFilter.cxx index 1b75114f867aced692181352347a76525e8e1926..3753231f96dd13597a2fefe1abbe94a29deec28d 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbLuminanceToImageImageFilter.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbRadianceToImageImageFilter.cxx @@ -20,13 +20,13 @@ #include "itkMacro.h" -#include "otbLuminanceToImageImageFilter.h" +#include "otbRadianceToImageImageFilter.h" #include "otbVectorImage.h" #include "otbImageFileReader.h" #include "otbImageFileWriter.h" #include "itkVariableLengthVector.h" -int otbLuminanceToImageImageFilter(int itkNotUsed(argc), char * argv[]) +int otbRadianceToImageImageFilter(int itkNotUsed(argc), char * argv[]) { const char * inputFileName = argv[1]; const char * outputFileName = argv[2]; @@ -37,8 +37,8 @@ int otbLuminanceToImageImageFilter(int itkNotUsed(argc), char * argv[]) typedef otb::VectorImage<PixelType, Dimension> OutputImageType; typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; - typedef otb::LuminanceToImageImageFilter<InputImageType, OutputImageType> LuminanceToImageImageFilterType; - typedef LuminanceToImageImageFilterType::VectorType VectorType; + typedef otb::RadianceToImageImageFilter<InputImageType, OutputImageType> RadianceToImageImageFilterType; + typedef RadianceToImageImageFilterType::VectorType VectorType; ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); @@ -60,7 +60,7 @@ int otbLuminanceToImageImageFilter(int itkNotUsed(argc), char * argv[]) } // Instantiating object - LuminanceToImageImageFilterType::Pointer filter = LuminanceToImageImageFilterType::New(); + RadianceToImageImageFilterType::Pointer filter = RadianceToImageImageFilterType::New(); filter->SetAlpha(alpha); filter->SetBeta(beta); filter->SetInput(reader->GetOutput()); diff --git a/Modules/Radiometry/OpticalCalibration/test/otbLuminanceToImageImageFilterAuto.cxx b/Modules/Radiometry/OpticalCalibration/test/otbRadianceToImageImageFilterAuto.cxx similarity index 88% rename from Modules/Radiometry/OpticalCalibration/test/otbLuminanceToImageImageFilterAuto.cxx rename to Modules/Radiometry/OpticalCalibration/test/otbRadianceToImageImageFilterAuto.cxx index a7d7c2fde19531672ffbfe767869e0f1db93750d..55dfb6d0266d80e861bb998e4dc5e88bd8b6d419 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbLuminanceToImageImageFilterAuto.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbRadianceToImageImageFilterAuto.cxx @@ -19,13 +19,13 @@ */ -#include "otbLuminanceToImageImageFilter.h" +#include "otbRadianceToImageImageFilter.h" #include "otbImageFileReader.h" #include "otbImageFileWriter.h" #include "otbMultiChannelExtractROI.h" //Test the retrieval of parameters from the image metadata -int otbLuminanceToImageImageFilterAuto(int itkNotUsed(argc), char * argv[]) +int otbRadianceToImageImageFilterAuto(int itkNotUsed(argc), char * argv[]) { const char * inputFileName = argv[1]; const char * inputFileName2 = argv[2]; @@ -38,7 +38,7 @@ int otbLuminanceToImageImageFilterAuto(int itkNotUsed(argc), char * argv[]) typedef otb::VectorImage<PixelType, Dimension> OutputImageType; typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; - typedef otb::LuminanceToImageImageFilter<InputImageType, OutputImageType> LuminanceToImageImageFilterType; + typedef otb::RadianceToImageImageFilter<InputImageType, OutputImageType> RadianceToImageImageFilterType; typedef otb::MultiChannelExtractROI<PixelType, PixelType> RoiFilterType; ReaderType::Pointer reader = ReaderType::New(); @@ -54,7 +54,7 @@ int otbLuminanceToImageImageFilterAuto(int itkNotUsed(argc), char * argv[]) reader2->UpdateOutputInformation(); // Instantiating object - LuminanceToImageImageFilterType::Pointer filter = LuminanceToImageImageFilterType::New(); + RadianceToImageImageFilterType::Pointer filter = RadianceToImageImageFilterType::New(); filter->SetInput(reader->GetOutput()); writer->SetInput(filter->GetOutput()); diff --git a/Modules/Radiometry/OpticalCalibration/test/otbLuminanceToImageImageFilterNew.cxx b/Modules/Radiometry/OpticalCalibration/test/otbRadianceToImageImageFilterNew.cxx similarity index 75% rename from Modules/Radiometry/OpticalCalibration/test/otbLuminanceToImageImageFilterNew.cxx rename to Modules/Radiometry/OpticalCalibration/test/otbRadianceToImageImageFilterNew.cxx index b33f89f7bf5ffb8ecfdaeed872d1996cd1c24a39..ca4a7be9fa5fb7865a0f1d56f671b0025b6b1e98 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbLuminanceToImageImageFilterNew.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbRadianceToImageImageFilterNew.cxx @@ -20,19 +20,19 @@ #include "itkMacro.h" -#include "otbLuminanceToImageImageFilter.h" +#include "otbRadianceToImageImageFilter.h" #include "otbVectorImage.h" -int otbLuminanceToImageImageFilterNew(int itkNotUsed(argc), char * itkNotUsed(argv)[]) +int otbRadianceToImageImageFilterNew(int itkNotUsed(argc), char * itkNotUsed(argv)[]) { const unsigned int Dimension = 2; typedef double PixelType; typedef otb::VectorImage<PixelType, Dimension> InputImageType; - typedef otb::LuminanceToImageImageFilter<InputImageType, InputImageType> LuminanceToImageImageFilterType; + typedef otb::RadianceToImageImageFilter<InputImageType, InputImageType> RadianceToImageImageFilterType; // Instantiating object - LuminanceToImageImageFilterType::Pointer filter = LuminanceToImageImageFilterType::New(); + RadianceToImageImageFilterType::Pointer filter = RadianceToImageImageFilterType::New(); std::cout << filter << std::endl; diff --git a/Modules/Radiometry/OpticalCalibration/test/otbLuminanceToReflectanceImageFilter.cxx b/Modules/Radiometry/OpticalCalibration/test/otbRadianceToReflectanceImageFilter.cxx similarity index 86% rename from Modules/Radiometry/OpticalCalibration/test/otbLuminanceToReflectanceImageFilter.cxx rename to Modules/Radiometry/OpticalCalibration/test/otbRadianceToReflectanceImageFilter.cxx index 111a0c6f9aa435112445569eaa23fb17d5611c60..144781ca743e7c7e6e2f811fa1182ff0ec6d0d44 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbLuminanceToReflectanceImageFilter.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbRadianceToReflectanceImageFilter.cxx @@ -20,12 +20,12 @@ #include "itkMacro.h" -#include "otbLuminanceToReflectanceImageFilter.h" +#include "otbRadianceToReflectanceImageFilter.h" #include "otbVectorImage.h" #include "otbImageFileReader.h" #include "otbImageFileWriter.h" -int otbLuminanceToReflectanceImageFilter(int argc, char * argv[]) +int otbRadianceToReflectanceImageFilter(int argc, char * argv[]) { const char * inputFileName = argv[1]; const char * outputFileName = argv[2]; @@ -50,8 +50,8 @@ int otbLuminanceToReflectanceImageFilter(int argc, char * argv[]) typedef otb::VectorImage<PixelType, Dimension> OutputImageType; typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; - typedef otb::LuminanceToReflectanceImageFilter<InputImageType, OutputImageType> LuminanceToReflectanceImageFilterType; - typedef LuminanceToReflectanceImageFilterType::VectorType VectorType; + typedef otb::RadianceToReflectanceImageFilter<InputImageType, OutputImageType> RadianceToReflectanceImageFilterType; + typedef RadianceToReflectanceImageFilterType::VectorType VectorType; ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); @@ -69,7 +69,7 @@ int otbLuminanceToReflectanceImageFilter(int argc, char * argv[]) solarIllumination[3] = static_cast<double>(atof(argv[7])); // Instantiating object - LuminanceToReflectanceImageFilterType::Pointer filter = LuminanceToReflectanceImageFilterType::New(); + RadianceToReflectanceImageFilterType::Pointer filter = RadianceToReflectanceImageFilterType::New(); filter->SetZenithalSolarAngle(angle); filter->SetSolarIllumination(solarIllumination); diff --git a/Modules/Radiometry/OpticalCalibration/test/otbLuminanceToReflectanceImageFilterAuto.cxx b/Modules/Radiometry/OpticalCalibration/test/otbRadianceToReflectanceImageFilterAuto.cxx similarity index 73% rename from Modules/Radiometry/OpticalCalibration/test/otbLuminanceToReflectanceImageFilterAuto.cxx rename to Modules/Radiometry/OpticalCalibration/test/otbRadianceToReflectanceImageFilterAuto.cxx index fda44a1edb5cd2bc2d76240e2c9256d600fd4f44..511b4d658a52f29a549d909e97ba5f9a1090ee08 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbLuminanceToReflectanceImageFilterAuto.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbRadianceToReflectanceImageFilterAuto.cxx @@ -19,13 +19,13 @@ */ -#include "otbImageToLuminanceImageFilter.h" -#include "otbLuminanceToReflectanceImageFilter.h" +#include "otbImageToRadianceImageFilter.h" +#include "otbRadianceToReflectanceImageFilter.h" #include "otbImageFileReader.h" #include "otbImageFileWriter.h" #include "otbMultiChannelExtractROI.h" -int otbLuminanceToReflectanceImageFilterAuto(int itkNotUsed(argc), char * argv[]) +int otbRadianceToReflectanceImageFilterAuto(int itkNotUsed(argc), char * argv[]) { const char * inputFileName = argv[1]; const char * outputFileName = argv[2]; @@ -36,9 +36,9 @@ int otbLuminanceToReflectanceImageFilterAuto(int itkNotUsed(argc), char * argv[] typedef otb::VectorImage<PixelType, Dimension> OutputImageType; typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; - typedef otb::ImageToLuminanceImageFilter<InputImageType, OutputImageType> ImageToLuminanceImageFilterType; - typedef otb::LuminanceToReflectanceImageFilter<OutputImageType, - OutputImageType> LuminanceToReflectanceImageFilterType; + typedef otb::ImageToRadianceImageFilter<InputImageType, OutputImageType> ImageToRadianceImageFilterType; + typedef otb::RadianceToReflectanceImageFilter<OutputImageType, + OutputImageType> RadianceToReflectanceImageFilterType; typedef otb::MultiChannelExtractROI<PixelType, PixelType> RoiFilterType; ReaderType::Pointer reader = ReaderType::New(); @@ -48,11 +48,11 @@ int otbLuminanceToReflectanceImageFilterAuto(int itkNotUsed(argc), char * argv[] reader->UpdateOutputInformation(); // Instantiating object - ImageToLuminanceImageFilterType::Pointer filterToLuminance = ImageToLuminanceImageFilterType::New(); - filterToLuminance->SetInput(reader->GetOutput()); + ImageToRadianceImageFilterType::Pointer filterToRadiance = ImageToRadianceImageFilterType::New(); + filterToRadiance->SetInput(reader->GetOutput()); - LuminanceToReflectanceImageFilterType::Pointer filterToReflectance = LuminanceToReflectanceImageFilterType::New(); - filterToReflectance->SetInput(filterToLuminance->GetOutput()); + RadianceToReflectanceImageFilterType::Pointer filterToReflectance = RadianceToReflectanceImageFilterType::New(); + filterToReflectance->SetInput(filterToRadiance->GetOutput()); filterToReflectance->SetUseClamp(false); RoiFilterType::Pointer roiFilter = RoiFilterType::New(); diff --git a/Modules/Radiometry/OpticalCalibration/test/otbLuminanceToReflectanceImageFilterNew.cxx b/Modules/Radiometry/OpticalCalibration/test/otbRadianceToReflectanceImageFilterNew.cxx similarity index 73% rename from Modules/Radiometry/OpticalCalibration/test/otbLuminanceToReflectanceImageFilterNew.cxx rename to Modules/Radiometry/OpticalCalibration/test/otbRadianceToReflectanceImageFilterNew.cxx index 12b467122bc0ed7ce90d617671c942609151a001..2d208d12717ff0ebdd74bd903b28e1247552b95d 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbLuminanceToReflectanceImageFilterNew.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbRadianceToReflectanceImageFilterNew.cxx @@ -20,19 +20,19 @@ #include "itkMacro.h" -#include "otbLuminanceToReflectanceImageFilter.h" +#include "otbRadianceToReflectanceImageFilter.h" #include "otbVectorImage.h" -int otbLuminanceToReflectanceImageFilterNew(int itkNotUsed(argc), char * itkNotUsed(argv)[]) +int otbRadianceToReflectanceImageFilterNew(int itkNotUsed(argc), char * itkNotUsed(argv)[]) { const unsigned int Dimension = 2; typedef double PixelType; typedef otb::VectorImage<PixelType, Dimension> InputImageType; - typedef otb::LuminanceToReflectanceImageFilter<InputImageType, InputImageType> LuminanceToReflectanceImageFilterType; + typedef otb::RadianceToReflectanceImageFilter<InputImageType, InputImageType> RadianceToReflectanceImageFilterType; // Instantiating object - LuminanceToReflectanceImageFilterType::Pointer filter = LuminanceToReflectanceImageFilterType::New(); + RadianceToReflectanceImageFilterType::Pointer filter = RadianceToReflectanceImageFilterType::New(); std::cout << filter << std::endl; diff --git a/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToImageImageFilter.cxx b/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToImageImageFilter.cxx index a61ae86a8256144feb3676d964eeb70eddb7cdd9..c52c21e17a04618244b3d487ea728e040d7be932 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToImageImageFilter.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToImageImageFilter.cxx @@ -22,8 +22,8 @@ #include "otbReflectanceToImageImageFilter.h" -//#include "otbReflectanceToLuminanceImageFilter.h" -//#include "otbLuminanceToImageImageFilter.h" +//#include "otbReflectanceToRadianceImageFilter.h" +//#include "otbRadianceToImageImageFilter.h" #include "otbVectorImage.h" #include "otbImageFileReader.h" @@ -129,10 +129,10 @@ int otbReflectanceToImageImageFilter(int argc, char * argv[]) typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; -typedef otb::ReflectanceToLuminanceImageFilter<InputImageType, InputImageType> ReflectanceToLuminanceImageFilterType; -typedef otb::LuminanceToImageImageFilter<InputImageType, OutputImageType> LuminanceToImageImageFilterType; +typedef otb::ReflectanceToRadianceImageFilter<InputImageType, InputImageType> ReflectanceToRadianceImageFilterType; +typedef otb::RadianceToImageImageFilter<InputImageType, OutputImageType> RadianceToImageImageFilterType; - typedef ReflectanceToLuminanceImageFilterType::VectorType VectorType; + typedef ReflectanceToRadianceImageFilterType::VectorType VectorType; ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); @@ -158,8 +158,8 @@ typedef otb::LuminanceToImageImageFilter<InputImageType, OutputImageType> Lumina // Instantiating object -ReflectanceToLuminanceImageFilterType::Pointer filter = ReflectanceToLuminanceImageFilterType::New(); -LuminanceToImageImageFilterType::Pointer filter2 = LuminanceToImageImageFilterType::New(); +ReflectanceToRadianceImageFilterType::Pointer filter = ReflectanceToRadianceImageFilterType::New(); +RadianceToImageImageFilterType::Pointer filter2 = RadianceToImageImageFilterType::New(); filter2->SetAlpha(alpha); filter2->SetBeta(beta); diff --git a/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToLuminanceImageFilter.cxx b/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToRadianceImageFilter.cxx similarity index 86% rename from Modules/Radiometry/OpticalCalibration/test/otbReflectanceToLuminanceImageFilter.cxx rename to Modules/Radiometry/OpticalCalibration/test/otbReflectanceToRadianceImageFilter.cxx index b7fcc26964ba68d487b139819fbce7d521bf207a..3bd797486075bfac16f06cc21c7e9d94787e866a 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToLuminanceImageFilter.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToRadianceImageFilter.cxx @@ -20,11 +20,11 @@ #include "itkMacro.h" -#include "otbReflectanceToLuminanceImageFilter.h" +#include "otbReflectanceToRadianceImageFilter.h" #include "otbImageFileReader.h" #include "otbImageFileWriter.h" -int otbReflectanceToLuminanceImageFilter(int argc, char * argv[]) +int otbReflectanceToRadianceImageFilter(int argc, char * argv[]) { const char * inputFileName = argv[1]; const char * outputFileName = argv[2]; @@ -49,8 +49,8 @@ int otbReflectanceToLuminanceImageFilter(int argc, char * argv[]) typedef otb::VectorImage<PixelType, Dimension> OutputImageType; typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; - typedef otb::ReflectanceToLuminanceImageFilter<InputImageType, OutputImageType> ReflectanceToLuminanceImageFilterType; - typedef ReflectanceToLuminanceImageFilterType::VectorType VectorType; + typedef otb::ReflectanceToRadianceImageFilter<InputImageType, OutputImageType> ReflectanceToRadianceImageFilterType; + typedef ReflectanceToRadianceImageFilterType::VectorType VectorType; ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); @@ -68,7 +68,7 @@ int otbReflectanceToLuminanceImageFilter(int argc, char * argv[]) solarIllumination[3] = static_cast<double>(atof(argv[7])); // Instantiating object - ReflectanceToLuminanceImageFilterType::Pointer filter = ReflectanceToLuminanceImageFilterType::New(); + ReflectanceToRadianceImageFilterType::Pointer filter = ReflectanceToRadianceImageFilterType::New(); filter->SetZenithalSolarAngle(angle); filter->SetSolarIllumination(solarIllumination); diff --git a/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToLuminanceImageFilterAuto.cxx b/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToRadianceImageFilterAuto.cxx similarity index 77% rename from Modules/Radiometry/OpticalCalibration/test/otbReflectanceToLuminanceImageFilterAuto.cxx rename to Modules/Radiometry/OpticalCalibration/test/otbReflectanceToRadianceImageFilterAuto.cxx index 08d6ba55fea34eb0c180102e314e1a13ca4a224c..034a714a39f54485661c3beee2788c6da27b27b7 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToLuminanceImageFilterAuto.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToRadianceImageFilterAuto.cxx @@ -19,12 +19,12 @@ */ -#include "otbReflectanceToLuminanceImageFilter.h" +#include "otbReflectanceToRadianceImageFilter.h" #include "otbImageFileReader.h" #include "otbImageFileWriter.h" #include "otbMultiChannelExtractROI.h" -int otbReflectanceToLuminanceImageFilterAuto(int itkNotUsed(argc), char * argv[]) +int otbReflectanceToRadianceImageFilterAuto(int itkNotUsed(argc), char * argv[]) { const char * inputFileName = argv[1]; @@ -36,8 +36,8 @@ const char * inputFileName = argv[1]; typedef otb::VectorImage<PixelType, Dimension> OutputImageType; typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; - typedef otb::ReflectanceToLuminanceImageFilter<OutputImageType, - OutputImageType> ReflectanceToLuminanceImageFilterType; + typedef otb::ReflectanceToRadianceImageFilter<OutputImageType, + OutputImageType> ReflectanceToRadianceImageFilterType; ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); @@ -46,10 +46,10 @@ const char * inputFileName = argv[1]; reader->UpdateOutputInformation(); // Instantiating object - ReflectanceToLuminanceImageFilterType::Pointer filterToLuminance = ReflectanceToLuminanceImageFilterType::New(); + ReflectanceToRadianceImageFilterType::Pointer filterToRadiance = ReflectanceToRadianceImageFilterType::New(); - filterToLuminance->SetInput(reader->GetOutput()); - writer->SetInput(filterToLuminance->GetOutput()); + filterToRadiance->SetInput(reader->GetOutput()); + writer->SetInput(filterToRadiance->GetOutput()); writer->Update(); return EXIT_SUCCESS; diff --git a/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToLuminanceImageFilterNew.cxx b/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToRadianceImageFilterNew.cxx similarity index 73% rename from Modules/Radiometry/OpticalCalibration/test/otbReflectanceToLuminanceImageFilterNew.cxx rename to Modules/Radiometry/OpticalCalibration/test/otbReflectanceToRadianceImageFilterNew.cxx index 072248351ca021ebd497b7500fa29a9c48a197f4..c6eb5895ad04fd0de8749e454180a21e294f4841 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToLuminanceImageFilterNew.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbReflectanceToRadianceImageFilterNew.cxx @@ -20,18 +20,18 @@ #include "itkMacro.h" -#include "otbReflectanceToLuminanceImageFilter.h" +#include "otbReflectanceToRadianceImageFilter.h" -int otbReflectanceToLuminanceImageFilterNew(int itkNotUsed(argc), char * itkNotUsed(argv)[]) +int otbReflectanceToRadianceImageFilterNew(int itkNotUsed(argc), char * itkNotUsed(argv)[]) { const unsigned int Dimension = 2; typedef double PixelType; typedef otb::VectorImage<PixelType, Dimension> InputImageType; - typedef otb::ReflectanceToLuminanceImageFilter<InputImageType, InputImageType> ReflectanceToLuminanceImageFilterType; + typedef otb::ReflectanceToRadianceImageFilter<InputImageType, InputImageType> ReflectanceToRadianceImageFilterType; // Instantiating object - ReflectanceToLuminanceImageFilterType::Pointer filter = ReflectanceToLuminanceImageFilterType::New(); + ReflectanceToRadianceImageFilterType::Pointer filter = ReflectanceToRadianceImageFilterType::New(); std::cout << filter << std::endl; diff --git a/Modules/Radiometry/Simulation/include/otbReduceSpectralResponse.h b/Modules/Radiometry/Simulation/include/otbReduceSpectralResponse.h index dd3a116b26c54fd287f895a3c8567584780adb3f..d9a944bf7d1c9f639b718d6aeee7e030f2fd8646 100644 --- a/Modules/Radiometry/Simulation/include/otbReduceSpectralResponse.h +++ b/Modules/Radiometry/Simulation/include/otbReduceSpectralResponse.h @@ -39,7 +39,7 @@ namespace otb * compute the satellite spectral bands. * * There are 2 operating modes: - * - luminance mode (default): integrates the spectral response over each band + * - radiance mode (default): integrates the spectral response over each band * - reflectance mode (needs to call SetReflectanceMode(true)): takes into account * the solar irradiance in the integration * @@ -154,7 +154,7 @@ private: /** the computed response */ InputSpectralResponsePointerType m_ReduceResponse; - /** Choose between reflectance or luminance mode */ + /** Choose between reflectance or radiance mode */ bool m_ReflectanceMode; }; diff --git a/Modules/Radiometry/Simulation/include/otbReduceSpectralResponse.txx b/Modules/Radiometry/Simulation/include/otbReduceSpectralResponse.txx index e14cfb9f34e67ade7b301b87279119ff117cb692..2c7af98309f7d1bf1dbdb08042dcd8bb1cd689e8 100644 --- a/Modules/Radiometry/Simulation/include/otbReduceSpectralResponse.txx +++ b/Modules/Radiometry/Simulation/include/otbReduceSpectralResponse.txx @@ -109,7 +109,7 @@ ReduceSpectralResponse<TSpectralResponse , TRSR> /* In order to simplify the computation for the reflectance mode, we introduce the solar irradiance in the general formula with - a value of 1.0 for the luminance case. + a value of 1.0 for the radiance case. In this way the formula is the same if we weight the RSR by the solar irradiance before the integration. @@ -197,7 +197,7 @@ ReduceSpectralResponse<TSpectralResponse , TRSR> os <<indent << "[Center Wavelength (micrometers), Reflectance (percent)]" << std::endl; } else{ - os <<indent << "[Center Wavelength (micrometers), Luminance (percent)]" << std::endl; + os <<indent << "[Center Wavelength (micrometers), Radiance (percent)]" << std::endl; } for(typename VectorPairType::const_iterator it = m_ReduceResponse->GetResponse().begin(); it != m_ReduceResponse->GetResponse().end(); ++it) diff --git a/Modules/Radiometry/Simulation/include/otbSurfaceReflectanceToReflectanceFilter.h b/Modules/Radiometry/Simulation/include/otbSurfaceReflectanceToReflectanceFilter.h index 62050167d329f38c746a213a520fed10629a64cb..c07fbd4c97638e0154b88e1d2c2a4df8d614ecda 100644 --- a/Modules/Radiometry/Simulation/include/otbSurfaceReflectanceToReflectanceFilter.h +++ b/Modules/Radiometry/Simulation/include/otbSurfaceReflectanceToReflectanceFilter.h @@ -153,7 +153,7 @@ private: * * \ingroup AtmosphericRadiativeTerms * \ingroup AtmosphericCorrectionParameters - * \ingroup LuminanceToReflectanceImageFilter + * \ingroup RadianceToReflectanceImageFilter * \ingroup ImageToReflectanceImageFilter * \ingroup Radiometry * diff --git a/Modules/Radiometry/Simulation/test/otbReduceSpectralResponse.cxx b/Modules/Radiometry/Simulation/test/otbReduceSpectralResponse.cxx index 1d03b3a6a0f4ba9e50a8790eeb9faa30f2bd9705..388f66977591e377c4c30bab58112cd857f4e7c0 100644 --- a/Modules/Radiometry/Simulation/test/otbReduceSpectralResponse.cxx +++ b/Modules/Radiometry/Simulation/test/otbReduceSpectralResponse.cxx @@ -62,7 +62,7 @@ int otbReduceSpectralResponse(int argc, char * argv[]) myReduceResponse->SetInputSatRSR(myRSR); /** Load the spectral response of the object in the simulator*/ myReduceResponse->SetInputSpectralResponse(mySpectralResponse); - /** Set the reflectance or luminance mode */ + /** Set the reflectance or radiance mode */ myReduceResponse->SetReflectanceMode(reflectanceMode); myReduceResponse->CalculateResponse(); /** Print the Reduce SR*/ @@ -194,7 +194,7 @@ int otbReduceSpectralResponseSimpleValues(int argc, char * argv[]) if(fabs(b0Result-b0Expected)>tolerance) { - std::cout << "Wrong value for B0: expected eq. luminance = " << b0Expected + std::cout << "Wrong value for B0: expected eq. radiance = " << b0Expected << "; got " << b0Result << std::endl; return EXIT_FAILURE; @@ -207,7 +207,7 @@ int otbReduceSpectralResponseSimpleValues(int argc, char * argv[]) if(fabs(b1Result-b1Expected)>tolerance) { - std::cout << "Wrong value for B1: expected eq. luminance = " << b1Expected + std::cout << "Wrong value for B1: expected eq. radiance = " << b1Expected << "; got " << b1Result << std::endl; return EXIT_FAILURE; diff --git a/Modules/Remote/otbFFSforGMM.remote.cmake b/Modules/Remote/otbFFSforGMM.remote.cmake index 06e69cfb7759dcec18c01abb3201a80213a87b01..edd80d7f4b43fc79f5f9a68bde2e6439e4c112c0 100644 --- a/Modules/Remote/otbFFSforGMM.remote.cmake +++ b/Modules/Remote/otbFFSforGMM.remote.cmake @@ -25,5 +25,5 @@ A more detailed description can be found on the project website: https://github.com/Laadr/otbFFSforGMM " GIT_REPOSITORY https://github.com/Laadr/otbFFSforGMM.git - GIT_TAG 20f3938ffa585a3ec6e735c48e8d5e6ec77fe80a + GIT_TAG 1164391d09b9987f7f7ea6718347c772e31a396a ) diff --git a/Modules/Remote/otbGRM.remote.cmake b/Modules/Remote/otbGRM.remote.cmake index c6ac506a316a2b019656563ce6bcaaf728b478b1..383c97da56fe3de3a8ad53ba7fbbf2d7c4c60698 100644 --- a/Modules/Remote/otbGRM.remote.cmake +++ b/Modules/Remote/otbGRM.remote.cmake @@ -11,6 +11,6 @@ to see which format you must respect to add a new criterion. A more detailed description can be found on the project website: http://tully.ups-tlse.fr/lassallep/grm " - GIT_REPOSITORY http://tully.ups-tlse.fr/lassallep/grm.git - GIT_TAG a08d2309bc8d4f4ceaf1dba8bda33aa1e21fc4aa + GIT_REPOSITORY https://github.com/orfeotoolbox/GRM + GIT_TAG c53a61d12b895a85c3909130021988730c309cb7 ) diff --git a/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx b/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx index 136343a139cb84f0e804a452e49e6288be0fd154..6b1d92cf582d251cb2a3c6a7936f8842d73ee0a4 100644 --- a/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx +++ b/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx @@ -1562,6 +1562,14 @@ MainWindow this, SLOT( OnReferenceLayerChanged( size_t ) ) ); + + QObject::connect( + model, + SIGNAL( LayerRenamed() ), + // to: + this, + SLOT( RefreshReferenceLayerComboBox() ) + ); } /*****************************************************************************/ @@ -1597,21 +1605,11 @@ MainWindow AbstractLayerModel * layer = model->At( i ); assert( layer!=NULL ); - if( layer->inherits( VectorImageModel::staticMetaObject.className() ) ) - { - const VectorImageModel * vectorImageModel = - qobject_cast< const VectorImageModel * >( layer ); - - assert( vectorImageModel!=NULL ); - - comboBox->addItem( - QString( "%1 (%2)" ) - .arg( layer->GetAuthorityCode( true ).c_str() ) - .arg( QFileInfo( vectorImageModel->GetFilename() ).fileName() ) - ); - } - else - qDebug() << "Unhandled AbstractLayerModel subclass."; + comboBox->addItem( + QString( "%1 (%2)" ) + .arg( layer->GetAuthorityCode( true ).c_str() ) + .arg( layer->GetName() ) + ); } { @@ -1683,6 +1681,14 @@ MainWindow this, SLOT( OnReferenceLayerChanged( size_t ) ) ); + + QObject::connect( + model, + SIGNAL( LayerRenamed() ), + // to: + this, + SLOT( RefreshReferenceLayerComboBox() ) + ); } comboBox->clear(); diff --git a/Modules/Visualization/MonteverdiCore/include/mvdAbstractLayerModel.h b/Modules/Visualization/MonteverdiCore/include/mvdAbstractLayerModel.h index ce0c2bdff632b08ced8aed91824fc8a4ec4ab6b2..ab4065a91b1882092f79319c6f0222d792b89037 100644 --- a/Modules/Visualization/MonteverdiCore/include/mvdAbstractLayerModel.h +++ b/Modules/Visualization/MonteverdiCore/include/mvdAbstractLayerModel.h @@ -139,6 +139,12 @@ public: */ void ToWgs84( const PointType &, PointType & wgs84, double & alt ) const; + /** Setter for the m_Name attribute ( should be initialized by subclasses )*/ + void SetName(const QString & name); + + /** Getter for the m_Name attribute */ + const QString & GetName() const; + /*-[ PUBLIC SLOTS SECTION ]------------------------------------------------*/ // @@ -155,6 +161,9 @@ signals: void VisibilityChanged( bool =true ); void VisibilityChanged( AbstractLayerModel *, bool ); + /** Signal to other components that the name has changed */ + void NameChanged(); + /*-[ PROTECTED SECTION ]---------------------------------------------------*/ // @@ -198,6 +207,7 @@ private: // Private attributes. private: + QString m_Name; /*-[ PRIVATE SLOTS SECTION ]-----------------------------------------------*/ // diff --git a/Modules/Visualization/MonteverdiCore/include/mvdStackedLayerModel.h b/Modules/Visualization/MonteverdiCore/include/mvdStackedLayerModel.h index ff767958923d06772e1dfbfce77412f52a62d73b..035914cb210f692825e2bf440373f924f7062282 100644 --- a/Modules/Visualization/MonteverdiCore/include/mvdStackedLayerModel.h +++ b/Modules/Visualization/MonteverdiCore/include/mvdStackedLayerModel.h @@ -254,6 +254,8 @@ signals: void ResolutionsChanged( const PixelInfo::Vector & ); + void LayerRenamed(); + /*-[ PROTECTED SECTION ]---------------------------------------------------*/ // diff --git a/Modules/Visualization/MonteverdiCore/src/mvdAbstractLayerModel.cxx b/Modules/Visualization/MonteverdiCore/src/mvdAbstractLayerModel.cxx index 4598db5f84b13df0807164d089451fe6191c5f86..7d59542eee23dc06e5ccd29edcaaa5de634cbc1e 100644 --- a/Modules/Visualization/MonteverdiCore/src/mvdAbstractLayerModel.cxx +++ b/Modules/Visualization/MonteverdiCore/src/mvdAbstractLayerModel.cxx @@ -37,7 +37,7 @@ // // OTB includes (sorted by alphabetic order) - +#include "otbGeoInformationConversion.h" // // Monteverdi includes (sorted by alphabetic order) #include "mvdAlgorithm.h" @@ -62,6 +62,7 @@ namespace { char const * const STR_SENSOR = QT_TRANSLATE_NOOP( "mvd::AbstractLayerModel", "Sensor" ); char const * const STR_UNKNOWN = QT_TRANSLATE_NOOP( "mvd::AbstractLayerModel", "Unknown" ); +char const * const STR_NOEPSG = QT_TRANSLATE_NOOP( "mvd::AbstractLayerModel", "No EPSG" ); } // end of anonymous namespace. @@ -98,16 +99,12 @@ GetSpatialReferenceType( const std::string & wkt, bool hasKwl ) OGRSpatialReference ogr_sr( wkt.c_str() ); - const char * epsg = ogr_sr.GetAuthorityCode( "PROJCS" ); + if(ogr_sr.IsGeographic()) + return SRT_GEO; - if( epsg!=NULL && strcmp( epsg, "" )!=0 ) + if(ogr_sr.IsProjected()) return SRT_CARTO; - epsg = ogr_sr.GetAuthorityCode( "GEOGCS" ); - - if( epsg!=NULL && strcmp( epsg, "" )!=0 ) - return SRT_GEO; - return SRT_UNKNOWN; } @@ -117,7 +114,8 @@ GetSpatialReferenceType( const std::string & wkt, bool hasKwl ) AbstractLayerModel ::AbstractLayerModel( QObject* p ) : AbstractModel( p ), - VisibleInterface() + VisibleInterface(), + m_Name(QString()) { } @@ -158,19 +156,13 @@ AbstractLayerModel ? ToStdString( tr( STR_SENSOR ) ) : ToStdString( tr( STR_UNKNOWN ) ) ); - OGRSpatialReference ogr_sr( wkt.c_str() ); - - const char * epsg = ogr_sr.GetAuthorityCode( "PROJCS" ); - - if( epsg!=NULL && strcmp( epsg, "" )!=0 ) - return epsg; - - epsg = ogr_sr.GetAuthorityCode( "GEOGCS" ); - - if( epsg==NULL || strcmp( epsg, "" )==0 ) + int code = otb::GeoInformationConversion::ToEPSG(wkt); + if(code < 0) return ToStdString( tr( STR_UNKNOWN ) ); + else if(code == 0) + return ToStdString( tr( STR_NOEPSG ) ); - return epsg; + return boost::lexical_cast<std::string>(code); } /*******************************************************************************/ @@ -189,6 +181,26 @@ AbstractLayerModel virtual_ToWgs84( p, wgs84, alt ); } +/*****************************************************************************/ +void +AbstractLayerModel +::SetName(const QString & name) +{ + if (name != m_Name) + { + m_Name = name; + emit NameChanged(); + } +} + +/*****************************************************************************/ +const QString & +AbstractLayerModel +::GetName() const +{ + return m_Name; +} + /*******************************************************************************/ bool AbstractLayerModel diff --git a/Modules/Visualization/MonteverdiCore/src/mvdStackedLayerModel.cxx b/Modules/Visualization/MonteverdiCore/src/mvdStackedLayerModel.cxx index 607d9bdca10f90bc2864532669459f0c04497817..c4d050b792d0e318ce71a5f884206bcd284c5e1c 100644 --- a/Modules/Visualization/MonteverdiCore/src/mvdStackedLayerModel.cxx +++ b/Modules/Visualization/MonteverdiCore/src/mvdStackedLayerModel.cxx @@ -270,6 +270,15 @@ StackedLayerModel // Remove layer-model. AbstractLayerModel * layer = it->second; + // Disconnect the renaming signals + QObject::disconnect( + layer, + SIGNAL( NameChanged() ), + // from: + this, + SIGNAL( LayerRenamed() ) + ); + m_LayerModels.erase( it ); m_Keys.erase( m_Keys.begin() + index ); @@ -394,6 +403,15 @@ StackedLayerModel m_LayerModels.insert( LayerModelMap::value_type( key, model ) ); m_Keys.insert( m_Keys.begin() + index, key ); + // Connect the renaming signals + QObject::connect( + model, + SIGNAL( NameChanged() ), + // to: + this, + SIGNAL( LayerRenamed() ) + ); + // // Update pointer to current. if( emitCurrentChanged ) diff --git a/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx b/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx index c60019e18f46af3927d9534b8907b09f87760878..378763d26e561bbc8bae2c0c51ac923dd80a3e58 100644 --- a/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx +++ b/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx @@ -94,6 +94,7 @@ VectorImageModel ::SetFilename( const QString& filename , int w, int h) { setObjectName( filename ); + SetName( QFileInfo( filename ).fileName() ); // 1. store the input filename FilenameInterface::SetFilename( filename ); diff --git a/Modules/Visualization/MonteverdiGui/src/mvdLayerStackItemModel.cxx b/Modules/Visualization/MonteverdiGui/src/mvdLayerStackItemModel.cxx index e6c7a548b4f5d8257ee7c4b0e4cf4f3b1db68b2f..cc073ecd5faf604eb108b92a48e7eccfde4e58c6 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdLayerStackItemModel.cxx +++ b/Modules/Visualization/MonteverdiGui/src/mvdLayerStackItemModel.cxx @@ -423,6 +423,7 @@ LayerStackItemModel } break; + case Qt::EditRole: case Qt::DisplayRole: switch( idx.column() ) { @@ -447,21 +448,7 @@ LayerStackItemModel break; case COLUMN_NAME: - if( layer->inherits( - VectorImageModel::staticMetaObject.className() ) ) - { - const VectorImageModel * vectorImageModel = - qobject_cast< const VectorImageModel * >( layer ); - assert( vectorImageModel!=NULL ); - - // qDebug() << "filename:" << vectorImageModel->GetFilename(); - - return QFileInfo( vectorImageModel->GetFilename() ).fileName(); - } - else - { - qDebug() << "Unhandled AbstractLayerModel subclass."; - } + return layer->GetName(); break; case COLUMN_EFFECT: @@ -842,7 +829,7 @@ LayerStackItemModel // qDebug() // << this << "::setData(" << idx << "," << value << "," << role << ")"; - if( idx.column()==COLUMN_NAME && role==Qt::CheckStateRole ) + if( idx.column()==COLUMN_NAME ) { // qDebug() << idx.row() << "check-state:" << value; @@ -856,30 +843,45 @@ LayerStackItemModel assert( layer!=NULL ); assert( layer==dynamic_cast< VisibleInterface * >( layer ) ); - VisibleInterface * interface = dynamic_cast< VisibleInterface * >( layer ); assert( interface!=NULL ); - switch( value.toInt() ) + switch( role ) { - case Qt::Checked: - interface->SetVisible( true ); + case Qt::EditRole: + { + QString strValue = value.toString(); + if( !strValue.isEmpty() ) + { + layer->SetName( strValue ); + emit dataChanged( idx, idx ); + return true; + } + } break; - - case Qt::Unchecked: - interface->SetVisible( false ); + case Qt::CheckStateRole: + switch( value.toInt() ) + { + case Qt::Checked: + interface->SetVisible( true ); + break; + + case Qt::Unchecked: + interface->SetVisible( false ); + break; + + default: + assert( false && "Unhandled Qt::CheckedState value." ); + break; + } + emit dataChanged( idx, idx ); + return true; break; default: - assert( false && "Unhandled Qt::CheckedState value." ); break; } - - emit dataChanged( idx, idx ); - - return true; } - return false; } diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx index 178a8d55608661aa4253607f272cd54b5bddb6ad..120365d510b1fd70784ebba3baa9939de06f4635 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx @@ -752,30 +752,31 @@ std::vector<std::string> Application::GetChoiceNames(std::string name) void Application::SetDefaultParameterInt(std::string parameter, int value) { Parameter* param = GetParameterByKey(parameter); + bool hasUserValue = param->HasUserValue(); if (dynamic_cast<RadiusParameter*>(param)) { RadiusParameter* paramRadius = dynamic_cast<RadiusParameter*>(param); paramRadius->SetDefaultValue(value); - paramRadius->SetValue(value); + if (!hasUserValue) paramRadius->SetValue(value); } else if (dynamic_cast<IntParameter*>(param)) { IntParameter* paramInt = dynamic_cast<IntParameter*>(param); paramInt->SetDefaultValue(value); - paramInt->SetValue(value); + if (!hasUserValue) paramInt->SetValue(value); } else if (dynamic_cast<FloatParameter*>(param)) { FloatParameter* paramFloat = dynamic_cast<FloatParameter*>(param); paramFloat->SetDefaultValue(static_cast<float>(value)); - paramFloat->SetValue(static_cast<float>(value)); + if (!hasUserValue) paramFloat->SetValue(static_cast<float>(value)); } else if (dynamic_cast<RAMParameter*>(param)) { RAMParameter* paramRAM = dynamic_cast<RAMParameter*>(param); paramRAM->SetDefaultValue(static_cast<unsigned int>(value)); - paramRAM->SetValue(static_cast<unsigned int>(value)); + if (!hasUserValue) paramRAM->SetValue(static_cast<unsigned int>(value)); } } @@ -787,7 +788,7 @@ void Application::SetDefaultParameterFloat(std::string parameter, float value) { FloatParameter* paramFloat = dynamic_cast<FloatParameter*>(param); paramFloat->SetDefaultValue(value); - paramFloat->SetValue(value); + if (!param->HasUserValue()) paramFloat->SetValue(value); } } diff --git a/Packaging/CMakeLists.txt b/Packaging/CMakeLists.txt index 55dee29e7d807e4ddffe3e60d5a5a85bcdeba706..c7f84df71f56992b37adc50a57eafbc1a7a4997d 100644 --- a/Packaging/CMakeLists.txt +++ b/Packaging/CMakeLists.txt @@ -198,8 +198,7 @@ prepare_search_dirs(PKG_SEARCHDIRS) set(PKG_PEFILES) prepare_file_list(PKG_PEFILES) foreach(pfile ${PKG_PEFILES}) - get_filename_component(pfile_name ${pfile} NAME) - process_file_recurse(${pfile_name}) + process_file_recurse(${pfile}) endforeach() install_include_dirs() diff --git a/Packaging/prepare_file_list.cmake b/Packaging/prepare_file_list.cmake index 4d83bc601da079a89f57d98bda00e54a00b08501..8ba085b74570773bfd99c5a7c067c72b978f63f4 100644 --- a/Packaging/prepare_file_list.cmake +++ b/Packaging/prepare_file_list.cmake @@ -29,22 +29,23 @@ function(prepare_file_list file_list_result) return() endif() - set(file_list "${otbapp_launcher}") - - if(HAVE_QT4) - list(APPEND file_list "otbApplicationLauncherQt${EXE_EXT}") - endif() + # find OTB targets + set(_otb_targets_path + "${SUPERBUILD_INSTALL_DIR}/lib/cmake/OTB-${PKG_OTB_VERSION_MAJOR}.${PKG_OTB_VERSION_MINOR}") + file(GLOB _targets_config_files "${_otb_targets_path}/OTBTargets-*.cmake") + set(_IMPORT_PREFIX ${SUPERBUILD_INSTALL_DIR}) + foreach(f ${_targets_config_files}) + file(STRINGS ${f} _f_content REGEX " IMPORTED_LOCATION_[A-Z]+ ") + string(REGEX REPLACE " +IMPORTED_LOCATION_[A-Z]+ \"([^\"]+)\"" "\\1;" _filtered ${_f_content}) + string(CONFIGURE "${_filtered}" _configured) + list(APPEND file_list "${_configured}") + endforeach() - if(HAVE_MVD) - list(APPEND file_list "monteverdi${EXE_EXT}") - list(APPEND file_list "mapla${EXE_EXT}") - endif() - if(HAVE_PYTHON) list(APPEND file_list "_otbApplication${PYMODULE_EXT}") endif() - foreach(exe_file "iceViewer" "otbTestDriver" "SharkVersion") + foreach(exe_file "SharkVersion") if(EXISTS "${SUPERBUILD_INSTALL_DIR}/bin/${exe_file}${EXE_EXT}") list(APPEND file_list "${exe_file}${EXE_EXT}") else() @@ -88,12 +89,7 @@ function(prepare_file_list file_list_result) if(MSVC) list(APPEND file_list "ucrtbase.dll") list(APPEND file_list "proj.dll") - endif() - - set(otb_applications_dir "${SUPERBUILD_INSTALL_DIR}/lib/otb/applications") - file(GLOB OTB_APPS_LIST "${otb_applications_dir}/otbapp_*${LIB_EXT}") # /lib/otb - list(APPEND file_list ${OTB_APPS_LIST}) - + endif() set(${file_list_result} ${file_list} PARENT_SCOPE) endfunction() diff --git a/Packaging/process_file_recurse.cmake b/Packaging/process_file_recurse.cmake index b83616ad864c070e3d3b390b809d20dca00303df..b8f31b4ededfb3faa10d848c5a2e0bbc9f4f7155 100644 --- a/Packaging/process_file_recurse.cmake +++ b/Packaging/process_file_recurse.cmake @@ -19,7 +19,14 @@ # function(process_file_recurse input_file) set(input_file_full_path) - search_library(${input_file} PKG_SEARCHDIRS input_file_full_path) + if(IS_ABSOLUTE "${input_file}" AND EXISTS "${input_file}") + set(input_file_full_path ${input_file}) + if(PKG_DEBUG) + message("Found '${input_file}' (return)") + endif() + else() + search_library(${input_file} PKG_SEARCHDIRS input_file_full_path) + endif() if(NOT input_file_full_path) if(LINUX) setif_value_in_list(is_gtk_lib "${input_file}" ALLOWED_SYSTEM_DLLS) diff --git a/SuperBuild/CMake/External_otb.cmake b/SuperBuild/CMake/External_otb.cmake index 465683a9b48222947d20f7fdf5354dc4d8f6c0ce..6890d46d7163864f57a6934ab2cf438e8074a903 100644 --- a/SuperBuild/CMake/External_otb.cmake +++ b/SuperBuild/CMake/External_otb.cmake @@ -131,7 +131,7 @@ ADD_SUPERBUILD_CMAKE_VAR(OTB Boost_LIBRARY_DIR) set(OTB_MODULES_CONFIG) if(WITH_REMOTE_MODULES) - foreach(remote_module SertitObject Mosaic otbGRM) + foreach(remote_module SertitObject Mosaic otbGRM OTBFFSforGMM) list(APPEND OTB_MODULES_CONFIG -DModule_${remote_module}:BOOL=ON) endforeach() else() diff --git a/SuperBuild/patches/QT4/configure_qt4.bat.in b/SuperBuild/patches/QT4/configure_qt4.bat.in index 8ce395fc784d0c9da6743636f3f9e35713bc41d7..5b496a4c7011ea79ded3775c26bb40e9401952b0 100755 --- a/SuperBuild/patches/QT4/configure_qt4.bat.in +++ b/SuperBuild/patches/QT4/configure_qt4.bat.in @@ -4,7 +4,7 @@ set SB_SAVE_LIB=%LIB% set INCLUDE=%INCLUDE%;@QT4_INCLUDE_PREFIX_NATIVE@;@QT4_INCLUDE_PREFIX_NATIVE@\freetype2 set LIB=%LIB%;@QT4_LIB_PREFIX_NATIVE@ -@QT4_CONFIGURE_SCRIPT@ -prefix @QT4_INSTALL_PREFIX_NATIVE@ -L @QT4_LIB_PREFIX_NATIVE@ -I @QT4_INCLUDE_PREFIX_NATIVE@ -I @QT4_INCLUDE_PREFIX_NATIVE@\freetype2 -opensource -confirm-license -release -shared -nomake demos -nomake examples -nomake tools -no-phonon-backend -no-phonon -no-script -no-scripttools -no-multimedia -no-audio-backend -no-webkit -no-declarative -no-accessibility -no-qt3support -no-xmlpatterns -no-sql-sqlite -no-openssl -no-libtiff -no-libmng -system-libpng -system-libjpeg -system-zlib @QT4_SB_CONFIG@ +@QT4_CONFIGURE_SCRIPT@ -prefix @QT4_INSTALL_PREFIX_NATIVE@ -L @QT4_LIB_PREFIX_NATIVE@ -I @QT4_INCLUDE_PREFIX_NATIVE@ -I @QT4_INCLUDE_PREFIX_NATIVE@\freetype2 -opensource -confirm-license -release -shared -nomake demos -nomake examples -nomake tools -no-phonon-backend -no-phonon -no-script -no-scripttools -no-multimedia -no-audio-backend -no-webkit -no-declarative -no-accessibility -no-qt3support -no-xmlpatterns -no-sql-sqlite -no-openssl -no-libtiff -no-libmng -system-libpng -system-libjpeg -system-zlib -no-icu @QT4_SB_CONFIG@ set INCLUDE=%SB_SAVE_INCLUDE% set LIB=%SB_SAVE_LIB% diff --git a/SuperBuild/patches/QT4/configure_qt4.sh.in b/SuperBuild/patches/QT4/configure_qt4.sh.in index ee254d3f306fa713ec12809ae7c3616485d31497..84e76ca09d0bcb4936aa29731f64b071da92112e 100755 --- a/SuperBuild/patches/QT4/configure_qt4.sh.in +++ b/SuperBuild/patches/QT4/configure_qt4.sh.in @@ -1 +1 @@ -@QT4_CONFIGURE_SCRIPT@ -prefix @QT4_INSTALL_PREFIX_NATIVE@ -L @QT4_LIB_PREFIX_NATIVE@ -I @QT4_INCLUDE_PREFIX_NATIVE@ -I @QT4_INCLUDE_PREFIX_NATIVE@/freetype2 -opensource -confirm-license -release -shared -nomake demos -nomake examples -nomake tools -no-phonon-backend -no-phonon -no-script -no-scripttools -no-multimedia -no-audio-backend -no-webkit -no-declarative -no-accessibility -no-qt3support -no-xmlpatterns -no-sql-sqlite -no-openssl -no-libtiff -no-libmng -system-libpng -system-libjpeg -system-zlib -no-dbus @QT4_SB_CONFIG@ +@QT4_CONFIGURE_SCRIPT@ -prefix @QT4_INSTALL_PREFIX_NATIVE@ -L @QT4_LIB_PREFIX_NATIVE@ -I @QT4_INCLUDE_PREFIX_NATIVE@ -I @QT4_INCLUDE_PREFIX_NATIVE@/freetype2 -opensource -confirm-license -release -shared -nomake demos -nomake examples -nomake tools -no-phonon-backend -no-phonon -no-script -no-scripttools -no-multimedia -no-audio-backend -no-webkit -no-declarative -no-accessibility -no-qt3support -no-xmlpatterns -no-sql-sqlite -no-openssl -no-libtiff -no-libmng -system-libpng -system-libjpeg -system-zlib -no-dbus -no-icu @QT4_SB_CONFIG@ diff --git a/Utilities/Doxygen/doxygen.config.in b/Utilities/Doxygen/doxygen.config.in index f23888ac099da3173b533dbd68d4db667ca6140c..c77823e62a62e27a128e9eb45880439187afe79e 100644 --- a/Utilities/Doxygen/doxygen.config.in +++ b/Utilities/Doxygen/doxygen.config.in @@ -1121,7 +1121,7 @@ HTML_COLORSTYLE_HUE = 220 HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 +# radiance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not