diff --git a/Documentation/Cookbook/rst/recipes/improc.rst b/Documentation/Cookbook/rst/recipes/improc.rst index 0cfeb5b9f3be8f810325be5b1fa0797ebbaf536f..6e9e94e97714f6884113dfd1c75bea8c731d7a94 100644 --- a/Documentation/Cookbook/rst/recipes/improc.rst +++ b/Documentation/Cookbook/rst/recipes/improc.rst @@ -124,7 +124,6 @@ segmentation of very large image with theoretical guarantees of getting identical results to those without tiling. It has been developed by David Youssefi and Julien Michel during David - internship at CNES. For more a complete description of the LSMS method, please refer to the @@ -262,6 +261,35 @@ set the tile size using the *tilesizex* and *tilesizey* parameters. However unlike the *LSMSSegmentation* application, it does not require to write any temporary file to disk. +All-in-one +~~~~~~~~~~ + +The *LargeScaleMeanShift* application is a composite application that chains +all the previous steps: + +- Mean-Shift Smoothing +- Segmentation +- Small region merging +- Vectorization + +Most of the settings from the previous applications are also exposed in this +composite application. The range and spatial radius used for the segmentation +step are half the values used for Mean-Shift smooting, which are obtained from +LargeScaleMeanShift parameters. There are two output modes: vector (default) +and raster. When the raster output is chosen, last step (vectorization) is +skipped. + +:: + + otbcli_LargeScaleMeanShift -in input_image.tif + -spatialr 5 + -ranger 30 + -minsize 10 + -mode.vector.out segmentation_merged.shp + +There is a cleanup option that can be disabled in order to check intermediate +outputs of this composite application. + Dempster Shafer based Classifier Fusion --------------------------------------- diff --git a/Documentation/SoftwareGuide/Latex/Classification.tex b/Documentation/SoftwareGuide/Latex/Classification.tex index 90e4b41d462b8f717722d811ffcf49a5cd8bad7f..1ff8502157758e3c04540583c2c71933a8168db9 100644 --- a/Documentation/SoftwareGuide/Latex/Classification.tex +++ b/Documentation/SoftwareGuide/Latex/Classification.tex @@ -111,7 +111,7 @@ the later case, it creates several threads using OpenMP. There is a factory mechanism on top of the model class (see \doxygen{otb}{MachineLearningModelFactory}). Given an input file, the static function \code{CreateMachineLearningModel(...)} is able -to instanciate a model of the right type. +to instantiate a model of the right type. For unsupervised models, the target samples \textbf{still have to be set}. They won't be used so you can fill a ListSample with zeros. diff --git a/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx b/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx index 173daeec99126cd7cf288890d5c6d009b3a41b71..d8e234214bff46edfd1d5604390788f735a248b2 100644 --- a/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx +++ b/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx @@ -110,7 +110,7 @@ protected: "By default, hidden pixels will have the assigned label 0 in the output image. " "It's possible to define the label mask by another value, " "but be careful to not take a label from another class. " - "This application initalize the labels from 0 to N-1, " + "This application initialize the labels from 0 to N-1, " "N is the number of class (defined by 'nc' parameter)."); } diff --git a/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx b/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx index 2bcd26f3a7f08dbae692c8e36e75e6713e8bacc8..4081034a5f0fead34f03f3f0325f0ad6294b5582 100644 --- a/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx +++ b/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx @@ -48,7 +48,7 @@ LearningApplicationBase<TInputValue,TOutputValue> "in the network to optimize the result."); AddChoice("classifier.ann.t.reg", "Resilient Back-propagation algorithm"); SetParameterDescription("classifier.ann.t.reg", - "Almost the same as the Back-prop algorithm exept that it does not " + "Almost the same as the Back-prop algorithm except that it does not " "take into account the magnitude of the partial derivative (coordinate " "of the gradient) but only its sign."); diff --git a/Modules/Applications/AppImageUtils/app/otbConvert.cxx b/Modules/Applications/AppImageUtils/app/otbConvert.cxx index 4c50e1a2e7b17488d7fc9f8885e762e623c7d46f..cae4ff241190b38aaae1b077b6f946131a259bf7 100644 --- a/Modules/Applications/AppImageUtils/app/otbConvert.cxx +++ b/Modules/Applications/AppImageUtils/app/otbConvert.cxx @@ -192,26 +192,30 @@ private: void DoUpdateParameters() ITK_OVERRIDE { // Read information - typedef otb::ImageMetadataInterfaceBase ImageMetadataInterfaceType; - ImageMetadataInterfaceType::Pointer metadataInterface = + if ( HasValue("in") ) + { + 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); + 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); - } + 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); + } + } + } diff --git a/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx b/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx index 6975ae6450479dc494e881dce0d9948f23bc0b0f..813fa5c2d043ed1e4abdc84d2c6af1a4217ec679 100644 --- a/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx +++ b/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx @@ -256,9 +256,16 @@ private: int mode = GetParameterInt("mode"); // Get the inputs - auto inList = this->GetParameterImageList("il"); - auto vectorDataList = this->GetParameterStringList("vl"); - auto nameList = this->GetParameterStringList("names"); + auto inList = FloatVectorImageListType::New(); + std::vector<std::string> vectorDataList; + std::vector<std::string> nameList; + + if (IsParameterEnabled("il") && HasValue("il")) + inList = this->GetParameterImageList("il"); + if (IsParameterEnabled("vl") && HasValue("vl")) + vectorDataList = this->GetParameterStringList("vl"); + if (IsParameterEnabled("names") && HasValue("names")) + nameList = this->GetParameterStringList("names"); std::string tileDir = this->GetParameterString("tiledir"); diff --git a/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx b/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx index dee453835a8e034816bb943bce9b55e78bdad085..8f63bf13ef99f1062726c988b7c6b18a8aa236d5 100644 --- a/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx +++ b/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx @@ -76,12 +76,12 @@ private: " will speed-up convergence, at the expense of stability of the result.\n\n" "The application outputs the image of the final averaged spectral" - " signatures (fout), and can also optionnaly output the 2D" + " signatures (fout), and can also optionally output the 2D" " displacement field between input pixel position and final pixel" " position after convergence (foutpos).\n\n" "Note that computing an euclidean distance between spectral signatures" - " may be innacurate and that techniques such as color space transform or image" + " may be inaccurate 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 radiance (the higher the" diff --git a/Modules/Applications/AppStereo/app/otbBlockMatching.cxx b/Modules/Applications/AppStereo/app/otbBlockMatching.cxx index eaf57ea79a2c47f194d73db7c8e2cdad7db717c2..4884c77e5b94f2d09924c309a7e74aedb4a27900 100644 --- a/Modules/Applications/AppStereo/app/otbBlockMatching.cxx +++ b/Modules/Applications/AppStereo/app/otbBlockMatching.cxx @@ -139,7 +139,7 @@ private: " and resampled each input image into epipolar geometry (with " "GridBasedImageResampling).\n\n" "The application searches locally for the displacement between a reference" - " image and a secondary image. The correspondance is evaluated for each " + " image and a secondary image. The correspondence is evaluated for each " "pixel, based on a pair of local neighborhood windows. The displacement " "evaluated can be 1D (along lines) or 2D. Parameters allows to set the " "minimum and maximum disparities to search (both for horizontal and " diff --git a/Modules/Applications/AppStereo/app/otbDisparityMapToElevationMap.cxx b/Modules/Applications/AppStereo/app/otbDisparityMapToElevationMap.cxx index 6302a912f14fdaf910a80970825a70a384ef8807..25e4b96189fc1549b2875f9e55c255a75611cd38 100644 --- a/Modules/Applications/AppStereo/app/otbDisparityMapToElevationMap.cxx +++ b/Modules/Applications/AppStereo/app/otbDisparityMapToElevationMap.cxx @@ -124,7 +124,7 @@ private: AddParameter(ParameterType_InputImage,"io.rgrid","Right Grid"); SetParameterDescription("io.rgrid","Right epipolar grid (deformation grid " - "between rigth sensor et disparity spaces)"); + "between right sensor et disparity spaces)"); AddParameter(ParameterType_OutputImage,"io.out","Output elevation map"); SetParameterDescription("io.out", "Output elevation map in ground " diff --git a/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.txx b/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.txx index 13856ec403e303b1c78d95722269879dda56ed1c..b9bb88e318d687d85b48976f43a8b11bbd3d8b23 100644 --- a/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.txx +++ b/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.txx @@ -25,7 +25,7 @@ #include "otbMath.h" #include "otbMacro.h" -// Defaut when no tile hint available +// Default when no tile hint available #include "otbImageRegionSquareTileSplitter.h" namespace otb diff --git a/Modules/Core/Common/include/otbModelComponentBase.h b/Modules/Core/Common/include/otbModelComponentBase.h index c23c5a0062c267ec4c4fb87824a1f70246f6f7a2..1bb6180576b50fc517e10733d56c261981a0c944 100644 --- a/Modules/Core/Common/include/otbModelComponentBase.h +++ b/Modules/Core/Common/include/otbModelComponentBase.h @@ -126,7 +126,7 @@ public: /** Show the parameters in a minimal form in comparison to PrintSelf */ virtual void ShowParameters(std::ostream& os, itk::Indent indent) const; - // TODO: Distance between distribtions with some kind of member function... + // TODO: Distance between distributions with some kind of member function... protected: ModelComponentBase(); diff --git a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h index c7142a057d434cc1ae0ab30ffc8ee99e10a6241e..eb2dfbc8fb48ed0c381d145721f137db4a62b3f6 100644 --- a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h +++ b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h @@ -242,14 +242,14 @@ public: /** * Set/Get whether the maximum Feret diameter should be computed or not. The - * defaut value is false, because of the high computation time required. + * default value is false, because of the high computation time required. */ void SetComputeFeretDiameter(bool flag); bool GetComputeFeretDiameter() const; itkBooleanMacro(ComputeFeretDiameter); /** - * Set/Get whether the perimeter should be computed or not. The defaut value + * Set/Get whether the perimeter should be computed or not. The default value * is false, because of the high computation time required. */ void SetComputePerimeter(bool flag); diff --git a/Modules/Learning/LearningBase/include/otbMachineLearningModelTraits.h b/Modules/Learning/LearningBase/include/otbMachineLearningModelTraits.h index e9bc4cec29b9b3b45891e0265d63009bff34b76e..e5f53f39c8810b4aeb4fe4fc94b7cfddc5bb7ee0 100644 --- a/Modules/Learning/LearningBase/include/otbMachineLearningModelTraits.h +++ b/Modules/Learning/LearningBase/include/otbMachineLearningModelTraits.h @@ -37,7 +37,7 @@ namespace otb * and ValueType. * * \tparam TInput : input sample type (can be either a scalar type or - * a VariableLenghtVector + * a VariableLengthVector * \tparam isNumber either TrueType or FalseType for partial * specialization @@ -71,7 +71,7 @@ template <typename TInput> using MLMSampleTraits = MLMSampleTraitsImpl< TInput, * and ValueType. * * \tparam TInput : input sample type (can be either a scalar type or - * a VariableLenghtVector or a FixedArray + * a VariableLengthVector or a FixedArray * \tparam isNumber either TrueType or FalseType for partial * specialization diff --git a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimCosmoSkymedModel.cpp b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimCosmoSkymedModel.cpp index 8e7671c9636dac89080c186b2beed25f47f121f3..ca120f900184cc7ba600c3881b0515a4db80a5d7 100644 --- a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimCosmoSkymedModel.cpp +++ b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimCosmoSkymedModel.cpp @@ -99,7 +99,7 @@ bool ossimCosmoSkymedModel::InitSensorParams(const ossimKeywordlist &kwl, const /** - * @todo : see on real products (for exemple DESCENDING and ASCENDING) + * @todo : see on real products (for example DESCENDING and ASCENDING) */ const char* orbitDirection_str = kwl.find(prefix,"orbitDirection"); std::string orbitDirection(orbitDirection_str) ; diff --git a/Modules/Visualization/MonteverdiGui/include/mvdQtWidgetParameterInitializers.h b/Modules/Visualization/MonteverdiGui/include/mvdQtWidgetParameterInitializers.h index 4d92b3749d465a2aaf4f2e3f300d66d30182529b..61d425e75d7597f248933b7c80b066f1bda3aaf8 100644 --- a/Modules/Visualization/MonteverdiGui/include/mvdQtWidgetParameterInitializers.h +++ b/Modules/Visualization/MonteverdiGui/include/mvdQtWidgetParameterInitializers.h @@ -59,6 +59,8 @@ #include "otbWrapperQtWidgetOutputImageParameter.h" #include "otbWrapperQtWidgetOutputProcessXMLParameter.h" #include "otbWrapperQtWidgetOutputVectorDataParameter.h" +#include "otbWrapperQtWidgetComplexInputImageParameter.h" +#include "otbWrapperQtWidgetComplexOutputImageParameter.h" #include "otbWrapperQtWidgetParameterFactory.h" #endif //tag=QT4-boost-compatibility @@ -175,6 +177,23 @@ private: QWidget * m_View; }; +/** + * \class ComplexInputImageInitializer + * + * \ingroup OTBMonteverdiGUI + * + * \brief WIP. + */ +class ComplexInputImageInitializer : public std::unary_function< + otb::Wrapper::QtWidgetComplexInputImageParameter*, + void + > +{ +public: + inline ComplexInputImageInitializer(); + inline result_type operator () ( argument_type widget ) const; +}; + /** * \class InputVectorDataInitializer * @@ -281,6 +300,26 @@ private: QString m_Prefix; }; +/** + * \class ComplexOutputImageInitializer + * + * \ingroup OTBMonteverdiGUI + * + * \brief WIP. + */ +class ComplexOutputImageInitializer : public std::unary_function< + otb::Wrapper::QtWidgetComplexOutputImageParameter*, + void + > +{ +public: + inline ComplexOutputImageInitializer( const QString & prefix ); + inline result_type operator () ( argument_type widget ) const; + +private: + QString m_Prefix; +}; + /** * \class OutputVectorDataInitializer * @@ -441,6 +480,24 @@ InputImageListInitializer SetupWidget( widget, FileSelectionInitializer() ); } +/*****************************************************************************/ +inline +ComplexInputImageInitializer +::ComplexInputImageInitializer() +{ +} + +/*****************************************************************************/ +inline +ComplexInputImageInitializer::result_type +ComplexInputImageInitializer +::operator () ( argument_type widget ) const +{ + assert( widget!=NULL ); + + SetupForFilenameDrop( widget, "You can drop filename here." ); +} + /*****************************************************************************/ inline InputFilenameInitializer::result_type @@ -576,6 +633,41 @@ OutputImageInitializer ); } +/*****************************************************************************/ +inline +ComplexOutputImageInitializer +::ComplexOutputImageInitializer( const QString& prefix) : + m_Prefix( prefix ) +{ +} + +/*****************************************************************************/ +inline +ComplexOutputImageInitializer::result_type +ComplexOutputImageInitializer +::operator () ( argument_type widget ) const +{ + assert( widget!=NULL ); + assert( I18nCoreApplication::ConstInstance()!=NULL ); + + if( m_Prefix.isEmpty() ) + { + SetupForFilenameDrop( widget, "You can drop filename here." ); + + assert( qApp!=NULL ); + assert( !qApp->arguments().empty() ); + + SetupOutputFilename( widget ); + } + else + SetupOutputFilename( + widget, + I18nCoreApplication::ConstInstance()->GetResultsDir(), + m_Prefix, + ".tif" + ); +} + /*****************************************************************************/ inline OutputVectorDataInitializer::result_type @@ -671,13 +763,29 @@ SetupForFilenameDrop( W* widget, const char* text ) lineEdit->installEventFilter( eventFilter ); - QObject::connect( - eventFilter, - SIGNAL( FilenameDropped( const QString& ) ), - // to: - lineEdit, - SLOT( setText( const QString& ) ) - ); + // BUG : temporary fix for drag & drop in InputImageParameter + // in the future, all "filename" parameters should have the same behaviour + if (dynamic_cast<otb::Wrapper::QtWidgetInputImageParameter*>(widget) || + dynamic_cast<otb::Wrapper::QtFileSelectionWidget*>(widget)) + { + QObject::connect( + eventFilter, + SIGNAL( FilenameDropped( const QString& ) ), + // to: + widget, + SLOT( SetFileName( const QString& ) ) + ); + } + else + { + QObject::connect( + eventFilter, + SIGNAL( FilenameDropped( const QString& ) ), + // to: + lineEdit, + SLOT( setText( const QString& ) ) + ); + } } /*****************************************************************************/ diff --git a/Modules/Visualization/MonteverdiGui/src/mvdQtWidgetView.cxx b/Modules/Visualization/MonteverdiGui/src/mvdQtWidgetView.cxx index 12640d6bec8182f2046b933b8568683f8717266b..ff6d14ecc26aa84d14d8f6418160b2d80adb9595 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdQtWidgetView.cxx +++ b/Modules/Visualization/MonteverdiGui/src/mvdQtWidgetView.cxx @@ -348,6 +348,7 @@ QtWidgetView SetupWidget( widget, InputFilenameListInitializer( this ) ); SetupWidget( widget, InputImageInitializer() ); SetupWidget( widget, InputImageListInitializer( this ) ); + SetupWidget( widget, ComplexInputImageInitializer() ); SetupWidget( widget, InputProcessXMLInitializer() ); SetupWidget( widget, InputVectorDataInitializer() ); SetupWidget( widget, InputVectorDataListInitializer( this ) ); @@ -362,6 +363,10 @@ QtWidgetView widget, OutputImageInitializer( m_Application->GetName() ) ); + SetupWidget( + widget, + ComplexOutputImageInitializer( m_Application->GetName() ) + ); SetupWidget( widget, OutputVectorDataInitializer() ); } diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageListParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageListParameter.cxx index cd41fcf1d80f0ffd3edcfeb1980ee6195a8654dc..01c31e196abfc40267f0291f703fe4db20ed0c52 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageListParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageListParameter.cxx @@ -125,6 +125,10 @@ InputImageListParameter::GetFileNameList() const for(InputImageParameterVectorType::const_iterator it = m_InputImageParameterVector.begin(); it!=m_InputImageParameterVector.end();++it) { + if(it->IsNull()) + { + itkExceptionMacro(<< "Empty image in InputImageListParameter."); + } filenames.push_back( (*it)->GetFileName() ); } @@ -139,7 +143,10 @@ InputImageListParameter::GetNthFileName( unsigned int i ) const { itkExceptionMacro(<< "No image "<<i<<". Only "<<m_InputImageParameterVector.size()<<" images available."); } - + if(m_InputImageParameterVector[i].IsNull()) + { + itkExceptionMacro(<< "Requested image "<<i<<" has no filename"); + } return m_InputImageParameterVector[i]->GetFileName(); } @@ -149,6 +156,10 @@ InputImageListParameter::GetImageList() const m_ImageList->Clear(); for (unsigned int i=0 ; i < this->Size() ; ++i) { + if(m_InputImageParameterVector[i].IsNull()) + { + itkExceptionMacro(<< "Image "<<i<<" is empty."); + } m_ImageList->PushBack(m_InputImageParameterVector[i]->GetFloatVectorImage()); } return m_ImageList; @@ -161,6 +172,10 @@ InputImageListParameter::GetNthImage(unsigned int i) const { itkExceptionMacro(<< "No image "<<i<<". Only "<<this->Size()<<" images available."); } + if(m_InputImageParameterVector[i].IsNull()) + { + itkExceptionMacro(<< "Image "<<i<<" is empty."); + } return m_InputImageParameterVector[i]->GetFloatVectorImage(); } diff --git a/Modules/Wrappers/QtWidget/include/otbQtFileSelectionWidget.h b/Modules/Wrappers/QtWidget/include/otbQtFileSelectionWidget.h index d7b42e3083116faed0e1d51627f39c48206114d6..ec1977b33a45fb3cfaf3c5f6f77bd80e135a3545 100644 --- a/Modules/Wrappers/QtWidget/include/otbQtFileSelectionWidget.h +++ b/Modules/Wrappers/QtWidget/include/otbQtFileSelectionWidget.h @@ -87,6 +87,7 @@ signals: protected slots: void SelectFile(); void CallFilenameChanged(); + void SetFileName(const QString &); private: QtFileSelectionWidget(const QtFileSelectionWidget&); //purposely not implemented diff --git a/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexInputImageParameter.h b/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexInputImageParameter.h index da397a519e74687e19513ef9e67c513c8fb34c66..249283011ea5b85fbe7f85aeb32ac1ece4c19691 100644 --- a/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexInputImageParameter.h +++ b/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexInputImageParameter.h @@ -45,6 +45,9 @@ public: QtWidgetComplexInputImageParameter(ComplexInputImageParameter*, QtWidgetModel*); ~QtWidgetComplexInputImageParameter() ITK_OVERRIDE; + inline const QLineEdit* GetInput() const; + inline QLineEdit* GetInput(); + protected slots: bool SetFileName( const QString& value ); void SelectFile(); @@ -65,6 +68,21 @@ private: QPushButton * m_Button; }; +inline +const QLineEdit* +QtWidgetComplexInputImageParameter +::GetInput() const +{ + return m_Input; +} + +inline +QLineEdit* +QtWidgetComplexInputImageParameter +::GetInput() +{ + return m_Input; +} } } diff --git a/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexOutputImageParameter.h b/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexOutputImageParameter.h index af01fc7f5143665eff8cfd97882c0ab941c17ad1..1ec7b3f3250570a5dcb66887de841a40606cd039 100644 --- a/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexOutputImageParameter.h +++ b/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexOutputImageParameter.h @@ -45,11 +45,16 @@ public: QtWidgetComplexOutputImageParameter(ComplexOutputImageParameter*, QtWidgetModel*); ~QtWidgetComplexOutputImageParameter() ITK_OVERRIDE; + inline const QLineEdit* GetInput() const; + inline QLineEdit* GetInput(); + /** Get the PixelType*/ //itkGetMacro(PixelType, int); -protected slots: +public slots: void SetFileName( const QString& value ); + +protected slots: void SelectFile(); void SetPixelType(int pixelType); @@ -72,6 +77,21 @@ private: }; +inline +const QLineEdit* +QtWidgetComplexOutputImageParameter +::GetInput() const +{ + return m_Input; +} + +inline +QLineEdit* +QtWidgetComplexOutputImageParameter +::GetInput() +{ + return m_Input; +} } } diff --git a/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetInputImageParameter.h b/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetInputImageParameter.h index 01684af9326ed3b20133ddedcce04d9f29f4c8ae..5c970fc5c7b6e41a5c57eed44931d5e3172e1f0d 100644 --- a/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetInputImageParameter.h +++ b/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetInputImageParameter.h @@ -52,9 +52,12 @@ signals: void FileNameIsSet(); protected slots: - bool SetFileName(); + bool SetFileName(const QString& value); void SelectFile(); +private slots: + void OnEditingFinished(); + private: QtWidgetInputImageParameter(const QtWidgetInputImageParameter&); //purposely not implemented void operator=(const QtWidgetInputImageParameter&); //purposely not implemented diff --git a/Modules/Wrappers/QtWidget/src/otbQtFileSelectionWidget.cxx b/Modules/Wrappers/QtWidget/src/otbQtFileSelectionWidget.cxx index 37e4f3eed3ee02c97da7956d506f55d3c82ab98c..44eb911061301a5c3373857794a037ac2059f088 100644 --- a/Modules/Wrappers/QtWidget/src/otbQtFileSelectionWidget.cxx +++ b/Modules/Wrappers/QtWidget/src/otbQtFileSelectionWidget.cxx @@ -116,15 +116,22 @@ QtFileSelectionWidget if( filename.isEmpty() ) return; - m_Input->setText( filename ); + SetFileName(filename); +} +void +QtFileSelectionWidget +::CallFilenameChanged() +{ emit FilenameChanged(); } void QtFileSelectionWidget -::CallFilenameChanged() +::SetFileName(const QString & filename) { + m_Input->setText( filename ); + emit FilenameChanged(); } diff --git a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputImageParameter.cxx b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputImageParameter.cxx index 2929d528a5515d1f4696b390e99e4ef46b0b0b20..e41c35dc01c1ede50efab19452972e0970abd9ce 100644 --- a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputImageParameter.cxx +++ b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputImageParameter.cxx @@ -69,7 +69,7 @@ void QtWidgetInputImageParameter::DoCreateWidget() m_HLayout->setContentsMargins(0, 0, 0, 0); m_Input = new QLineEdit; m_Input->setToolTip( m_InputImageParam->GetDescription() ); - connect( m_Input, SIGNAL(editingFinished()), this, SLOT(SetFileName()) ); + connect( m_Input, SIGNAL(editingFinished()), this, SLOT(OnEditingFinished()) ); connect( this, SIGNAL(FileNameIsSet()), GetModel(), SLOT(NotifyUpdate()) ); m_HLayout->addWidget(m_Input); @@ -105,9 +105,7 @@ QtWidgetInputImageParameter if( filename.isEmpty() ) return; - m_Input->setText( filename ); - - if( !SetFileName() ) + if( !SetFileName(filename) ) { std::ostringstream oss; @@ -123,13 +121,14 @@ QtWidgetInputImageParameter } } -bool QtWidgetInputImageParameter::SetFileName() +bool QtWidgetInputImageParameter::SetFileName(const QString& value) { bool res = true; // save value if( m_InputImageParam->SetFromFileName( - QFile::encodeName( m_Input->text() ).constData() ) == true ) + QFile::encodeName( value ).constData() ) == true ) { + m_Input->setText( value ); // notify of value change QString key( m_InputImageParam->GetKey() ); @@ -142,5 +141,10 @@ bool QtWidgetInputImageParameter::SetFileName() return res; } +void QtWidgetInputImageParameter::OnEditingFinished() +{ + SetFileName( m_Input->text() ); +} + } } diff --git a/Packaging/Files/setup_python.sh b/Packaging/Files/setup_python.sh index e24731a88ca3579ff40925d97cf9ffaa87dccd0a..0b80e40356098303b56f7c42a5f80b6b62cdd786 100755 --- a/Packaging/Files/setup_python.sh +++ b/Packaging/Files/setup_python.sh @@ -35,7 +35,6 @@ python_check_failed() { printf %s\\n "If you have python2.6 or Python2.7 installed in your system " printf %s\\n "You should set OTB_PYTHON_EXE and re-run this installation script." printf %s\\n "eg: OTB_PYTHON_EXE=/path/to/python2.7 ./OTB-X.Y-Linux64.run" - exit 1; } if [ "$python_major_version" -gt 2 ]; then python_check_failed @@ -64,17 +63,17 @@ do done if [ "$found_python_lib" -eq "1" ]; then - numpy_import_result="$($OTB_PYTHON_EXE -c 'import numpy' 2>&1)" + numpy_import_result="$($OTB_PYTHON_EXE -c 'import numpy' 2>&1)" || numpy_ret=$? if [ ! -z "$numpy_import_result" ]; then - printf %s\\n "*****Error occurred during installation******" - printf %s\\n "Python interpreter detected is : $OTB_PYTHON_EXE ( version: $python_version )" - printf %s\\n "numpy not installed with '$OTB_PYTHON_EXE'" - printf %s\\n "Check failed with result:" - printf %s\\n "$numpy_import_result" - exit 1; - fi; - printf %s\\n "OTB python bindings will be configured for $OTB_PYTHON_EXE ( version: $python_version )" - printf %s\\n "Found python library: $python_lib_file_path" + printf %s\\n "*****Error occurred during installation******" + printf %s\\n "Python interpreter detected is : $OTB_PYTHON_EXE ( version: $python_version )" + printf %s\\n "numpy not installed with '$OTB_PYTHON_EXE'" + printf %s\\n "Check failed with result:" + printf %s\\n "$numpy_import_result" + else + printf %s\\n "OTB python bindings will be configured for $OTB_PYTHON_EXE ( version: $python_version )" + printf %s\\n "Found python library: $python_lib_file_path" + fi #ln -sf "$python_lib_file_path" "OUT_DIR/lib/$python_INSTALLED_SONAME" else printf %s\\n "*****Error occurred during installation******" diff --git a/Packaging/makeself/README.md b/Packaging/makeself/README.md index 04b9de80bbc0a71f0d1df86bd7453f1019704c36..cf7f31260bd334ef37a8ec9e76f47be44b7d906f 100644 --- a/Packaging/makeself/README.md +++ b/Packaging/makeself/README.md @@ -112,7 +112,7 @@ makeself.sh [args] archive_dir file_name label startup_script [script_args] * _archive_dir_ is the name of the directory that contains the files to be archived * _file_name_ is the name of the archive to be created * _label_ is an arbitrary text string describing the package. It will be displayed while extracting the files. - * _startup_script_ is the command to be executed _from within_ the directory of extracted files. Thus, if you wish to execute a program contain in this directory, you must prefix your command with `./`. For example, `./program` will be fine. The _script_args_ are additionnal arguments for this command. + * _startup_script_ is the command to be executed _from within_ the directory of extracted files. Thus, if you wish to execute a program contain in this directory, you must prefix your command with `./`. For example, `./program` will be fine. The _script_args_ are additional arguments for this command. Here is an example, assuming the user has a package image stored in a **/home/joe/mysoft**, and he wants to generate a self-extracting package named **mysoft.sh**, which will launch the "setup" script initially stored in /home/joe/mysoft : @@ -181,7 +181,7 @@ The latest development version can be grabbed from [GitHub][10]. Feel free to su * **v2.1.5:** Made the md5sum detection consistent with the header code. Check for the presence of the archive directory. Added --encrypt for symmetric encryption through gpg (Eric Windisch). Added support for the digest command on Solaris 10 for MD5 checksums. Check for available disk space before extracting to the target directory (Andreas Schweitzer). Allow extraction to run asynchronously (patch by Peter Hatch). Use file descriptors internally to avoid error messages (patch by Kay Tiong Khoo). * **v2.1.6:** Replaced one dot per file progress with a realtime progress percentage and a spining cursor. Added --noprogress to prevent showing the progress during the decompression. Added --target dir to allow extracting directly to a target directory. (Guy Baconniere) * **v2.2.0:** First major new release in years! Includes many bugfixes and user contributions. Please look at the [project page on Github][10] for all the details. - * **v2.3.0:** Support for archive encryption via GPG or OpenSSL. Added LZO and LZ4 compression support. Options to set the packaging date and stop the umask from being overriden. Optionally ignore check for available disk space when extracting. New option to check for root permissions before extracting. + * **v2.3.0:** Support for archive encryption via GPG or OpenSSL. Added LZO and LZ4 compression support. Options to set the packaging date and stop the umask from being overridden. Optionally ignore check for available disk space when extracting. New option to check for root permissions before extracting. * **v2.3.1:** Various compatibility updates. Added unit tests for Travis CI in the GitHub repo. New --tar-extra, --untar-extra, --gpg-extra, --gpg-asymmetric-encrypt-sign options. ## Links diff --git a/Packaging/makeself/makeself.sh b/Packaging/makeself/makeself.sh index a2bb226d1ece2a46139dd6e8a1866100e10b65cb..5e3990514edf9e585842fcd03f3fd8ee60d1f017 100755 --- a/Packaging/makeself/makeself.sh +++ b/Packaging/makeself/makeself.sh @@ -6,7 +6,7 @@ # Utility to create self-extracting tar.gz archives. # The resulting archive is a file holding the tar.gz archive with # a small Shell script stub that uncompresses the archive to a temporary -# directory and then executes a given script from withing that directory. +# directory and then executes a given script from within that directory. # # Makeself home page: http://makeself.io/ # @@ -39,7 +39,7 @@ # - 2.0.1 : Added --copy # - 2.1.0 : Allow multiple tarballs to be stored in one archive, and incremental updates. # Added --nochown for archives -# Stopped doing redundant checksums when not necesary +# Stopped doing redundant checksums when not necessary # - 2.1.1 : Work around insane behavior from certain Linux distros with no 'uncompress' command # Cleaned up the code to handle error codes from compress. Simplified the extraction code. # - 2.1.2 : Some bug fixes. Use head -n to avoid problems. diff --git a/SuperBuild/patches/QT4/qt4-5-mantis1422-qthread-stacksize-macx.diff b/SuperBuild/patches/QT4/qt4-5-mantis1422-qthread-stacksize-macx.diff new file mode 100644 index 0000000000000000000000000000000000000000..b39fb01a25b5c5282801a7ecdca68d7393e3902a --- /dev/null +++ b/SuperBuild/patches/QT4/qt4-5-mantis1422-qthread-stacksize-macx.diff @@ -0,0 +1,56 @@ +--- src/corelib/thread/qthread_unix.cpp.orig 2015-11-23 19:05:40.000000000 +0100 ++++ src/corelib/thread/qthread_unix.cpp 2015-11-24 11:22:31.000000000 +0100 +@@ -79,6 +79,7 @@ + #endif + + #if defined(Q_OS_MAC) ++#include <sys/resource.h> // getrlimit/setrlimit + # ifdef qDebug + # define old_qDebug qDebug + # undef qDebug +@@ -649,6 +650,45 @@ + #endif // QT_HAS_THREAD_PRIORITY_SCHEDULING + + ++#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) ++ if (d->stackSize == 0) { ++ // Fix the default (too small) stack size for threads on OS X, ++ // which also affects the thread pool. ++ // See also: ++ // https://bugreports.qt.io/browse/QTBUG-2568 ++ // This fix can also be found in Chromium: ++ // https://chromium.googlesource.com/chromium/src.git/+/master/base/threading/platform_thread_mac.mm#186 ++ ++ // The Mac OS X default for a pthread stack size is 512kB. ++ // Libc-594.1.4/pthreads/pthread.c's pthread_attr_init uses ++ // DEFAULT_STACK_SIZE for this purpose. ++ // ++ // 512kB isn't quite generous enough for some deeply recursive threads that ++ // otherwise request the default stack size by specifying 0. Here, adopt ++ // glibc's behavior as on Linux, which is to use the current stack size ++ // limit (ulimit -s) as the default stack size. See ++ // glibc-2.11.1/nptl/nptl-init.c's __pthread_initialize_minimal_internal. To ++ // avoid setting the limit below the Mac OS X default or the minimum usable ++ // stack size, these values are also considered. If any of these values ++ // can't be determined, or if stack size is unlimited (ulimit -s unlimited), ++ // stack_size is left at 0 to get the system default. ++ // ++ // Mac OS X normally only applies ulimit -s to the main thread stack. On ++ // contemporary OS X and Linux systems alike, this value is generally 8MB ++ // or in that neighborhood. ++ size_t default_stack_size = 0; ++ struct rlimit stack_rlimit; ++ if (pthread_attr_getstacksize(&attr, &default_stack_size) == 0 && ++ getrlimit(RLIMIT_STACK, &stack_rlimit) == 0 && ++ stack_rlimit.rlim_cur != RLIM_INFINITY) { ++ default_stack_size = ++ std::max(std::max(default_stack_size, ++ static_cast<size_t>(PTHREAD_STACK_MIN)), ++ static_cast<size_t>(stack_rlimit.rlim_cur)); ++ } ++ d->stackSize = default_stack_size; ++ } ++#endif + if (d->stackSize > 0) { + #if defined(_POSIX_THREAD_ATTR_STACKSIZE) && (_POSIX_THREAD_ATTR_STACKSIZE-0 > 0) + int code = pthread_attr_setstacksize(&attr, d->stackSize); diff --git a/Utilities/Maintenance/SuperbuildDownloadList.sh b/Utilities/Maintenance/SuperbuildDownloadList.sh index d7bd8c493517194cf2ef22accbc6b0e4565d3291..6a658dfe43da0e8012040a227e48d31cec0d2902 100755 --- a/Utilities/Maintenance/SuperbuildDownloadList.sh +++ b/Utilities/Maintenance/SuperbuildDownloadList.sh @@ -46,8 +46,8 @@ else VERSION="develop" fi CMAKE_FILES=$(find $SB_CMAKE_DIR -maxdepth 1 -type f -name "External_*") -DOWNLOAD_LIST=$(grep -h -E '^[^#]*\"https?://.*(\.tar\.gz|\.tar\.bz2|\.tgz|\.tar\.xz|\.zip|export=download).*\"' ${CMAKE_FILES} | - grep -o -E 'https?://[^\"]*' | sort | uniq) +DOWNLOAD_LIST=$(grep -h -E '^[^#]*\"(ftp|http|https)://.*(\.tar\.gz|\.tar\.bz2|\.tgz|\.tar\.xz|\.zip|export=download).*\"' ${CMAKE_FILES} | + grep -o -E '(ftp|http|https)://[^\"]*' | sort | uniq) DOWNLOAD_NAMES=