diff --git a/Modules/Applications/AppTest/app/CMakeLists.txt b/Modules/Applications/AppTest/app/CMakeLists.txt index 44d54be96b09f488538771a820f73ffb7048df87..3322351683809a6528d782ec6324527c73409e0b 100644 --- a/Modules/Applications/AppTest/app/CMakeLists.txt +++ b/Modules/Applications/AppTest/app/CMakeLists.txt @@ -22,3 +22,8 @@ otb_create_application( NAME TestApplication SOURCES otbTestApplication.cxx LINK_LIBRARIES ${${otb-module}_LIBRARIES}) + +otb_create_application( + NAME MemoryTest + SOURCES otbMemoryTestApplication.cxx + LINK_LIBRARIES ${${otb-module}_LIBRARIES}) \ No newline at end of file diff --git a/Modules/Applications/AppTest/app/otbMemoryTestApplication.cxx b/Modules/Applications/AppTest/app/otbMemoryTestApplication.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0e982a046a9bbf8d214d63742066ffddf6d52755 --- /dev/null +++ b/Modules/Applications/AppTest/app/otbMemoryTestApplication.cxx @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) + * + * This file is part of Orfeo Toolbox + * + * https://www.orfeo-toolbox.org/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <numeric> + +#include "otbWrapperApplication.h" +#include "otbWrapperApplicationFactory.h" + +#include "otbMultiToMonoChannelExtractROI.h" + +namespace otb +{ +namespace Wrapper +{ + +class MemoryTest : public Application +{ +public: + /** Standard class typedefs. */ + typedef MemoryTest Self; + typedef Application Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; + + /** Standard macro */ + itkNewMacro(Self); + + itkTypeMacro(MemoryTest, otb::Application) + + typedef MultiToMonoChannelExtractROI<FloatVectorImageType::InternalPixelType, + FloatVectorImageType::InternalPixelType> ExtractROIFilterType; + + + +private: + + void DoInit() ITK_OVERRIDE + { + SetName("MemoryTest"); + SetDescription("This application is made for test"); + // Documentation + SetDocName("Memory Test"); + SetDocLongDescription(""); + SetDocLimitations("None"); + SetDocAuthors("OTB-Team"); + SetDocSeeAlso(""); + + AddParameter(ParameterType_InputImage, "in", "Input image"); + SetParameterDescription("in", "Input image"); + + AddParameter(ParameterType_OutputImage, "out", "Output Image"); + SetParameterDescription("out", "Output image"); + SetDefaultOutputPixelType("out",ImagePixelType_uint8); + + + AddRAMParameter(); + + // Doc example parameter settings + SetDocExampleParameterValue("in", "input.tif"); + SetDocExampleParameterValue("out", "output.tif"); + + SetOfficialDocLink(); + } + + void DoUpdateParameters() ITK_OVERRIDE + { + } + + void DoExecute() ITK_OVERRIDE + { + GetParameterImage("in")->DebugOn(); + ExtractROIFilterType::Pointer extractor = ExtractROIFilterType::New(); + extractor->DebugOn(); + m_Filters.push_back(extractor.GetPointer()); + extractor->DebugOn(); + extractor->SetInput(GetParameterImage("in")); + extractor->SetChannel(1); + extractor->UpdateOutputInformation(); + extractor->GetOutput()->DebugOn(); + SetParameterOutputImage("out" , extractor->GetOutput() ); + } + +}; + +} +} + +OTB_APPLICATION_EXPORT(otb::Wrapper::MemoryTest) + diff --git a/Modules/Applications/AppTest/otb-module.cmake b/Modules/Applications/AppTest/otb-module.cmake index fc492e17d8722f75117ebd22724e3f37f7354fa5..d67ae1c32692babe31986f77409955fbc102a4e5 100644 --- a/Modules/Applications/AppTest/otb-module.cmake +++ b/Modules/Applications/AppTest/otb-module.cmake @@ -23,6 +23,7 @@ set(DOCUMENTATION "Test application.") otb_module(OTBAppTest DEPENDS OTBApplicationEngine + OTBImageBase TEST_DEPENDS OTBTestKernel OTBCommandLine diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h b/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h index f97134cbd1e4eb32f6768168b50eb5cab7c94158..f33d1ba16869cdc0d3aa0f50d8226af0a76d7adf 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h @@ -853,6 +853,8 @@ public: this->SetDocLink(link); } + std::vector<itk::ProcessObject::Pointer> m_Filters; + protected: /** Constructor */ Application();