diff --git a/Applications/Test/CMakeLists.txt b/Applications/Test/CMakeLists.txt index 1e87f0567fb8263e199dc6e93aba95d534cc7c21..718e89d948592065e2ef8efbb1e39ee41b27e712 100644 --- a/Applications/Test/CMakeLists.txt +++ b/Applications/Test/CMakeLists.txt @@ -1,6 +1,2 @@ -OTB_CREATE_APPLICATION(NAME Addition SOURCES otbAddition.cxx) -OTB_CREATE_APPLICATION(NAME AllocateOutput SOURCES otbAllocateOutput.cxx LINK_LIBRARIES OTBIO;OTBCommon;OTBBasicFilters) -OTB_CREATE_APPLICATION(NAME CopyInput SOURCES otbCopyInput.cxx LINK_LIBRARIES OTBIO;OTBCommon;OTBBasicFilters) -OTB_CREATE_APPLICATION(NAME InternalReader SOURCES otbInternalReader.cxx LINK_LIBRARIES OTBIO;OTBCommon;OTBBasicFilters) OTB_CREATE_APPLICATION(NAME TestApplication SOURCES otbTestApplication.cxx LINK_LIBRARIES OTBIO;OTBCommon;OTBBasicFilters) diff --git a/Applications/Test/otbAddition.cxx b/Applications/Test/otbAddition.cxx deleted file mode 100644 index 4836c4f803876f3c44d404a8a8c7a8dab1d9dcdd..0000000000000000000000000000000000000000 --- a/Applications/Test/otbAddition.cxx +++ /dev/null @@ -1,74 +0,0 @@ -/*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.txt for details. - - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - - =========================================================================*/ -#include "otbWrapperApplication.h" -#include "otbWrapperApplicationFactory.h" - -namespace otb -{ -namespace Wrapper -{ - -class Addition : public Application -{ -public: - /** Standard class typedefs. */ - typedef Addition Self; - typedef Application Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - /** Standard macro */ - itkNewMacro(Self); - - itkTypeMacro(Addition, otb::Application); - -private: - Addition() - { - SetName("Addition"); - SetDescription("This is a simple application which adds two numbers and print the sum on standard output"); - } - - virtual ~Addition() - { - } - - void DoCreateParameters() - { - std::cout << "Addition::DoCreateParameters" << std::endl; - AddParameter(ParameterType_Float, "a", "First number"); - AddParameter(ParameterType_Float, "b", "Second number"); - } - - void DoUpdateParameters() - { - std::cout << "Addition::DoUpdateParameters" << std::endl; - } - - void DoExecute() - { - std::cout << "Addition::DoExecute" << std::endl; - GetLogger()->Debug("debug message"); - GetLogger()->Error("error message"); - std::cout << GetParameterFloat("a") + GetParameterFloat("b") << std::endl; - } -}; -} -} - -OTB_APPLICATION_EXPORT(otb::Wrapper::Addition) diff --git a/Applications/Test/otbAllocateOutput.cxx b/Applications/Test/otbAllocateOutput.cxx deleted file mode 100644 index dc4c4c695b7f80a741645a68f578404800abb2cd..0000000000000000000000000000000000000000 --- a/Applications/Test/otbAllocateOutput.cxx +++ /dev/null @@ -1,102 +0,0 @@ -/*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.txt for details. - - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - - =========================================================================*/ -#include "otbWrapperApplication.h" -#include "otbWrapperApplicationFactory.h" - -namespace otb -{ -namespace Wrapper -{ - - -class AllocateOutput : public Application -{ -public: - /** Standard class typedefs. */ - typedef AllocateOutput Self; - typedef Application Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - /** Standard macro */ - itkNewMacro(Self); - - itkTypeMacro(AllocateOutput, otb::Application); - - -private: - AllocateOutput() - { - SetName("AllocateOutput"); - m_Image = FloatVectorImageType::New(); - SetDescription("Allocate output image inside the process."); - } - - virtual ~AllocateOutput() - { - } - - void DoCreateParameters() - { - AddParameter(ParameterType_OutputImage, "out", "Output Image"); - } - - void DoUpdateParameters() - { - // Nothing to do here : all parameters are independent - } - - void DoExecute() - { - FloatVectorImageType::Pointer inImage = FloatVectorImageType::New(); - - FloatVectorImageType::IndexType start; - start[0] = 0; // first index on X - start[1] = 0; // first index on Y - - FloatVectorImageType::SizeType size; - size[0] = 10; // size along X - size[1] = 10; - - FloatVectorImageType::RegionType region; - - region.SetSize(size); - region.SetIndex(start); - - m_Image->SetRegions(region); - m_Image->SetNumberOfComponentsPerPixel( 3 ); - m_Image->Allocate(); - - FloatVectorImageType::PixelType initialValue; - initialValue.SetSize(3); - initialValue.Fill(0); - m_Image->FillBuffer(initialValue); - - SetParameterOutputImage("out", m_Image); - } - - FloatVectorImageType::Pointer m_Image; -}; - - - -} -} - -OTB_APPLICATION_EXPORT(otb::Wrapper::AllocateOutput) - diff --git a/Applications/Test/otbCopyInput.cxx b/Applications/Test/otbCopyInput.cxx deleted file mode 100644 index 0cfe453e6752948d67fab21d30de8db5b1af4264..0000000000000000000000000000000000000000 --- a/Applications/Test/otbCopyInput.cxx +++ /dev/null @@ -1,91 +0,0 @@ -/*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.txt for details. - - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - - =========================================================================*/ -#include "otbWrapperApplication.h" -#include "otbWrapperApplicationFactory.h" -#include "itkCastImageFilter.h" - -namespace otb -{ -namespace Wrapper -{ - - -class CopyInput : public Application -{ -public: - /** Standard class typedefs. */ - typedef CopyInput Self; - typedef Application Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - /** Standard macro */ - itkNewMacro(Self); - - itkTypeMacro(CopyInput, otb::Application); - -private: - CopyInput() - { - SetName("CopyInput"); - SetDescription("Copy the input image into output."); - } - - virtual ~CopyInput() - { - } - - void DoCreateParameters() - { - AddParameter(ParameterType_InputImage, "in", "Input Image"); - AddParameter(ParameterType_OutputImage, "out", "Output Image"); - } - - void DoUpdateParameters() - { - // Nothing to do here : all parameters are independent - } - - void DoExecute() - { - std::cout << "CopyInput 1" << std::endl; - FloatVectorImageType::Pointer inImage = GetParameterImage("in"); - - typedef itk::CastImageFilter<FloatVectorImageType, FloatVectorImageType> CastImageFilterType; - CastImageFilterType::Pointer caster = CastImageFilterType::New(); - m_FilterRef = caster; - std::cout << "CopyInput 2" << std::endl; - caster->SetInPlace(true); - caster->SetInput(inImage); - std::cout << "CopyInput 3" << std::endl; - caster->UpdateOutputInformation(); - std::cout << "CopyInput 4" << std::endl; - SetParameterOutputImage("out", caster->GetOutput()); - std::cout << "CopyInput 5" << std::endl; - } - - itk::LightObject::Pointer m_FilterRef; -}; - - - -} -} - -OTB_APPLICATION_EXPORT(otb::Wrapper::CopyInput) - diff --git a/Applications/Test/otbInternalReader.cxx b/Applications/Test/otbInternalReader.cxx deleted file mode 100644 index 94e2201314435a25e8a923887511541990843737..0000000000000000000000000000000000000000 --- a/Applications/Test/otbInternalReader.cxx +++ /dev/null @@ -1,85 +0,0 @@ -/*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.txt for details. - - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - - =========================================================================*/ -#include "otbWrapperApplication.h" -#include "otbWrapperApplicationFactory.h" - -#include "otbImageFileReader.h" - -namespace otb -{ -namespace Wrapper -{ - - -class InternalReader : public Application -{ -public: - /** Standard class typedefs. */ - typedef InternalReader Self; - typedef Application Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - /** Standard macro */ - itkNewMacro(Self); - - itkTypeMacro(InternalReader, otb::Application); - - /** Filters typedef */ - typedef otb::ImageFileReader<FloatVectorImageType> ReaderFilterType; - -private: - InternalReader() - { - SetName("InternalReader"); - SetDescription("Read an image."); - m_Reader = ReaderFilterType::New(); - } - - virtual ~InternalReader() - { - } - - void DoCreateParameters() - { - AddParameter(ParameterType_String, "inname", "Input file name"); - AddParameter(ParameterType_OutputImage, "out", "Output Image"); - } - - void DoUpdateParameters() - { - // Nothing to do here : all parameters are independent - } - - void DoExecute() - { - m_Reader->SetFileName( GetParameterString("inname") ); - m_Reader->UpdateOutputInformation(); - SetParameterOutputImage("out", m_Reader->GetOutput()); - } - - ReaderFilterType::Pointer m_Reader; -}; - - - -} -} - -OTB_APPLICATION_EXPORT(otb::Wrapper::InternalReader) -