diff --git a/Applications/Utils/otbBandMathX.cxx b/Applications/Utils/otbBandMathX.cxx index 08c78ad8d6eb819128eec0fec38388116fb83f40..f30a15a5d1b4b4bdbcccf271b109470875fb0bc4 100644 --- a/Applications/Utils/otbBandMathX.cxx +++ b/Applications/Utils/otbBandMathX.cxx @@ -20,7 +20,7 @@ #include "otbObjectList.h" -#include "otbBandMathImageFilterX.h" +#include "otbBandMathXImageFilter.h" namespace otb { @@ -44,7 +44,7 @@ public: itkTypeMacro(BandMathX, otb::Application); - typedef otb::BandMathImageFilterX<FloatVectorImageType> BandMathImageFilterType; + typedef otb::BandMathXImageFilter<FloatVectorImageType> BandMathImageFilterType; private: diff --git a/Code/BasicFilters/otbBandMathImageFilterX.h b/Code/BasicFilters/otbBandMathXImageFilter.h similarity index 93% rename from Code/BasicFilters/otbBandMathImageFilterX.h rename to Code/BasicFilters/otbBandMathXImageFilter.h index e8bd4f512de8e32ed4b0268c572f8b5c4be5dda5..b6d8dca957107907efaf6a1d7795f472e07f1906 100644 --- a/Code/BasicFilters/otbBandMathImageFilterX.h +++ b/Code/BasicFilters/otbBandMathXImageFilter.h @@ -19,8 +19,8 @@ =========================================================================*/ -#ifndef __otbBandMathImageFilterX_h -#define __otbBandMathImageFilterX_h +#ifndef __otbBandMathXImageFilter_h +#define __otbBandMathXImageFilter_h #include "itkImageToImageFilter.h" #include "itkArray.h" @@ -33,7 +33,7 @@ namespace otb { -/** \class BandMathImageFilterX +/** \class BandMathXImageFilter * \brief Performs mathematical operations on the input images * according to the formula specified by the user. * @@ -57,12 +57,12 @@ namespace otb */ template< class TImage > -class ITK_EXPORT BandMathImageFilterX +class ITK_EXPORT BandMathXImageFilter : public itk::ImageToImageFilter< TImage , TImage > { public: /** Standard class typedefs. */ - typedef BandMathImageFilterX< TImage > Self; + typedef BandMathXImageFilter< TImage > Self; typedef itk::ImageToImageFilter< TImage , TImage> Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; @@ -71,7 +71,7 @@ public: itkNewMacro(Self); /** Run-time type information (and related methods). */ - itkTypeMacro(BandMathImageFilterX, ImageToImageFilter); + itkTypeMacro(BandMathXImageFilter, ImageToImageFilter); /** Some convenient typedefs. */ typedef TImage ImageType; @@ -121,8 +121,8 @@ public: protected : - BandMathImageFilterX(); - virtual ~BandMathImageFilterX(); + BandMathXImageFilter(); + virtual ~BandMathXImageFilter(); virtual void PrintSelf(std::ostream& os, itk::Indent indent) const; void GenerateOutputInformation(); @@ -147,7 +147,7 @@ private : } adhocStruct; - BandMathImageFilterX(const Self&); //purposely not implemented + BandMathXImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented void AddVariable(adhocStruct&); @@ -178,7 +178,7 @@ private : }//end namespace otb #ifndef OTB_MANUAL_INSTANTIATION -#include "otbBandMathImageFilterX.txx" +#include "otbBandMathXImageFilter.txx" #endif #endif diff --git a/Code/BasicFilters/otbBandMathImageFilterX.txx b/Code/BasicFilters/otbBandMathXImageFilter.txx similarity index 97% rename from Code/BasicFilters/otbBandMathImageFilterX.txx rename to Code/BasicFilters/otbBandMathXImageFilter.txx index 521f38c7eb5d4aa71993cdd87ecc3377ccccb26a..81f0849b4b94c03adbad537ecc9d580ca3fcae91 100644 --- a/Code/BasicFilters/otbBandMathImageFilterX.txx +++ b/Code/BasicFilters/otbBandMathXImageFilter.txx @@ -18,9 +18,9 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#ifndef __otbBandMathImageFilterX_txx -#define __otbBandMathImageFilterX_txx -#include "otbBandMathImageFilterX.h" +#ifndef __otbBandMathXImageFilter_txx +#define __otbBandMathXImageFilter_txx +#include "otbBandMathXImageFilter.h" #include "itkImageRegionIterator.h" #include "itkImageRegionConstIterator.h" @@ -38,8 +38,8 @@ namespace otb /** Constructor */ template <class TImage> -BandMathImageFilterX<TImage> -::BandMathImageFilterX() +BandMathXImageFilter<TImage> +::BandMathXImageFilter() { //This number will be incremented each time an image //is added over the one minimumrequired @@ -68,8 +68,8 @@ BandMathImageFilterX<TImage> /** Destructor */ template <class TImage> -BandMathImageFilterX<TImage> -::~BandMathImageFilterX() +BandMathXImageFilter<TImage> +::~BandMathXImageFilter() { m_Expression.clear(); m_VParser.clear(); @@ -90,7 +90,7 @@ BandMathImageFilterX<TImage> template <class TImage> -void BandMathImageFilterX<TImage> +void BandMathXImageFilter<TImage> ::PrintSelf(std::ostream& os, itk::Indent indent) const { Superclass::PrintSelf(os, indent); @@ -108,7 +108,7 @@ void BandMathImageFilterX<TImage> } template <class TImage> -void BandMathImageFilterX<TImage> +void BandMathXImageFilter<TImage> ::SetNthInput(unsigned int idx, const ImageType * image) { @@ -118,7 +118,7 @@ void BandMathImageFilterX<TImage> } template <class TImage> -void BandMathImageFilterX<TImage> +void BandMathXImageFilter<TImage> ::SetNthInput(unsigned int idx, const ImageType * image, const std::string& varName) { @@ -211,7 +211,7 @@ void BandMathImageFilterX<TImage> } template <typename TImage> -TImage * BandMathImageFilterX<TImage> +TImage * BandMathXImageFilter<TImage> ::GetNthInput(unsigned int idx) { return const_cast<TImage *>(this->GetInput(idx)); @@ -219,7 +219,7 @@ TImage * BandMathImageFilterX<TImage> template< typename TImage > -void BandMathImageFilterX<TImage> +void BandMathXImageFilter<TImage> ::SetExpression(const std::string& expression) { @@ -248,7 +248,7 @@ void BandMathImageFilterX<TImage> template< typename TImage > -void BandMathImageFilterX<TImage> +void BandMathXImageFilter<TImage> ::SetMatrix(const std::string& name, const std::string& definition) { @@ -308,7 +308,7 @@ void BandMathImageFilterX<TImage> template< typename TImage > -void BandMathImageFilterX<TImage> +void BandMathXImageFilter<TImage> ::SetConstant(const std::string& name, double value) { for(int i=0; i<m_VAllowedVarNameAddedByUser.size(); i++) @@ -326,7 +326,7 @@ void BandMathImageFilterX<TImage> template< typename TImage > -void BandMathImageFilterX<TImage> +void BandMathXImageFilter<TImage> ::ExportContext(const std::string& filename) { @@ -398,7 +398,7 @@ void BandMathImageFilterX<TImage> } template< typename TImage > -void BandMathImageFilterX<TImage> +void BandMathXImageFilter<TImage> ::ImportContext(const std::string& filename) { std::ifstream importFile(filename.c_str(), std::ios::in); @@ -501,7 +501,7 @@ void BandMathImageFilterX<TImage> template< typename TImage > -std::string BandMathImageFilterX<TImage> +std::string BandMathXImageFilter<TImage> ::GetExpression(int IDExpression) const { return m_Expression.at(IDExpression); @@ -509,7 +509,7 @@ std::string BandMathImageFilterX<TImage> template< typename TImage > -std::vector<std::string> BandMathImageFilterX<TImage> +std::vector<std::string> BandMathXImageFilter<TImage> ::GetVarNames() const { std::vector<std::string> res; @@ -521,7 +521,7 @@ std::vector<std::string> BandMathImageFilterX<TImage> template< typename TImage > -void BandMathImageFilterX<TImage> +void BandMathXImageFilter<TImage> ::AddVariable(adhocStruct &ahc) { bool found=false; @@ -536,7 +536,7 @@ void BandMathImageFilterX<TImage> template< typename TImage > -void BandMathImageFilterX<TImage> +void BandMathXImageFilter<TImage> ::PrepareParsers() { @@ -705,7 +705,7 @@ void BandMathImageFilterX<TImage> template< typename TImage > -void BandMathImageFilterX< TImage > +void BandMathXImageFilter< TImage > ::OutputsDimensions() { @@ -749,7 +749,7 @@ void BandMathImageFilterX< TImage > template< typename TImage > -void BandMathImageFilterX< TImage > +void BandMathXImageFilter< TImage > ::GenerateOutputInformation(void) { Superclass::GenerateOutputInformation(); @@ -778,7 +778,7 @@ void BandMathImageFilterX< TImage > template< typename TImage > -void BandMathImageFilterX< TImage > +void BandMathXImageFilter< TImage > ::GenerateInputRequestedRegion() { // call the superclass' implementation of this method @@ -799,7 +799,7 @@ void BandMathImageFilterX< TImage > template< typename TImage > -void BandMathImageFilterX<TImage> +void BandMathXImageFilter<TImage> ::BeforeThreadedGenerateData() { // Some useful variables @@ -905,7 +905,7 @@ void BandMathImageFilterX<TImage> template< typename TImage > -void BandMathImageFilterX<TImage> +void BandMathXImageFilter<TImage> ::AfterThreadedGenerateData() { unsigned int nbThreads = this->GetNumberOfThreads(); @@ -938,7 +938,7 @@ void BandMathImageFilterX<TImage> } template< typename TImage > -void BandMathImageFilterX<TImage> +void BandMathXImageFilter<TImage> ::ThreadedGenerateData(const ImageRegionType& outputRegionForThread, itk::ThreadIdType threadId) { diff --git a/Examples/BasicFilters/BandMathFilterXExample.cxx b/Examples/BasicFilters/BandMathXImageFilterExample.cxx similarity index 96% rename from Examples/BasicFilters/BandMathFilterXExample.cxx rename to Examples/BasicFilters/BandMathXImageFilterExample.cxx index db6e7f510e54c331b7058d582096d935e86efcf6..58c82b68f9856dab5056db25301b501d89907e80 100644 --- a/Examples/BasicFilters/BandMathFilterXExample.cxx +++ b/Examples/BasicFilters/BandMathXImageFilterExample.cxx @@ -56,7 +56,7 @@ #include "otbVectorImage.h" #include "otbImageFileReader.h" #include "otbImageFileWriter.h" -#include "otbBandMathImageFilterX.h" +#include "otbBandMathXImageFilter.h" // Software Guide : EndCodeSnippet int main( int argc, char* argv[]) @@ -74,7 +74,7 @@ int main( int argc, char* argv[]) // Software Guide : BeginLatex // // Then, we set the classical \code{typedef}s needed for reading and -// writing the images. The \doxygen{otb}{BandMathImageFilterX} class +// writing the images. The \doxygen{otb}{BandMathXImageFilter} class // works with \doxygen{otb}{VectorImage}. // // Software Guide : EndLatex @@ -94,7 +94,7 @@ int main( int argc, char* argv[]) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - typedef otb::BandMathImageFilterX<ImageType> FilterType; + typedef otb::BandMathXImageFilter<ImageType> FilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -167,14 +167,14 @@ int main( int argc, char* argv[]) // Software Guide : BeginLatex // -// Figure~\ref{fig:BandMathImageFilterX} shows the result of our high-pass filter. +// Figure~\ref{fig:BandMathXImageFilter} shows the result of our high-pass filter. // \begin{figure} // \center // \includegraphics[width=0.45\textwidth]{qb_ExtractRoad.eps} // \includegraphics[width=0.45\textwidth]{qb_BandMath-res1.eps} // \itkcaption[Band Math X]{From left to right: // Original image, high-pass filter output.} -// \label{fig:BandMathImageFilterX} +// \label{fig:BandMathXImageFilter} // \end{figure} // // Software Guide : EndLatex @@ -256,14 +256,14 @@ int main( int argc, char* argv[]) // Software Guide : BeginLatex // -// Figure~\ref{fig:BandMathImageFilterX2} shows the result of the second filter. +// Figure~\ref{fig:BandMathXImageFilter2} shows the result of the second filter. // \begin{figure} // \center // \includegraphics[width=0.45\textwidth]{qb_ExtractRoad.eps} // \includegraphics[width=0.45\textwidth]{qb_BandMath-res2.eps} // \itkcaption[Band Math X]{From left to right: // Original image, second filter output.} -// \label{fig:BandMathImageFilterX2} +// \label{fig:BandMathXImageFilter2} // \end{figure} // // Software Guide : EndLatex diff --git a/Examples/BasicFilters/CMakeLists.txt b/Examples/BasicFilters/CMakeLists.txt index 946fbeff2d5b9e047546b2f9f0207890d3c234ec..ffd5e75b1616b4d36f5a460fff92443e4db0908e 100644 --- a/Examples/BasicFilters/CMakeLists.txt +++ b/Examples/BasicFilters/CMakeLists.txt @@ -28,8 +28,8 @@ target_link_libraries(HillShadingExample OTBCommon OTBIO OTBBasicFilters) add_executable(BandMathFilterExample BandMathFilterExample.cxx ) target_link_libraries(BandMathFilterExample OTBCommon OTBIO OTBBasicFilters) -add_executable(BandMathFilterXExample BandMathFilterXExample.cxx ) -target_link_libraries(BandMathFilterXExample OTBCommon OTBIO OTBBasicFilters) +add_executable(BandMathXImageFilterExample BandMathXImageFilterExample.cxx ) +target_link_libraries(BandMathXImageFilterExample OTBCommon OTBIO OTBBasicFilters) if( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING ) diff --git a/Testing/Code/BasicFilters/CMakeLists.txt b/Testing/Code/BasicFilters/CMakeLists.txt index 2ed788c468698b39fcc2276b8770caf3de6e5930..7ded6d689e3fb50980aab120aedc96f868edf190 100644 --- a/Testing/Code/BasicFilters/CMakeLists.txt +++ b/Testing/Code/BasicFilters/CMakeLists.txt @@ -2126,29 +2126,29 @@ add_test(bfTvBandMathImageFilterWithIdx ${BASICFILTERS_TESTS13} ${TEMP}/bfTvBandMathImageFilterWithIdx2.tif ) -add_test(bfTuBandMathImageFilterXNew ${BASICFILTERS_TESTS13} - otbBandMathImageFilterXNew) +add_test(bfTuBandMathXImageFilterNew ${BASICFILTERS_TESTS13} + otbBandMathXImageFilterNew) -add_test(bfTvBandMathImageFilterX ${BASICFILTERS_TESTS13} - otbBandMathImageFilterX) +add_test(bfTvBandMathXImageFilter ${BASICFILTERS_TESTS13} + otbBandMathXImageFilter) -add_test(bfTvotbBandMathImageFilterXConv ${BASICFILTERS_TESTS13} - otbBandMathImageFilterXConv +add_test(bfTvBandMathXImageFilterConv ${BASICFILTERS_TESTS13} + otbBandMathXImageFilterConv ${BASELINE_FILES}/bfTvExportBandMathX.txt ${TEMP}/bfTvExportBandMathXOut.txt ) -add_test(bfTvotbBandMathImageFilterXTxt ${BASICFILTERS_TESTS13} +add_test(bfTvBandMathXImageFilterTxt ${BASICFILTERS_TESTS13} --compare-ascii ${NOTOL} ${BASELINE_FILES}/bfTvExportBandMathX.txt ${TEMP}/bfTvExportBandMathXOut.txt - otbBandMathImageFilterXTxt + otbBandMathXImageFilterTxt ${BASELINE_FILES}/bfTvExportBandMathX.txt ${TEMP}/bfTvExportBandMathXOut.txt ) -add_test(bfTvBandMathImageFilterXWithIdx ${BASICFILTERS_TESTS13} - otbBandMathImageFilterXWithIdx +add_test(bfTvBandMathXImageFilterWithIdx ${BASICFILTERS_TESTS13} + otbBandMathXImageFilterWithIdx ${TEMP}/bfTvBandMathImageFilterWithIdx1.tif ${TEMP}/bfTvBandMathImageFilterWithIdx2.tif ) @@ -3173,7 +3173,7 @@ otbImageAndVectorImageOperationFilterTest.cxx set(BasicFilters_SRCS13 otbBasicFiltersTests13.cxx otbBandMathImageFilter.cxx -otbBandMathImageFilterX.cxx +otbBandMathXImageFilter.cxx otbComplexToIntensityFilterTest.cxx otbRealAndImaginaryImageToComplexImageFilterTest.cxx otbRealImageToComplexImageFilterTest.cxx diff --git a/Testing/Code/BasicFilters/otbBandMathImageFilterX.cxx b/Testing/Code/BasicFilters/otbBandMathXImageFilter.cxx similarity index 96% rename from Testing/Code/BasicFilters/otbBandMathImageFilterX.cxx rename to Testing/Code/BasicFilters/otbBandMathXImageFilter.cxx index 8a54d05cc97b0891150987852154f4a6c28f6b4f..471a4276c3d11f2d73b14a1aff4dd329a8fc1175 100644 --- a/Testing/Code/BasicFilters/otbBandMathImageFilterX.cxx +++ b/Testing/Code/BasicFilters/otbBandMathXImageFilter.cxx @@ -23,16 +23,16 @@ #include "otbMath.h" #include "otbVectorImage.h" -#include "otbBandMathImageFilterX.h" +#include "otbBandMathXImageFilter.h" #include "otbImageFileWriter.h" #include "itkImageRegionIteratorWithIndex.h" -int otbBandMathImageFilterXNew( int itkNotUsed(argc), char* itkNotUsed(argv) []) +int otbBandMathXImageFilterNew( int itkNotUsed(argc), char* itkNotUsed(argv) []) { typedef double PixelType; typedef otb::VectorImage<PixelType, 2> ImageType; - typedef otb::BandMathImageFilterX<ImageType> FilterType; + typedef otb::BandMathXImageFilter<ImageType> FilterType; FilterType::Pointer filter = FilterType::New(); @@ -40,12 +40,12 @@ int otbBandMathImageFilterXNew( int itkNotUsed(argc), char* itkNotUsed(argv) []) } -int otbBandMathImageFilterX( int itkNotUsed(argc), char* itkNotUsed(argv) []) +int otbBandMathXImageFilter( int itkNotUsed(argc), char* itkNotUsed(argv) []) { typedef otb::VectorImage<double, 2> ImageType; typedef ImageType::PixelType PixelType; - typedef otb::BandMathImageFilterX<ImageType> FilterType; + typedef otb::BandMathXImageFilter<ImageType> FilterType; unsigned int i; const unsigned int N = 100, D1=3, D2=1, D3=1; @@ -199,13 +199,13 @@ int otbBandMathImageFilterX( int itkNotUsed(argc), char* itkNotUsed(argv) []) } -int otbBandMathImageFilterXConv( int itkNotUsed(argc), char* argv []) +int otbBandMathXImageFilterConv( int itkNotUsed(argc), char* argv []) { const char * inputFilename = argv[1]; typedef otb::VectorImage<double, 2> ImageType; typedef ImageType::PixelType PixelType; - typedef otb::BandMathImageFilterX<ImageType> FilterType; + typedef otb::BandMathXImageFilter<ImageType> FilterType; unsigned int i; const unsigned int N = 100, D1=3, D2=1, D3=1; @@ -434,14 +434,14 @@ int otbBandMathImageFilterXConv( int itkNotUsed(argc), char* argv []) } -int otbBandMathImageFilterXTxt( int itkNotUsed(argc), char* argv []) +int otbBandMathXImageFilterTxt( int itkNotUsed(argc), char* argv []) { const char * inputFilename = argv[1]; const char * outputFilename = argv[2]; typedef otb::VectorImage<double, 2> ImageType; typedef ImageType::PixelType PixelType; - typedef otb::BandMathImageFilterX<ImageType> FilterType; + typedef otb::BandMathXImageFilter<ImageType> FilterType; FilterType::Pointer filter = FilterType::New(); @@ -452,7 +452,7 @@ int otbBandMathImageFilterXTxt( int itkNotUsed(argc), char* argv []) } -int otbBandMathImageFilterXWithIdx( int itkNotUsed(argc), char* argv[]) +int otbBandMathXImageFilterWithIdx( int itkNotUsed(argc), char* argv[]) { const char * outfname1 = argv[1]; const char * outfname2 = argv[2]; @@ -460,7 +460,7 @@ int otbBandMathImageFilterXWithIdx( int itkNotUsed(argc), char* argv[]) typedef otb::VectorImage<double, 2> ImageType; typedef ImageType::PixelType PixelType; - typedef otb::BandMathImageFilterX<ImageType> FilterType; + typedef otb::BandMathXImageFilter<ImageType> FilterType; typedef otb::ImageFileWriter<ImageType> WriterType; const unsigned int N = 100, D1=1, D2=1, D3=1; diff --git a/Testing/Code/BasicFilters/otbBasicFiltersTests13.cxx b/Testing/Code/BasicFilters/otbBasicFiltersTests13.cxx index 71a9d29aac6b89d1884115749f3ac41371cf1732..91a531cac14007e67e1dc28ee53c81311ea8e203 100644 --- a/Testing/Code/BasicFilters/otbBasicFiltersTests13.cxx +++ b/Testing/Code/BasicFilters/otbBasicFiltersTests13.cxx @@ -26,12 +26,12 @@ void RegisterTests() { REGISTER_TEST(otbBandMathImageFilterNew); REGISTER_TEST(otbBandMathImageFilter); - REGISTER_TEST(otbBandMathImageFilterXNew); - REGISTER_TEST(otbBandMathImageFilterX); - REGISTER_TEST(otbBandMathImageFilterXConv); - REGISTER_TEST(otbBandMathImageFilterXTxt); + REGISTER_TEST(otbBandMathXImageFilterNew); + REGISTER_TEST(otbBandMathXImageFilter); + REGISTER_TEST(otbBandMathXImageFilterConv); + REGISTER_TEST(otbBandMathXImageFilterTxt); REGISTER_TEST(otbBandMathImageFilterWithIdx); - REGISTER_TEST(otbBandMathImageFilterXWithIdx); + REGISTER_TEST(otbBandMathXImageFilterWithIdx); REGISTER_TEST(otbComplexToIntensityFilterTest); REGISTER_TEST(otbRealAndImaginaryImageToComplexImageFilterTest); REGISTER_TEST(otbRealImageToComplexImageFilterTest);