diff --git a/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.txx b/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.txx index 2b593a76e6cfb14970b3635e30e13023af3ec87d..7ebfd7cc97b1ecc9dacfd8990e3efed57392c082 100644 --- a/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.txx +++ b/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.txx @@ -168,7 +168,7 @@ void ReflectanceToSurfaceReflectanceImageFilter<TInputImage,TOutputImage> ::GenerateParameters() { - if(m_IsSetAtmosphericRadiativeTerms==false) + if(!m_IsSetAtmosphericRadiativeTerms) { this->UpdateAtmosphericRadiativeTerms(); } diff --git a/Examples/GeospatialAnalysis/PostGISCreateTable.cxx b/Examples/GeospatialAnalysis/PostGISCreateTable.cxx index 0fdc06602cc2d5f2217cdc0fcce6e9ad6028bf7e..2f63d9d83d2c8cf500df93cfa72f9b2c3bc2fdd1 100644 --- a/Examples/GeospatialAnalysis/PostGISCreateTable.cxx +++ b/Examples/GeospatialAnalysis/PostGISCreateTable.cxx @@ -15,24 +15,46 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ + +// Software Guide : BeginLatex +// +// This test uses a transactor to create a table. The transactor +// needs to have a copy constructor, so the initialization is done +// correctly for the class variables which are set before the transaction. +// Let's look at the minimal code required to use this algorithm. First, the +// following header defining the \doxygen{otb}{PostGISCreateTableTransactor} class +// must be included. +// Software Guide : EndLatex + #include "itkExceptionObject.h" #include "otbMacro.h" +// Software Guide : BeginCodeSnippet #include "otbPostGISCreateTableTransactor.h" #include "otbPostGISConnectionImplementation.h" - -/** This test uses a transactor to create a table. The transactor -needs to have a copy constructor, so the initialization is done -correctly for the class variables which are set before the transaction -*/ +// Software Guide : EndCodeSnippet int main(int argc, char * argv[]) { + + // Software Guide : BeginLatex + // + // Instanciation of the PQXX-based transactor + // for creating PostGIS tables. + // Software Guide : EndLatex + + // Software Guide : BeginCodeSnippet typedef otb::PostGISCreateTableTransactor TransactorType; - - //Instantiation + TransactorType myTransactor; - + // Software Guide : EndCodeSnippet + + // Software Guide : BeginLatex + // + // Set arguments of the transactor + // Software Guide : EndLatex + + // Software Guide : BeginCodeSnippet unsigned short dimension = 2; myTransactor.SetDimension( dimension ); @@ -43,26 +65,43 @@ int main(int argc, char * argv[]) myTransactor.SetSRID( srid ); myTransactor.SetRemoveExistingTable( true ); + // Software Guide : EndCodeSnippet + + // Software Guide : BeginLatex + // + // After defining the transcator, we need to create the + // connection interface to the PostgreSQL database. + // This is done by the \doxygen{otb}{PostGISConnectionImplementation}. + // + // Software Guide : EndLatex + // Software Guide : BeginCodeSnippet const std::string hostName = argv[1]; const std::string dbName = argv[2]; const std::string userName = argv[3]; const std::string userPassword = argv[4]; - typedef otb::PostGISConnectionImplementation GISConnectionType; - - //Instantiation + GISConnectionType::Pointer connection = GISConnectionType::New(); - + connection->SetHost( hostName ); connection->SetDBName( dbName ); connection->SetUser( userName ); connection->SetPassword( userPassword ); + // Software Guide : EndCodeSnippet - connection->ConnectToDB(); + // Software Guide : BeginLatex + // + // Let's now connect to the database and perform the transaction + // with the method \code{PerformTransaction}. + // + // Software Guide : EndLatex + // Software Guide : BeginCodeSnippet + connection->ConnectToDB(); + connection->PerformTransaction( myTransactor ); - + // Software Guide : EndCodeSnippet return EXIT_SUCCESS; } diff --git a/Examples/GeospatialAnalysis/PostGISCreateTable.cxx~ b/Examples/GeospatialAnalysis/PostGISCreateTable.cxx~ index 67403356073c0490422027549d70a13d41766e93..2f63d9d83d2c8cf500df93cfa72f9b2c3bc2fdd1 100644 --- a/Examples/GeospatialAnalysis/PostGISCreateTable.cxx~ +++ b/Examples/GeospatialAnalysis/PostGISCreateTable.cxx~ @@ -15,24 +15,46 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ + +// Software Guide : BeginLatex +// +// This test uses a transactor to create a table. The transactor +// needs to have a copy constructor, so the initialization is done +// correctly for the class variables which are set before the transaction. +// Let's look at the minimal code required to use this algorithm. First, the +// following header defining the \doxygen{otb}{PostGISCreateTableTransactor} class +// must be included. +// Software Guide : EndLatex + #include "itkExceptionObject.h" #include "otbMacro.h" +// Software Guide : BeginCodeSnippet #include "otbPostGISCreateTableTransactor.h" #include "otbPostGISConnectionImplementation.h" +// Software Guide : EndCodeSnippet -/** This test uses a transactor to create a table. The transactor -needs to have a copy constructor, so the initialization is done -correctly for the class variables which are set before the transaction -*/ - -int otbPostGISCreateTableTransactorCreate(int argc, char * argv[]) +int main(int argc, char * argv[]) { + + // Software Guide : BeginLatex + // + // Instanciation of the PQXX-based transactor + // for creating PostGIS tables. + // Software Guide : EndLatex + + // Software Guide : BeginCodeSnippet typedef otb::PostGISCreateTableTransactor TransactorType; - - //Instantiation + TransactorType myTransactor; - + // Software Guide : EndCodeSnippet + + // Software Guide : BeginLatex + // + // Set arguments of the transactor + // Software Guide : EndLatex + + // Software Guide : BeginCodeSnippet unsigned short dimension = 2; myTransactor.SetDimension( dimension ); @@ -43,26 +65,43 @@ int otbPostGISCreateTableTransactorCreate(int argc, char * argv[]) myTransactor.SetSRID( srid ); myTransactor.SetRemoveExistingTable( true ); + // Software Guide : EndCodeSnippet + + // Software Guide : BeginLatex + // + // After defining the transcator, we need to create the + // connection interface to the PostgreSQL database. + // This is done by the \doxygen{otb}{PostGISConnectionImplementation}. + // + // Software Guide : EndLatex + // Software Guide : BeginCodeSnippet const std::string hostName = argv[1]; const std::string dbName = argv[2]; const std::string userName = argv[3]; const std::string userPassword = argv[4]; - typedef otb::PostGISConnectionImplementation GISConnectionType; - - //Instantiation + GISConnectionType::Pointer connection = GISConnectionType::New(); - + connection->SetHost( hostName ); connection->SetDBName( dbName ); connection->SetUser( userName ); connection->SetPassword( userPassword ); + // Software Guide : EndCodeSnippet - connection->ConnectToDB(); + // Software Guide : BeginLatex + // + // Let's now connect to the database and perform the transaction + // with the method \code{PerformTransaction}. + // + // Software Guide : EndLatex + // Software Guide : BeginCodeSnippet + connection->ConnectToDB(); + connection->PerformTransaction( myTransactor ); - + // Software Guide : EndCodeSnippet return EXIT_SUCCESS; } diff --git a/Examples/GeospatialAnalysis/otbGeospatialAnalysisExamplesTests.cxx~ b/Examples/GeospatialAnalysis/otbGeospatialAnalysisExamplesTests.cxx~ index fbac952a9c5c3071303a0a2e8d0cc05ec0d4f14c..6b97d574df14487913a55777e75b3cbf190d9d07 100644 --- a/Examples/GeospatialAnalysis/otbGeospatialAnalysisExamplesTests.cxx~ +++ b/Examples/GeospatialAnalysis/otbGeospatialAnalysisExamplesTests.cxx~ @@ -29,6 +29,6 @@ void RegisterTests() } #undef main -#define main OBIAImageToLabelToImageTest +#define main GeospatialAnalysisPostGISCreateTableTest #include "PostGISCreateTable.cxx" diff --git a/Examples/OBIA/ImageToLabelToImage.cxx b/Examples/OBIA/ImageToLabelToImage.cxx index 06840aba7f978f9dc3722f746103ea84a0afa826..bc04b9c3399fc5f46deb80416f09479e9cb5aba2 100644 --- a/Examples/OBIA/ImageToLabelToImage.cxx +++ b/Examples/OBIA/ImageToLabelToImage.cxx @@ -65,13 +65,14 @@ int main(int argc, char * argv[]) const int dim = 2; typedef unsigned short PixelType; typedef otb::Image< PixelType, dim > ImageType; - // Software Guide : EndCodeSnippet + typedef itk::LabelObject< PixelType, dim > LabelObjectType; typedef itk::LabelMap< LabelObjectType > LabelMapType; + // Software Guide : EndCodeSnippet // Software Guide : BeginLatex // - // The reader is instantiated and + // As usual, the reader is instantiated and // the input image is set. // // Software Guide : EndLatex @@ -91,7 +92,7 @@ int main(int argc, char * argv[]) // \item \code{FullyConnected}: Set whether the connected // components are defined strictly by face connectivity or by // face+edge+vertex connectivity. Default is FullyConnectedOff. - // \item InputForegroundValue/OutputBackgroundValue specify the + // \item \code{InputForegroundValue/OutputBackgroundValue}: specify the // pixel value of input/output of the foreground/background. // the input image is set. // \end{itemize} @@ -109,7 +110,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginLatex // - // Then the inverse process is . + // Then the inverse process is uses to recreate a image of labels. // The \doxygen{itk}{LabelMapToLabelImageFilter} converts a // LabelMap to a labeled image. // diff --git a/Examples/OBIA/ShapeAttributeComputation.cxx b/Examples/OBIA/ShapeAttributeComputation.cxx index 93384fa7e2ae735d3e210e7b685de6631900f252..3409517e448400c6876f0e3c41f2a34771b693eb 100644 --- a/Examples/OBIA/ShapeAttributeComputation.cxx +++ b/Examples/OBIA/ShapeAttributeComputation.cxx @@ -23,7 +23,9 @@ // Software Guide : BeginLatex // -// This example shows the +// This basic example shows how compute shape attributes at the object level. +// The input image is firstly translate in a set of regions (of \doxygen{itk}{ShapeLabelObject}) +// and some attributes values of each object are then save to an ASCII file. // // Software Guide : EndLatex @@ -39,9 +41,7 @@ int main(int argc, char * argv[]) { - const int dim = 2; - typedef unsigned long PixelType; - typedef itk::Image< PixelType, dim > ImageType; + if( argc != 3) { @@ -49,42 +49,95 @@ int main(int argc, char * argv[]) return EXIT_FAILURE; } - // read the input image + // Software Guide : BeginLatex + // + // The image types are defined using pixel types and + // dimension. The input image is defined as an \doxygen{otb}{Image}. + // + // Software Guide : EndLatex + + // Software Guide : BeginCodeSnippet + const int dim = 2; + typedef unsigned long PixelType; + typedef itk::Image< PixelType, dim > ImageType; + typedef unsigned long LabelType; + typedef itk::ShapeLabelObject< LabelType, dim > LabelObjectType; + typedef itk::LabelMap< LabelObjectType > LabelMapType; + typedef itk::LabelImageToLabelMapFilter< ImageType, LabelMapType > ConverterType; + + // Software Guide : EndCodeSnippet + + // Software Guide : BeginLatex + // + // Firstly, the image reader is instantiated. + // + // Software Guide : EndLatex + + // Software Guide : BeginCodeSnippet typedef itk::ImageFileReader< ImageType > ReaderType; ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName( argv[1] ); + // Software Guide : EndCodeSnippet + - // define the object type. Here the ShapeLabelObject type + // Software Guide : BeginLatex + // + // Here the \doxygen{itk}{ShapeLabelObject} type // is chosen in order to read some attribute related to the shape // of the objects (by opposition to the content of the object, with - // the StatisticsLabelObejct). - typedef unsigned long LabelType; - typedef itk::ShapeLabelObject< LabelType, dim > LabelObjectType; - typedef itk::LabelMap< LabelObjectType > LabelMapType; + // the \doxygen{itk}{StatisticsLabelObject). + // + // Software Guide : EndLatex - // convert the image in a collection of objects - typedef itk::LabelImageToLabelMapFilter< ImageType, LabelMapType > ConverterType; + // Software Guide : BeginCodeSnippet + typedef itk::ShapeLabelMapFilter< LabelMapType > ShapeFilterType; + // Software Guide : EndCodeSnippet + + + // Software Guide : BeginLatex + // + // The input image is converted in a collection of objects + // + // Software Guide : EndLatex + + // Software Guide : BeginCodeSnippet ConverterType::Pointer converter = ConverterType::New(); converter->SetInput( reader->GetOutput() ); converter->SetBackgroundValue( itk::NumericTraits<LabelType>::min() ); - typedef itk::ShapeLabelMapFilter< LabelMapType > ShapeFilterType; ShapeFilterType::Pointer shape = ShapeFilterType::New(); shape->SetInput( converter->GetOutput() ); - // update the shape filter, so its output will be up to date + // Software Guide : EndCodeSnippet + + + // Software Guide : BeginLatex + // + // Update the shape filter, so its output will be up to date. + // + // Software Guide : EndLatex + + // Software Guide : BeginCodeSnippet shape->Update(); + // Software Guide : EndCodeSnippet std::cout << "Nb. objects conv. " << converter->GetOutput()->GetNumberOfLabelObjects() << std::endl; - std::cout << "Nb. objects shape " << shape->GetOutput()->GetNumberOfLabelObjects() << std::endl; - // then we can read the attribute values we're interested in. The BinaryImageToShapeLabelMapFilter + std::cout << "Nb. objects shape " << shape->GetOutput()->GetNumberOfLabelObjects() << std::endl; + + // Software Guide : BeginLatex + // + // Then, we can read the attribute values we're interested in. The \doxygen{itk}{BinaryImageToShapeLabelMapFilter // produce consecutive labels, so we can use a for loop and GetLabelObject() method to retrieve // the label objects. If the labels are not consecutive, the GetNthLabelObject() method must be // use instead of GetLabelObject(), or an iterator on the label // object container of the label map. - std::ofstream outfile( argv[2] ); - + // In this example, we print 2 shape attributes of each object to a text file (the size and the centroid coordinates). + // + // Software Guide : EndLatex + + // Software Guide : BeginCodeSnippet + std::ofstream outfile( argv[2] ); LabelMapType::Pointer labelMap = shape->GetOutput(); for( unsigned long label=1; label<=labelMap->GetNumberOfLabelObjects(); label++ ) @@ -96,5 +149,7 @@ int main(int argc, char * argv[]) } outfile.close(); + // Software Guide : EndCodeSnippet + return EXIT_SUCCESS; } diff --git a/Examples/OBIA/otbRadiometricAttributesLabelMapFilterExample.cxx b/Examples/OBIA/otbRadiometricAttributesLabelMapFilterExample.cxx index 87dd73dc2683a921eb65fd2dadc726fcea3e4166..fd21c7548dde5249adc95e9b23ebac658e097f28 100755 --- a/Examples/OBIA/otbRadiometricAttributesLabelMapFilterExample.cxx +++ b/Examples/OBIA/otbRadiometricAttributesLabelMapFilterExample.cxx @@ -17,9 +17,9 @@ =========================================================================*/ // Software Guide : BeginCommandLineArgs -// INPUTS: {/home/grizonnetm/OTB/Dev/OTB-Data/Examples/qb_RoadExtract2.tif} +// INPUTS: {qb_RoadExtract2.tif} // OUTPUTS: {OBIARadiometricAttribute1.tif} -// STATS::Ndvi::Mean 0 0.3 16 16 200 1.0 +// STATS::Ndvi::Mean 0 -0.3 16 16 10 1.0 // Software Guide : EndCommandLineArgs // Software Guide : BeginLatex @@ -44,9 +44,9 @@ // \item NDWI2 // \item Intensity // \item and original B, G, R and NIR channels - // \end{itemize}, + // \end{itemize} // Here we use the \doxygen{otb}{AttributesMapOpeningLabelMapFilter} to extract vegetated areas. -// +// Let's get to the source code explanation. // // Software Guide : EndLatex @@ -115,7 +115,8 @@ int main(int argc, char * argv[]) vreader->SetFileName(reffname); // Software Guide : BeginLatex // - // Firstly, segment input image using the Mean Shift algorithm. + // Firstly, segment the input image by using the Mean Shift algorithm (see \ref{sec:MeanShift} for deeper + // explanations). // // Software Guide : EndLatex @@ -134,11 +135,12 @@ int main(int argc, char * argv[]) // types. // // Software Guide : EndLatex -// Software Guide : BeginCodeSnippet + + // Software Guide : BeginCodeSnippet filter->SetInput(reader->GetOutput()); -// Software Guide : EndCodeSnippet + // Software Guide : EndCodeSnippet -// Software Guide : BeginLatex + // Software Guide : BeginLatex // // The \doxygen{itk}{LabelImageToLabelMapFilter} type is instantiated using the output // of the \doxygen{otb}{MeanShiftImageFilter}. This filter produces a labeled image @@ -163,7 +165,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginLatex // // Instantiate the \doxygen{otb}{RadiometricAttributesLabelMapFilter} to - // compute radiometric value on each label object. + // compute radiometric valuee on each label object. // // Software Guide : EndLatex @@ -208,7 +210,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginLatex // - // Then, Label object selected are transform in a Label Image using the \doxygen{itk}{LabelMapToLabelImageFilter} + // Then, Label objects selected are transform in a Label Image using the + // \doxygen{itk}{LabelMapToLabelImageFilter}. // // Software Guide : EndLatex @@ -234,3 +237,16 @@ int main(int argc, char * argv[]) return EXIT_SUCCESS; } + + // Software Guide : BeginLatex + // + // Figure~\ref{fig:RADIOMETRIC_LABEL_MAP_FILTER} shows the result of applying + // the object selection based on radiometric attributes. + // \begin{figure} \center + // \includegraphics[width=0.44\textwidth]{qb_RoadExtract2.eps} + // \includegraphics[width=0.44\textwidth]{OBIARadiometricAttribute1.eps} + // \itkcaption[Object based extraction based on ]{From left to right : original image, vegetation mask resulting from processing.} + // \label{fig:RADIOMETRIC_LABEL_MAP_FILTER} + // \end{figure} + // + // Software Guide : EndLatex diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index b58730cfbc4d2c15b63ddb79589d44eedc261e48..5931308ab5056b2544efab3170da8eeb3624d3a9 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -2,7 +2,7 @@ OTB-v.3.2.0 - Changes since version 3.0.0 (2010/01/15) ----------------------------------------- * Applications - - Monteverdi, a new all-in one useer-friendly graphical tool + - Monteverdi, a new all-in one user-friendly graphical tool for remote sensing data processing released as a separate package (see README file). * Library