diff --git a/CMake/OTBModuleEnablement.cmake b/CMake/OTBModuleEnablement.cmake index 4ec34d94df5315c4381769b3c33a380358163a86..453b8213d096224d76511b0b8ff50800f551d1a8 100644 --- a/CMake/OTBModuleEnablement.cmake +++ b/CMake/OTBModuleEnablement.cmake @@ -196,6 +196,8 @@ foreach(otb-module ${OTB_MODULES_ALL}) if(OTB_MODULE_${otb-module}_ACTIVATION_OPTION AND NOT ${OTB_MODULE_${otb-module}_ACTIVATION_OPTION}) otb_module_disable("${otb-module}" "${OTB_MODULE_${otb-module}_ACTIVATION_OPTION}") + elseif(OTB_MODULE_${otb-module}_IS_DEPRECATED AND NOT OTB_USE_DEPRECATED) + otb_module_disable("${otb-module}" "OTB_USE_DEPRECATED") endif() endforeach() diff --git a/CMake/OTBModuleMacros.cmake b/CMake/OTBModuleMacros.cmake index 127ae794a0c5709c01363d8e0d66b94cdf36de47..095575a4e90097860d15f533563f54d495c704d0 100644 --- a/CMake/OTBModuleMacros.cmake +++ b/CMake/OTBModuleMacros.cmake @@ -69,6 +69,9 @@ macro(otb_module _name) elseif("${arg}" MATCHES "^ENABLE_SHARED$") set(_doing "") set(OTB_MODULE_${otb-module}_ENABLE_SHARED 1) + elseif("${arg}" MATCHES "^DEPRECATED$") + set(_doing "") + set(OTB_MODULE_${otb-module}_IS_DEPRECATED 1) elseif("${arg}" MATCHES "^[A-Z][A-Z][A-Z]$") set(_doing "") message(AUTHOR_WARNING "Unknown argument [${arg}]") @@ -221,6 +224,7 @@ macro(otb_module_impl) generate_export_header(${otb-module} EXPORT_FILE_NAME ${_export_header_file} EXPORT_MACRO_NAME ${otb-module}_EXPORT + DEPRECATED_MACRO_NAME ${otb-module}_DEPRECATED NO_EXPORT_MACRO_NAME ${otb-module}_HIDDEN STATIC_DEFINE OTB_STATIC ) install(FILES diff --git a/Documentation/Cookbook/rst/AdvancedUse.rst b/Documentation/Cookbook/rst/AdvancedUse.rst index a52a505b4c7be749e3aa3d49bcb6e07ff5fbf6a1..b0d444cbc2a36906de22bd199836f6908b6c0820 100644 --- a/Documentation/Cookbook/rst/AdvancedUse.rst +++ b/Documentation/Cookbook/rst/AdvancedUse.rst @@ -3,8 +3,8 @@ Advanced Use This section describes advanced configuration options and tricks. -Environment variables that affects Orfeo ToolBox ------------------------------------------------- +Environment variables that affect Orfeo ToolBox +----------------------------------------------- The following environment variables are parsed by Orfeo ToolBox. Note that they only affect default values, and that settings in extended diff --git a/Modules/Core/ImageBase/include/otbImageIOBase.h b/Modules/Core/ImageBase/include/otbImageIOBase.h index cc9ed311222ab89394ca1fa737c1d7a1b041273e..c6444924dea58dc0f6923da80ae5e71ef0b9c179 100644 --- a/Modules/Core/ImageBase/include/otbImageIOBase.h +++ b/Modules/Core/ImageBase/include/otbImageIOBase.h @@ -208,7 +208,7 @@ public: /** Convenience method returns the IOPixelType as a string. This can be * used for writing output files. */ - std::string GetPixelTypeAsString(IOPixelType) const; + static std::string GetPixelTypeAsString(IOPixelType); /** Enums used to specify write style: whether binary or ASCII. Some * subclasses use this, some ignore it. */ @@ -255,11 +255,11 @@ public: /** Convenience method returns the FileType as a string. This can be * used for writing output files. */ - std::string GetFileTypeAsString(FileType) const; + static std::string GetFileTypeAsString(FileType); /** Convenience method returns the ByteOrder as a string. This can be * used for writing output files. */ - std::string GetByteOrderAsString(ByteOrder) const; + static std::string GetByteOrderAsString(ByteOrder); /** Type for representing size of bytes, and or positions along a file */ typedef std::streamoff SizeType; diff --git a/Modules/Core/ImageBase/src/otbImageIOBase.cxx b/Modules/Core/ImageBase/src/otbImageIOBase.cxx index cf786378249370c5f1091a1f346d4187cff839ac..fd54f655033220795b5553c6f4d22445d0da0a2e 100644 --- a/Modules/Core/ImageBase/src/otbImageIOBase.cxx +++ b/Modules/Core/ImageBase/src/otbImageIOBase.cxx @@ -709,7 +709,7 @@ unsigned int ImageIOBase::GetComponentSize() const return 0; } -std::string ImageIOBase::GetFileTypeAsString(FileType t) const +std::string ImageIOBase::GetFileTypeAsString(FileType t) { std::string s; switch(t) @@ -724,7 +724,7 @@ std::string ImageIOBase::GetFileTypeAsString(FileType t) const } } -std::string ImageIOBase::GetByteOrderAsString(ByteOrder t) const +std::string ImageIOBase::GetByteOrderAsString(ByteOrder t) { std::string s; switch(t) @@ -778,7 +778,7 @@ std::string ImageIOBase::GetComponentTypeAsString(IOComponentType t) } } -std::string ImageIOBase::GetPixelTypeAsString(IOPixelType t) const +std::string ImageIOBase::GetPixelTypeAsString(IOPixelType t) { std::string s; switch(t) @@ -805,7 +805,7 @@ std::string ImageIOBase::GetPixelTypeAsString(IOPixelType t) const return (s = "complex"); case UNKNOWNPIXELTYPE: default: - itkExceptionMacro ("Unknown pixel type: " << t); + return (s = "unknown"); } } @@ -1325,13 +1325,13 @@ void ImageIOBase::PrintSelf(std::ostream& os, itk::Indent indent) const Superclass::PrintSelf(os, indent); os << indent << "FileName: " << m_FileName << std::endl; - os << indent << "FileType: " << this->GetFileTypeAsString(m_FileType) << std::endl; - os << indent << "ByteOrder: " << this->GetByteOrderAsString(m_ByteOrder) << std::endl; + os << indent << "FileType: " << ImageIOBase::GetFileTypeAsString(m_FileType) << std::endl; + os << indent << "ByteOrder: " << ImageIOBase::GetByteOrderAsString(m_ByteOrder) << std::endl; os << indent << "IORegion: " << std::endl; m_IORegion.Print(os, indent.GetNextIndent()); os << indent << "Number of Components/Pixel: " << m_NumberOfComponents << "\n"; - os << indent << "Pixel Type: " << this->GetPixelTypeAsString(m_PixelType) << std::endl; - os << indent << "Component Type: " << this->GetComponentTypeAsString(m_ComponentType) + os << indent << "Pixel Type: " << ImageIOBase::GetPixelTypeAsString(m_PixelType) << std::endl; + os << indent << "Component Type: " << ImageIOBase::GetComponentTypeAsString(m_ComponentType) << std::endl; os << indent << "Dimensions: ( "; for (unsigned int i=0; i < m_NumberOfDimensions; i++) diff --git a/Modules/Detection/ObjectDetection/include/otbDescriptorsListSampleGenerator.h b/Modules/Detection/ObjectDetection/include/otbDescriptorsListSampleGenerator.h index 1afc7a66692aab25bc8fddc90e0ad98edafce340..7e9d985dacfd1eb8524fc7abbd6c512a85a5a298 100644 --- a/Modules/Detection/ObjectDetection/include/otbDescriptorsListSampleGenerator.h +++ b/Modules/Detection/ObjectDetection/include/otbDescriptorsListSampleGenerator.h @@ -183,7 +183,6 @@ private: bool IsInsideWithNeighborhoodRadius(const RegionType& region, const ContinuousIndexType &index) const { - typedef typename RegionType::IndexType IndexType; typedef typename IndexType::IndexValueType IndexValueType; typedef typename ContinuousIndexType::ValueType ContinuousIndexValueType; diff --git a/Modules/Detection/ObjectDetection/include/otbObjectDetectionClassifier.h b/Modules/Detection/ObjectDetection/include/otbObjectDetectionClassifier.h index c39e49ba9c8532f9df9057ebd8225bdb305e8b67..83c4c844260576cf221199080bb12f6a3749862b 100644 --- a/Modules/Detection/ObjectDetection/include/otbObjectDetectionClassifier.h +++ b/Modules/Detection/ObjectDetection/include/otbObjectDetectionClassifier.h @@ -194,7 +194,6 @@ private: bool IsInsideWithNeighborhoodRadius(const RegionType& region, const ContinuousIndexType &index) const { - typedef typename RegionType::IndexType IndexType; typedef typename IndexType::IndexValueType IndexValueType; for(unsigned int i=0; i<ImageDimension; ++i) diff --git a/Modules/Feature/Descriptors/include/otbImageToSIFTKeyPointSetFilter.hxx b/Modules/Feature/Descriptors/include/otbImageToSIFTKeyPointSetFilter.hxx index d5b139cf87c2918d307167b51a554fb911b26d06..66e5ae3d97748941d260e1e45924c57d815621a2 100644 --- a/Modules/Feature/Descriptors/include/otbImageToSIFTKeyPointSetFilter.hxx +++ b/Modules/Feature/Descriptors/include/otbImageToSIFTKeyPointSetFilter.hxx @@ -58,7 +58,7 @@ ImageToSIFTKeyPointSetFilter<TInputImage, TOutputPointSet> m_GradientMagnitudeThreshold = 0.2; m_ExpandFilter = ExpandFilterType::New(); - + const double HistogramGaussianWeights[73] = { 2.3771112282795414e-07, 3.8860734758633732e-07, 6.2655544995978937e-07, 9.9631120821413786e-07, 1.5624909838697011e-06, 2.4167238265599128e-06, 3.6865788528530121e-06, @@ -82,9 +82,9 @@ ImageToSIFTKeyPointSetFilter<TInputImage, TOutputPointSet> 2.4167238265599128e-06, 1.5624909838697011e-06, 9.9631120821413786e-07, 6.2655544995978937e-07, 3.8860734758633732e-07, 2.3771112282795414e-07 }; - + m_HistogramGaussianWeights = std::vector<double>(HistogramGaussianWeights,HistogramGaussianWeights+73); - + m_Offsets[0][0]=-1; m_Offsets[0][1]=-1; m_Offsets[1][0]=-1; @@ -896,9 +896,7 @@ void ImageToSIFTKeyPointSetFilter<TInputImage, TOutputPointSet> ::PrintSelf(std::ostream& os, itk::Indent indent) const { - - typedef itk::ProcessObject ProcessObjectType; - const OutputPointSetType* output = dynamic_cast<const OutputPointSetType*>(this->ProcessObjectType::GetOutput(0)); + const OutputPointSetType* output = dynamic_cast<const OutputPointSetType*>(this->Superclass::ProcessObjectType::GetOutput(0)); Superclass::PrintSelf(os, indent); os << indent << "Number of octaves: " << m_OctavesNumber << std::endl; diff --git a/Modules/Filtering/ChangeDetection/include/otbKullbackLeiblerSupervizedDistanceImageFilter.hxx b/Modules/Filtering/ChangeDetection/include/otbKullbackLeiblerSupervizedDistanceImageFilter.hxx index 58c169e892fabe4a0a4c7f23c71cb5c34dfd9f52..a4c4deb51c9dcf7bab1403a1257262b80de0e4e5 100644 --- a/Modules/Filtering/ChangeDetection/include/otbKullbackLeiblerSupervizedDistanceImageFilter.hxx +++ b/Modules/Filtering/ChangeDetection/include/otbKullbackLeiblerSupervizedDistanceImageFilter.hxx @@ -57,12 +57,6 @@ KullbackLeiblerSupervizedDistance<TInput1, TInput2, TInputROIImage, TOutput> const typename TInput2::ImageType * img2, const TInputROIImage * imgROI) { - typedef ROIdataConversion<typename TInput1::ImageType, TInputROIImage> - ROIConversionType1; - - typedef itk::ConstNeighborhoodIterator< - typename ROIConversionType1::OutputImageType> ROIInputType1; - typename ROIConversionType1::Pointer conversion1 = ROIConversionType1::New(); conversion1->SetInputImage(img1); conversion1->SetROIImage(imgROI); diff --git a/Modules/Filtering/Path/include/otbCompacityPathFunction.hxx b/Modules/Filtering/Path/include/otbCompacityPathFunction.hxx index 2d7d0b7d86ccd68fa7d32f1d1d1db0cefd773120..8740b23d4738f2141d811abe4ae5e8ea620578e7 100644 --- a/Modules/Filtering/Path/include/otbCompacityPathFunction.hxx +++ b/Modules/Filtering/Path/include/otbCompacityPathFunction.hxx @@ -43,8 +43,6 @@ typename CompacityPathFunction<TInputPath, CompacityPathFunction<TInputPath, TOutput> ::Evaluate(const PathType& path) const { - typedef double RealType; - VertexListPointer vertexList; VertexType cindex; VertexType IndexOut; diff --git a/Modules/Filtering/Path/include/otbOrientationPathFunction.hxx b/Modules/Filtering/Path/include/otbOrientationPathFunction.hxx index 5885df2ea7148db1326774c846d9fd11e903311e..56d90376066a7000dbc2eef56162c642ca1faf99 100644 --- a/Modules/Filtering/Path/include/otbOrientationPathFunction.hxx +++ b/Modules/Filtering/Path/include/otbOrientationPathFunction.hxx @@ -44,8 +44,6 @@ typename OrientationPathFunction<TInputPath, OrientationPathFunction<TInputPath, TOutput> ::Evaluate(const PathType& path) const { - typedef double RealType; - VertexListPointer vertexList; VertexType cindex; VertexType IndexOut; diff --git a/Modules/Filtering/VectorDataRendering/include/otbMapnikAdapter.h b/Modules/Filtering/VectorDataRendering/include/otbMapnikAdapter.h index c71eb4e133c07d58fea196528668c9c17fede5f9..4d67d5d368c26d7c834f189cb406178d0ce4eb70 100644 --- a/Modules/Filtering/VectorDataRendering/include/otbMapnikAdapter.h +++ b/Modules/Filtering/VectorDataRendering/include/otbMapnikAdapter.h @@ -61,7 +61,7 @@ typedef Image32 image_32; namespace otb { -namespace mapnik_otb +namespace [[deprecated]] mapnik_otb { // this should be removed once mapnik support for version < 2.0 is dropped. // should be around 01/2013. diff --git a/Modules/Filtering/VectorDataRendering/include/otbVectorDataStyle.h b/Modules/Filtering/VectorDataRendering/include/otbVectorDataStyle.h index 39787388eacc4b5e09e8c9b4e22acb72c3c23cd4..c750dc4436cec0613b185f7b0b7919e581de67d7 100644 --- a/Modules/Filtering/VectorDataRendering/include/otbVectorDataStyle.h +++ b/Modules/Filtering/VectorDataRendering/include/otbVectorDataStyle.h @@ -42,10 +42,12 @@ namespace otb * * \sa VectorDataToMapFilter * + * \deprecated + * * \ingroup OTBVectorDataRendering */ -class ITK_EXPORT VectorDataStyle : public itk::LightObject +class [[deprecated]] VectorDataStyle : public itk::LightObject { public: /** Standard class typedefs. */ diff --git a/Modules/Filtering/VectorDataRendering/include/otbVectorDataToMapFilter.h b/Modules/Filtering/VectorDataRendering/include/otbVectorDataToMapFilter.h index 4bc29e139f69c66ecfaa025bcd31457c06a5be32..67d3a2e8204c0be74fbbd194dc53895ff829f31e 100644 --- a/Modules/Filtering/VectorDataRendering/include/otbVectorDataToMapFilter.h +++ b/Modules/Filtering/VectorDataRendering/include/otbVectorDataToMapFilter.h @@ -68,12 +68,13 @@ namespace otb * otb::Image< itk::RGBAPixel<InternalPixelType> >, * otb::Image< itk::RGBPixel<InternalPixelType> >. * - * - * \ingroup OTBVectorDataRendering + * \deprecated + * + * \ingroup OTBVectorDataRendering */ template <class TVectorData, class TImage> -class ITK_EXPORT VectorDataToMapFilter : public itk::ImageSource<TImage> +class [[deprecated]] VectorDataToMapFilter : public itk::ImageSource<TImage> { public: /** Standard class typedefs. */ diff --git a/Modules/Filtering/VectorDataRendering/otb-module.cmake b/Modules/Filtering/VectorDataRendering/otb-module.cmake index 4953d8191c7f2fd5b356abb6c76b3dcb8b7a512e..4251586660098e8e8d6753ffd33e99b55bc4d0ad 100644 --- a/Modules/Filtering/VectorDataRendering/otb-module.cmake +++ b/Modules/Filtering/VectorDataRendering/otb-module.cmake @@ -37,6 +37,8 @@ otb_module(OTBVectorDataRendering OTBVectorDataIO OTBImageBase + DEPRECATED + DESCRIPTION "${DOCUMENTATION}" ) diff --git a/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx b/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx index 316430596aa58caa73b034110d6ceb30ed1363ed..51d39776ffbad8841372ee678f37b6bcfeb54953 100644 --- a/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx +++ b/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx @@ -1313,7 +1313,7 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer) } else { - itkExceptionMacro(<< "This complex type is not defined :" << this->GetPixelTypeAsString(this->GetPixelType()) ); + itkExceptionMacro(<< "This complex type is not defined :" << ImageIOBase::GetPixelTypeAsString(this->GetPixelType()) ); } } else diff --git a/Modules/IO/IOONERA/src/otbONERAImageIO.cxx b/Modules/IO/IOONERA/src/otbONERAImageIO.cxx index 8d98f911522036f617887abaadba98da2c6d5c61..1400b49c272b8eeb92db34b8143be3ee8f79eccc 100644 --- a/Modules/IO/IOONERA/src/otbONERAImageIO.cxx +++ b/Modules/IO/IOONERA/src/otbONERAImageIO.cxx @@ -384,13 +384,13 @@ void ONERAImageIO::InternalReadImageInformation() otbMsgDebugMacro(<< "Driver to read: ONERA"); otbMsgDebugMacro(<< " Read file : " << m_FileName); otbMsgDebugMacro(<< " Size : " << m_Dimensions[0] << "," << m_Dimensions[1]); - otbMsgDebugMacro(<< " PixelType : " << this->GetPixelTypeAsString(this->GetPixelType())); - otbMsgDebugMacro(<< " ComponentType : " << this->GetComponentTypeAsString(this->GetComponentType())); + otbMsgDebugMacro(<< " PixelType : " << ImageIOBase::GetPixelTypeAsString(this->GetPixelType())); + otbMsgDebugMacro(<< " ComponentType : " << ImageIOBase::GetComponentTypeAsString(this->GetComponentType())); otbMsgDebugMacro(<< " ComponentSize : " << this->GetComponentSize()); otbMsgDebugMacro(<< " NumberOfComponents : " << this->GetNumberOfComponents()); otbMsgDebugMacro(<< " BytePerPixel : " << m_BytePerPixel); - otbMsgDebugMacro(<< " Host byte order : " << this->GetByteOrderAsString(m_ByteOrder)); - otbMsgDebugMacro(<< " File byte order : " << this->GetByteOrderAsString(m_FileByteOrder)); + otbMsgDebugMacro(<< " Host byte order : " << ImageIOBase::GetByteOrderAsString(m_ByteOrder)); + otbMsgDebugMacro(<< " File byte order : " << ImageIOBase::GetByteOrderAsString(m_FileByteOrder)); delete [] sHeader; } @@ -595,7 +595,7 @@ void ONERAImageIO::InternalWriteImageInformation() otbMsgDebugMacro(<< " ComponentType : " << this->GetComponentType()); otbMsgDebugMacro(<< " NumberOfComponents : " << this->GetNumberOfComponents()); otbMsgDebugMacro(<< " BytePerPixel : " << m_BytePerPixel); - otbMsgDebugMacro(<< " Host byte order : " << this->GetByteOrderAsString(m_ByteOrder)); + otbMsgDebugMacro(<< " Host byte order : " << ImageIOBase::GetByteOrderAsString(m_ByteOrder)); } } // end namespace otb diff --git a/Modules/IO/IORAD/src/otbRADImageIO.cxx b/Modules/IO/IORAD/src/otbRADImageIO.cxx index 1e6c45d8a8122afb799f317f8a9be2e911719294..88981cc275c44463465195a6cd8db6d9bb00b77a 100644 --- a/Modules/IO/IORAD/src/otbRADImageIO.cxx +++ b/Modules/IO/IORAD/src/otbRADImageIO.cxx @@ -618,8 +618,8 @@ void RADImageIO::WriteImageInformation() m_HeaderFile << "TYPECODAGE "; std::string lExtension; - std::string lStringPixelType = itksys::SystemTools::UpperCase(this->GetPixelTypeAsString(m_PixelType)); - std::string lStringComponentType = itksys::SystemTools::UpperCase(this->GetComponentTypeAsString(this->GetComponentType())); + std::string lStringPixelType = itksys::SystemTools::UpperCase(ImageIOBase::GetPixelTypeAsString(m_PixelType)); + std::string lStringComponentType = itksys::SystemTools::UpperCase(ImageIOBase::GetComponentTypeAsString(this->GetComponentType())); if (lStringPixelType == "SCALAR") { diff --git a/Modules/IO/ImageIO/include/otbImageFileReader.hxx b/Modules/IO/ImageIO/include/otbImageFileReader.hxx index 9e3215277e01a6b92d55cfe398fff4d95a28c9a6..275e70272c3a96995740cabe4435f0318899e7ab 100644 --- a/Modules/IO/ImageIO/include/otbImageFileReader.hxx +++ b/Modules/IO/ImageIO/include/otbImageFileReader.hxx @@ -889,7 +889,7 @@ ImageFileReader<TOutputImage, ConvertPixelTraits> std::ostringstream msg; msg <<"Couldn't convert component type: " << std::endl << " " - << m_ImageIO->GetComponentTypeAsString(m_ImageIO->GetComponentType()) + << ImageIOBase::GetComponentTypeAsString(m_ImageIO->GetComponentType()) << std::endl << "to one of: " << std::endl << " " << typeid(unsigned char).name() << std::endl << " " << typeid(char).name() diff --git a/Modules/OBIA/RCC8/include/otbRCC8GraphFileWriter.h b/Modules/OBIA/RCC8/include/otbRCC8GraphFileWriter.h index 1c633102641712a3043a348eaf9591e4c12c775b..ddd9b13de0f578dbfc37f92d0f7ac5334c240dde 100644 --- a/Modules/OBIA/RCC8/include/otbRCC8GraphFileWriter.h +++ b/Modules/OBIA/RCC8/include/otbRCC8GraphFileWriter.h @@ -88,12 +88,13 @@ public: typedef typename InputGraphType::VertexDescriptorType VertexDescriptorType; typedef typename InputGraphType::RCC8ValueType RCC8ValueType; typedef typename VertexType::AttributesMapType AttributesMapType; + typedef typename AttributesMapType::iterator IteratorType; /** Set the filename */ itkSetStringMacro(FileName); /** Get the filename */ itkGetStringMacro(FileName); - + using Superclass::SetInput; /** * Set the input graph. diff --git a/Modules/OBIA/RCC8/include/otbRCC8GraphFileWriter.hxx b/Modules/OBIA/RCC8/include/otbRCC8GraphFileWriter.hxx index bbc046a40cb2e817e782c5d904ec7dda8830424f..ddc43c87b2a12278e30a683104b5d5ef8f29ae38 100644 --- a/Modules/OBIA/RCC8/include/otbRCC8GraphFileWriter.hxx +++ b/Modules/OBIA/RCC8/include/otbRCC8GraphFileWriter.hxx @@ -203,7 +203,6 @@ RCC8GraphFileWriter<TInputGraph> ::WriteVertex(std::ofstream& of, VertexDescriptorType index, VertexPointerType vertex) { - typedef typename VertexType::AttributesMapType AttributesMapType; typedef typename AttributesMapType::iterator IteratorType; AttributesMapType attr = vertex->GetAttributesMap(); otbMsgDevMacro(<< "RCC8GraphFileWriter: WriteVertex call: " << index); diff --git a/Modules/Segmentation/Conversion/include/otbOGRDataSourceToLabelImageFilter.h b/Modules/Segmentation/Conversion/include/otbOGRDataSourceToLabelImageFilter.h index 6f086648d7de5c8621de605d3b39d8e6e0089b9d..63717bf0a540ff2d37388228a24f945d195b1051 100644 --- a/Modules/Segmentation/Conversion/include/otbOGRDataSourceToLabelImageFilter.h +++ b/Modules/Segmentation/Conversion/include/otbOGRDataSourceToLabelImageFilter.h @@ -137,6 +137,11 @@ public: itkGetConstReferenceMacro(BurnAttributeMode,bool); itkBooleanMacro(BurnAttributeMode); + /** Set/Get the AllTouchedMode flag */ + itkSetMacro(AllTouchedMode,bool); + itkGetConstReferenceMacro(AllTouchedMode,bool); + itkBooleanMacro(AllTouchedMode); + /** Useful to set the output parameters from an existing image*/ void SetOutputParametersFromImage(const ImageBaseType * image); @@ -169,6 +174,7 @@ private: OutputImageInternalPixelType m_BackgroundValue; OutputImageInternalPixelType m_ForegroundValue; bool m_BurnAttributeMode; + bool m_AllTouchedMode; }; // end of class VectorDataToLabelImageFilter } // end of namespace otb diff --git a/Modules/Segmentation/Conversion/include/otbOGRDataSourceToLabelImageFilter.hxx b/Modules/Segmentation/Conversion/include/otbOGRDataSourceToLabelImageFilter.hxx index 30c3e9fba8a7625f2863aa806f0865fca919cf69..4e33a951a5ac9287d0e0021098cc3239eecadf69 100644 --- a/Modules/Segmentation/Conversion/include/otbOGRDataSourceToLabelImageFilter.hxx +++ b/Modules/Segmentation/Conversion/include/otbOGRDataSourceToLabelImageFilter.hxx @@ -39,7 +39,8 @@ OGRDataSourceToLabelImageFilter<TOutputImage> ::OGRDataSourceToLabelImageFilter() : m_BurnAttribute("DN"), m_BackgroundValue(0), m_ForegroundValue(255), - m_BurnAttributeMode(true) + m_BurnAttributeMode(true), + m_AllTouchedMode(false) { this->SetNumberOfRequiredInputs(1); @@ -129,7 +130,7 @@ OGRDataSourceToLabelImageFilter<TOutputImage> this->SetOutputOrigin ( image->GetOrigin() ); this->SetOutputSpacing ( internal::GetSignedSpacing( image ) ); this->SetOutputSize ( image->GetLargestPossibleRegion().GetSize() ); - + ImageMetadataInterfaceBase::Pointer imi = ImageMetadataInterfaceFactory::CreateIMI(image->GetMetaDataDictionary()); this->SetOutputProjectionRef(imi->GetProjectionRef()); @@ -251,6 +252,10 @@ OGRDataSourceToLabelImageFilter<TOutputImage>::GenerateData() { options.push_back("ATTRIBUTE="+m_BurnAttribute); } + if(m_AllTouchedMode) + { + options.push_back("ALL_TOUCHED=TRUE"); + } GDALRasterizeLayers( dataset, nbBands, &m_BandsToBurn[0], diff --git a/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h b/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h index d708f1d99569f54512a469ff38f73a08723c71b0..d719606ae3492d9589f49fa15429bbb00b32d640 100644 --- a/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h +++ b/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h @@ -99,6 +99,11 @@ public: typedef itk::DataObject DataObjectType; + /** Set/Get the AllTouchedMode flag */ + itkSetMacro(AllTouchedMode,bool); + itkGetConstReferenceMacro(AllTouchedMode,bool); + itkBooleanMacro(AllTouchedMode); + const InputImageType * GetInput(); const DataObjectType* GetInput(unsigned int idx); @@ -163,6 +168,7 @@ private: std::vector<double> m_BurnValues; std::vector<double> m_FullBurnValues; std::vector<int> m_BandsToBurn; + bool m_AllTouchedMode; }; // end of class RasterizeVectorDataFilter diff --git a/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.hxx b/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.hxx index c140348c0483eda9f005435ab976d8c434654458..6b45a3fcdff73d0f9bebb56ba9af5fc474c08678 100644 --- a/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.hxx +++ b/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.hxx @@ -30,7 +30,8 @@ namespace otb template<class TVectorData, class TInputImage, class TOutputImage> RasterizeVectorDataFilter<TVectorData, TInputImage, TOutputImage> ::RasterizeVectorDataFilter() - : m_OGRDataSourcePointer(nullptr) + : m_OGRDataSourcePointer(nullptr), + m_AllTouchedMode(false) { this->SetNumberOfRequiredInputs(1); } @@ -188,6 +189,12 @@ RasterizeVectorDataFilter<TVectorData, TInputImage, TOutputImage>::GenerateData( geoTransform[4] = 0.; GDALSetGeoTransform(dataset,const_cast<double*>(geoTransform.GetDataPointer())); + char **options = nullptr; + if (m_AllTouchedMode) + { + options = CSLSetNameValue(options, "ALL_TOUCHED", "TRUE"); + } + // Burn the geometries into the dataset if (dataset != nullptr) { @@ -196,9 +203,11 @@ RasterizeVectorDataFilter<TVectorData, TInputImage, TOutputImage>::GenerateData( m_SrcDataSetLayers.size(), &(m_SrcDataSetLayers[0]), nullptr, nullptr, &(m_FullBurnValues[0]), - nullptr, + options, GDALDummyProgress, nullptr ); + CSLDestroy(options); + // release the dataset GDALClose( dataset ); } diff --git a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h index 63c7d85cc82eef29621c3d2ba3d6e977f037447b..6cdbabc3974e38da1993b092a130ea042879fffc 100644 --- a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h +++ b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h @@ -129,6 +129,11 @@ public: itkSetMacro(DefaultBurnValue, OutputImageInternalPixelType); itkGetMacro(DefaultBurnValue, OutputImageInternalPixelType); + /** Set/Get the AllTouchedMode flag */ + itkSetMacro(AllTouchedMode,bool); + itkGetConstReferenceMacro(AllTouchedMode,bool); + itkBooleanMacro(AllTouchedMode); + /** Useful to set the output parameters from an existing image*/ void SetOutputParametersFromImage(const ImageBaseType * image); @@ -176,6 +181,9 @@ private: // Background value OutputImageInternalPixelType m_BackgroundValue; + // All touched mode + bool m_AllTouchedMode; + // Output params std::string m_OutputProjectionRef; OutputSpacingType m_OutputSpacing; diff --git a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.hxx b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.hxx index 49afc91079839422acf465f1799feda1b2690133..ab370f7545ac25fead58061b7db3b24bed524568 100644 --- a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.hxx +++ b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.hxx @@ -40,7 +40,8 @@ VectorDataToLabelImageFilter<TVectorData, TOutputImage> m_BandsToBurn(1, 1), m_BurnAttribute("FID"), m_DefaultBurnValue(1.), - m_BackgroundValue(0.) + m_BackgroundValue(0.), + m_AllTouchedMode(false) { this->SetNumberOfRequiredInputs(1); @@ -262,7 +263,7 @@ VectorDataToLabelImageFilter<TVectorData, TOutputImage>::GenerateData() // Fill the buffer with the background value this->GetOutput()->FillBuffer(m_BackgroundValue); - + // nb bands unsigned int nbBands = this->GetOutput()->GetNumberOfComponentsPerPixel(); @@ -303,6 +304,12 @@ VectorDataToLabelImageFilter<TVectorData, TOutputImage>::GenerateData() geoTransform[4] = 0.; GDALSetGeoTransform(dataset,const_cast<double*>(geoTransform.GetDataPointer())); + char **options = nullptr; + if (m_AllTouchedMode) + { + options = CSLSetNameValue(options, "ALL_TOUCHED", "TRUE"); + } + // Burn the geometries into the dataset if (dataset != nullptr) { @@ -311,9 +318,11 @@ VectorDataToLabelImageFilter<TVectorData, TOutputImage>::GenerateData() m_SrcDataSetGeometries.size(), &(m_SrcDataSetGeometries[0]), nullptr, nullptr, &(m_FullBurnValues[0]), - nullptr, + options, GDALDummyProgress, nullptr ); + CSLDestroy(options); + // release the dataset GDALClose( dataset ); } diff --git a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapFilter.hxx b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapFilter.hxx index 3d6f6b6161a04fd2174e6155a2b9e491da06f7b5..37ee5e1f56ac66239e832585dddaaa9386ad28f8 100644 --- a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapFilter.hxx +++ b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapFilter.hxx @@ -295,7 +295,6 @@ VectorDataToLabelMapFilter<TVectorData, TLabelMap> CorrectFunctorType correct; PolygonPointerType correctPolygonExtRing = correct(dataNode->GetPolygonExteriorRing()); - typedef typename DataNodeType::PolygonType PolygonType; typedef typename PolygonType::RegionType RegionType; typedef typename PolygonType::VertexType VertexType; typedef typename IndexType::IndexValueType IndexValueType; diff --git a/Modules/ThirdParty/Mapnik/otb-module.cmake b/Modules/ThirdParty/Mapnik/otb-module.cmake index 34ee5c29ddcf57be645f5d4babcc122ffe75e848..dc2bb04a0f17bb6321363664618bd9af83ed5dd2 100644 --- a/Modules/ThirdParty/Mapnik/otb-module.cmake +++ b/Modules/ThirdParty/Mapnik/otb-module.cmake @@ -24,7 +24,9 @@ otb_module(OTBMapnik DEPENDS TEST_DEPENDS - + + DEPRECATED + DESCRIPTION "${DOCUMENTATION}" ) diff --git a/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx b/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx index 5a04ac0ac216be1f0524e552cc2f9a1f851a60d9..48a3626e7fa3a3e03ee25a0846cd1e71b99cd17b 100644 --- a/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx +++ b/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx @@ -298,7 +298,7 @@ VectorImageModel // Get build-context settings. VectorImageSettings * const settings = - static_cast< VectorImageSettings * const >( buildContext->m_Settings ); + static_cast< VectorImageSettings * >( buildContext->m_Settings ); // Fetch the no data flags if any diff --git a/Modules/Visualization/MonteverdiGui/src/mvdTreeWidget.cxx b/Modules/Visualization/MonteverdiGui/src/mvdTreeWidget.cxx index 3837c44790ec3acfc89d120467626a191abb219f..ffe5d2130a9fd5e84fd092618459384c05ae2da4 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdTreeWidget.cxx +++ b/Modules/Visualization/MonteverdiGui/src/mvdTreeWidget.cxx @@ -378,7 +378,7 @@ TreeWidget } /*******************************************************************************/ -void +void TreeWidget ::dragMoveEvent( QDragMoveEvent* e ) { @@ -435,7 +435,7 @@ TreeWidget } /*******************************************************************************/ -void +void TreeWidget ::dropEvent( QDropEvent* e ) { @@ -443,8 +443,6 @@ TreeWidget // qDebug() << this << "::dropEvent(" << e << ")"; - typedef QList< QTreeWidgetItem* > QTreeWidgetItemList; - QTreeWidgetItemList itemList; DecodeMimeData( itemList, e->mimeData() ); @@ -467,7 +465,7 @@ TreeWidget while( !item->flags().testFlag( Qt::ItemIsDropEnabled ) ) { item = item->parent(); - assert( item!=NULL ); + assert( item!=NULL ); #if 1 qDebug() @@ -533,7 +531,7 @@ operator << ( QDataStream& out, QTreeWidgetItem const * item ) "QDataStream& operator << ( QDataStream&, QTreeWidgetItem const * & );"; */ -#if 0 // operator >> is used in QT5 this lead to wrong call, fix: comment or +#if 0 // operator >> is used in QT5 this lead to wrong call, fix: comment or // put operator >> def and decl in a specific namespace. return operator << < QTreeWidgetItem >( out, item ); @@ -554,7 +552,7 @@ operator >>( QDataStream& in, QTreeWidgetItem * & item ) "QDataStream& operator >> ( QDataStream&, QTreeWidgetItem * & );"; */ -#if 0 +#if 0 return operator >> < QTreeWidgetItem >( in, item ); #else // DATA_STREAM_USE_TEMPLATE_OPERATORS diff --git a/SuperBuild/CMake/External_itk.cmake b/SuperBuild/CMake/External_itk.cmake index e9eb7d0b2ca528ab272a3c818f7705f5bdfee70a..5383af61e6d89aa359a20701a08747858a34f77d 100644 --- a/SuperBuild/CMake/External_itk.cmake +++ b/SuperBuild/CMake/External_itk.cmake @@ -149,8 +149,8 @@ set(_SB_ITK_DIR ${SB_INSTALL_PREFIX}/lib/cmake/ITK-${SB_ITK_VERSION_MAJOR}.${SB_ ExternalProject_Add(ITK PREFIX ITK - URL "https://sourceforge.net/projects/itk/files/itk/4.12/InsightToolkit-4.12.0.tar.gz" - URL_MD5 561a403f93c88c64085b5623e8e61f79 + URL "https://sourceforge.net/projects/itk/files/itk/4.13/InsightToolkit-4.13.1.tar.gz" + URL_MD5 c7e229802c4ee64e1b2a6d48b1df67e9 SOURCE_DIR ${ITK_SB_SRC} BINARY_DIR ${ITK_SB_BUILD_DIR} INSTALL_DIR ${SB_INSTALL_PREFIX}