From f12371be1d9cbd823f7b85aa72f81e61ba3f8750 Mon Sep 17 00:00:00 2001 From: ctraizet <cedric.traizet@c-s.fr> Date: Tue, 26 Mar 2019 17:51:01 +0100 Subject: [PATCH] ENH: remove complex image parameters --- Examples/Application/ApplicationExample.cxx | 5 - .../AppTest/app/otbTestApplication.cxx | 8 - .../MonteverdiGui/src/mvdQtWidgetView.cxx | 7 - .../include/otbWrapperApplication.h | 75 ---- .../otbWrapperComplexInputImageParameter.h | 152 -------- .../otbWrapperComplexInputImageParameter.hxx | 169 --------- .../otbWrapperComplexOutputImageParameter.h | 148 -------- .../include/otbWrapperTypes.h | 4 - .../ApplicationEngine/src/CMakeLists.txt | 2 - .../src/otbWrapperApplication.cxx | 87 +---- .../otbWrapperComplexInputImageParameter.cxx | 199 ----------- .../otbWrapperComplexOutputImageParameter.cxx | 328 ------------------ .../otbWrapperInputProcessXMLParameter.cxx | 17 - .../otbWrapperOutputProcessXMLParameter.cxx | 12 +- .../src/otbWrapperParameterGroup.cxx | 12 - 15 files changed, 7 insertions(+), 1218 deletions(-) delete mode 100644 Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexInputImageParameter.h delete mode 100644 Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexInputImageParameter.hxx delete mode 100644 Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexOutputImageParameter.h delete mode 100644 Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexInputImageParameter.cxx delete mode 100644 Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexOutputImageParameter.cxx diff --git a/Examples/Application/ApplicationExample.cxx b/Examples/Application/ApplicationExample.cxx index 4e402f001e..ee41113507 100644 --- a/Examples/Application/ApplicationExample.cxx +++ b/Examples/Application/ApplicationExample.cxx @@ -167,11 +167,6 @@ private: SetDefaultParameterInt("ram", 256); MandatoryOff("ram"); - AddParameter(ParameterType_ComplexInputImage, "cin", "Input complex image"); - AddParameter(ParameterType_ComplexOutputImage, "cout", "Output complex image"); - MandatoryOff("cin"); - MandatoryOff("cout"); - // An example of command-line is automatically generated. Method \code{SetDocExampleParameterValue()} is // used to set parameters. Dataset should be located in \code{OTB-Data/Examples} directory. diff --git a/Modules/Applications/AppTest/app/otbTestApplication.cxx b/Modules/Applications/AppTest/app/otbTestApplication.cxx index 5b5854a18e..60fff26221 100644 --- a/Modules/Applications/AppTest/app/otbTestApplication.cxx +++ b/Modules/Applications/AppTest/app/otbTestApplication.cxx @@ -102,9 +102,6 @@ private: AddChoice("cl.choice2", "Choice2"); MandatoryOff("cl"); - AddParameter(ParameterType_ComplexInputImage, "cin", "Input Complex Image"); - AddParameter(ParameterType_ComplexOutputImage, "cout", "Output Complex Image"); - // Doc example parameter settings SetDocExampleParameterValue("boolean", "true"); SetDocExampleParameterValue("filename", "myFilename.foo"); @@ -135,11 +132,6 @@ private: otbAppLogFATAL("Waiting at least one input image"); } - SetParameterComplexOutputImage( - "cout", - GetParameterComplexImage( "cin" ) - ); - PrintStrings( "fl" ); } diff --git a/Modules/Visualization/MonteverdiGui/src/mvdQtWidgetView.cxx b/Modules/Visualization/MonteverdiGui/src/mvdQtWidgetView.cxx index dab9d9b88a..950c04c001 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdQtWidgetView.cxx +++ b/Modules/Visualization/MonteverdiGui/src/mvdQtWidgetView.cxx @@ -282,13 +282,6 @@ QtWidgetView ->GetFileName(); break; // - // COMPLEX IMAGE. - case otb::Wrapper::ParameterType_ComplexOutputImage: - filename = - otb::DynamicCast< otb::Wrapper::ComplexOutputImageParameter >( param ) - ->GetFileName(); - break; - // // NONE. default: break; diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h b/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h index 89d89cb94b..d53f70c266 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h @@ -33,8 +33,6 @@ #include "otbWrapperInputImageParameter.h" #include "otbWrapperInputImageListParameter.h" #include "otbWrapperOutputImageParameter.h" -#include "otbWrapperComplexInputImageParameter.h" -#include "otbWrapperComplexOutputImageParameter.h" #include "otbWrapperDocExampleStructure.h" #include "itkMersenneTwisterRandomVariateGenerator.h" #include "OTBApplicationEngineExport.h" @@ -261,7 +259,6 @@ public: * \li ParameterType_Int * \li ParameterType_Radius * \li ParameterType_InputImageParameter - * \li ParameterType_ComplexInputImageParameter * \li ParameterType_InputVectorDataParameter * \li ParameterType_OutputImageParameter * \li ParameterType_OutputVectorDataParameter @@ -397,13 +394,6 @@ public: */ void SetParameterOutputImage(std::string parameter, FloatVectorImageType* value); - /* Set a complex output image value - * - * Can be called for types : - * \li ParameterType_ComplexOutputImage - */ - void SetParameterComplexOutputImage(std::string parameter, ComplexFloatVectorImageType* value); - /* Set the pixel type in which the image will be saved * * Can be called for types : @@ -411,13 +401,6 @@ public: */ void SetParameterOutputImagePixelType(std::string parameter, ImagePixelType pixelType); - /* Set the complex pixel type in which the image will be saved - * - * Can be called for types : - * \li ParameterType_ComplexOutputImage - */ - void SetParameterComplexOutputImagePixelType(std::string parameter, ComplexImagePixelType cpixelType); - /* Set an output vector data value * * Can be called for types : @@ -451,7 +434,6 @@ public: * \li ParameterType_OutputFilename * \li ParameterType_Directory * \li ParameterType_InputImage - * \li ParameterType_ComplexInputImage * \li ParameterType_InputVectorData * \li ParameterType_OutputImage * \li ParameterType_OutputVectorData @@ -498,28 +480,6 @@ public: */ ImageBaseType * GetParameterOutputImage(std::string parameter); - /** - * Set the input complex image parameter as an ImageBase * instead - * of filename. Useful to connect pipelines between different - * application instances. - * \in parameter The parameter key - * \in inputImage ImageBase pointer to use as input - * \throw itk::Exception if parameter is not found or not an - * ComplexInputImageParameter - */ - void SetParameterComplexInputImage(std::string parameter, ImageBaseType * inputImage); - - /** - * Get the complex output image parameter as an ImageBase * instead - * of writing to disk. Useful to connect pipelines between different - * application instances. - * \in parameter The parameter key - * \return The ImageBase * pointer to the output image - * \throw itk::Exception if parameter is not found or not an - * ComplexOutputImageParameter - */ - ImageBaseType * GetParameterComplexOutputImage(std::string parameter); - /** * Add an image to an InputImageList parameter as an ImageBase * pointer instead of reading from file. Useful to connect pipelines @@ -633,13 +593,6 @@ public: */ FloatVectorImageListType* GetParameterImageList(std::string parameter); - /* Get a complex image value - * - * Can be called for types : - * \li ParameterType_ComplexInputImage - */ - ComplexFloatVectorImageType* GetParameterComplexImage(std::string parameter); - /* GetParameterVectorData * * Can be called for types : @@ -668,7 +621,6 @@ public: * \li ParameterType_OutputFilename * \li ParameterType_Directory * \li ParameterType_InputImage - * \li ParameterType_ComplexInputImage * \li ParameterType_InputVectorData * \li ParameterType_OutputImage * \li ParameterType_OutputVectorData @@ -691,13 +643,6 @@ public: m_ParameterList = paramGroup; } - /* Get the pixel type in which the complex image will be saved - * - * Can be called for types : - * \li ParameterType_ComplexOutputImage - */ - ComplexImagePixelType GetParameterComplexOutputImagePixelType(std::string parameter); - otb::Logger* GetLogger() const; /** Sets the logger instance of the application (use with caution) */ @@ -807,8 +752,6 @@ public: * \li ParameterType_InputImage * \li ParameterType_InputImageList * \li ParameterType_OutputImage - * \li ParameterType_ComplexInputImage - * \li ParameterType_ComplexOutputImage */ ImageBaseType* GetParameterImageBase(const std::string & key, unsigned int idx = 0); @@ -818,7 +761,6 @@ public: * Works on parameters: * \li ParameterType_InputImage * \li ParameterType_InputImageList - * \li ParameterType_ComplexInputImage */ void SetParameterImageBase(const std::string & key, ImageBaseType* img, unsigned int idx = 0); @@ -947,23 +889,6 @@ protected: } } - /* Set a complex output image value - * - * Can be called for types : - * \li ParameterType_ComplexOutputImage - */ - template <class TImageType> - void SetParameterComplexOutputImage(std::string parameter, TImageType* value) - { - Parameter* param = GetParameterByKey(parameter); - - if (dynamic_cast<ComplexOutputImageParameter*>(param)) - { - ComplexOutputImageParameter* paramDown = dynamic_cast<ComplexOutputImageParameter*>(param); - paramDown->SetValue(value); - } - } - private: /* Implement this method to add parameters */ virtual void DoInit() = 0; diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexInputImageParameter.h b/Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexInputImageParameter.h deleted file mode 100644 index f3ea009fa8..0000000000 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexInputImageParameter.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (C) 2005-2019 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. - */ - -#ifndef otbWrapperComplexInputImageParameter_h -#define otbWrapperComplexInputImageParameter_h - -#include "otbImageFileReader.h" -#include "itkImageBase.h" -#include "otbWrapperParameter.h" -#include <string> - -namespace otb -{ -namespace Wrapper -{ -/** \class ComplexInputImageParameter - * \brief This class represents a ComplexInputImage parameter - * - * \ingroup OTBApplicationEngine - */ - -class OTBApplicationEngine_EXPORT ComplexInputImageParameter : public Parameter -{ -public: - /** Standard class typedef */ - typedef ComplexInputImageParameter Self; - typedef Parameter Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - /** Defining ::New() static method */ - itkNewMacro(Self); - - /** RTTI support */ - itkTypeMacro(ComplexInputImageParameter, Parameter); - - /** Set value from filename */ - bool SetFromFileName(const std::string& filename); - itkGetConstMacro(FileName, std::string); - - /** Get the input image as CFloatVectorImageType. */ - ComplexFloatVectorImageType* GetImage(); - - /** Get the input image as XXXImageType */ - ComplexInt16ImageType* GetComplexInt16Image(); - ComplexInt32ImageType* GetComplexInt32Image(); - ComplexFloatImageType* GetComplexFloatImage(); - ComplexDoubleImageType* GetComplexDoubleImage(); - - ComplexInt16VectorImageType* GetComplexInt16VectorImage(); - ComplexInt32VectorImageType* GetComplexInt32VectorImage(); - ComplexFloatVectorImageType* GetComplexFloatVectorImage(); - ComplexDoubleVectorImageType* GetComplexDoubleVectorImage(); - -/* Support for ComplexInputImageParameter. This has been done to support -the macro otbGetParameterImageMacro of otbWrapperApplication.h */ - UInt8ImageType* GetUInt8Image(); - UInt16ImageType* GetUInt16Image(); - Int16ImageType* GetInt16Image(); - UInt32ImageType* GetUInt32Image(); - Int32ImageType* GetInt32Image(); - FloatImageType* GetFloatImage(); - DoubleImageType* GetDoubleImage(); - - UInt8VectorImageType* GetUInt8VectorImage(); - UInt16VectorImageType* GetUInt16VectorImage(); - Int16VectorImageType* GetInt16VectorImage(); - UInt32VectorImageType* GetUInt32VectorImage(); - Int32VectorImageType* GetInt32VectorImage(); - FloatVectorImageType* GetFloatVectorImage(); - DoubleVectorImageType* GetDoubleVectorImage(); - - UInt8RGBImageType* GetUInt8RGBImage(); - UInt8RGBAImageType* GetUInt8RGBAImage(); - - /** Get the input image as templated image type. */ - template <class TImageType> - TImageType* GetImage(); - - /** Set a FloatVectorImageType image.*/ - void SetImage(ComplexFloatVectorImageType* image); - - /** Set a templated image.*/ - template <class TImageType> - void SetImage(TImageType* image); - - /** Generic cast method that will be specified for each image type. */ - template <class TComplexInputImage, class TOutputImage> - TOutputImage* CastImage(); - - bool HasValue() const override; - void ClearValue() override; - - ParameterType GetType() const override; - std::string ToString() const override; - void FromString(const std::string& value) override; - -protected: - /** Constructor */ - ComplexInputImageParameter(); - - /** Destructor */ - ~ComplexInputImageParameter() override; - - ImageBaseType::Pointer m_Image; - std::string m_FileName; - - - /** Readers typedefs */ - typedef otb::ImageFileReader<ComplexFloatVectorImageType> ComplexFloatVectorReaderType; - typedef otb::ImageFileReader<ComplexDoubleVectorImageType> ComplexDoubleVectorReaderType; - - itk::ProcessObject::Pointer m_Reader; - itk::ProcessObject::Pointer m_Caster; - -private: - ComplexInputImageParameter(const Parameter &) = delete; - void operator =(const Parameter&) = delete; - - /** Store the loaded image filename */ - std::string m_PreviousFileName; - - /** flag : are we using a filename or an image pointer as an input */ - bool m_UseFilename; - -}; // End class ComplexInputImage Parameter - -} // End namespace Wrapper -} // End namespace otb - -#ifndef OTB_MANUAL_INSTANTIATION -#include "otbWrapperComplexInputImageParameter.hxx" -#endif - -#endif diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexInputImageParameter.hxx b/Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexInputImageParameter.hxx deleted file mode 100644 index 4fe0399d2a..0000000000 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexInputImageParameter.hxx +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (C) 2005-2019 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. - */ - -#ifndef otbWrapperComplexInputImageParameter_hxx -#define otbWrapperComplexInputImageParameter_hxx - -#include "otbWrapperComplexInputImageParameter.h" -#include "otbClampImageFilter.h" - -namespace otb -{ -namespace Wrapper -{ - - -template <class TOutputImage> -TOutputImage * -ComplexInputImageParameter::GetImage() -{ - // Used m_PreviousFileName because if not, when the user call twice GetImage, - // it without changing the filename, it returns 2 different - // image pointers - // Only one image type can be used - - // 2 cases : the user set a filename vs. the user set an image - if (m_UseFilename) - { - if( m_PreviousFileName!=m_FileName && !m_FileName.empty() ) - { - //////////////////////// Filename case: - // A new valid filename has been given : a reader is created - typedef otb::ImageFileReader<TOutputImage> ReaderType; - typename ReaderType::Pointer reader = ReaderType::New(); - reader->SetFileName(m_FileName); - reader->UpdateOutputInformation(); - - m_Image = reader->GetOutput(); - m_Reader = reader; - m_PreviousFileName = m_FileName; - - // Pay attention, don't return m_Image because it is a ImageBase... - return reader->GetOutput(); - } - else - { - // In this case, the reader and the image should already be there - if (m_Image.IsNull()) - { - itkExceptionMacro("No input image or filename detected..."); - } - else - { - // Check if the image type asked here is the same as the one used for the reader - if (dynamic_cast<TOutputImage*> (m_Image.GetPointer())) - { - return dynamic_cast<TOutputImage*> (m_Image.GetPointer()); - } - else - { - itkExceptionMacro("Cannot ask a different image type"); - } - } - } - } - else - { - //////////////////////// Image case: - if( m_Image.IsNull() ) - { - itkExceptionMacro("No input image or filename detected..."); - } - else - { - if (dynamic_cast<ComplexInt16VectorImageType*>(m_Image.GetPointer())) - { - return CastImage<ComplexInt16VectorImageType, TOutputImage>(); - } - else if (dynamic_cast<ComplexInt32VectorImageType*>(m_Image.GetPointer())) - { - return CastImage<ComplexInt32VectorImageType, TOutputImage>(); - } - else if (dynamic_cast<ComplexFloatVectorImageType*>(m_Image.GetPointer())) - { - return CastImage<ComplexFloatVectorImageType, TOutputImage>(); - } - else if (dynamic_cast<ComplexDoubleVectorImageType*>(m_Image.GetPointer())) - { - return CastImage<ComplexDoubleVectorImageType, TOutputImage>(); - } - else if (dynamic_cast<ComplexInt16ImageType*>(m_Image.GetPointer())) - { - return CastImage<ComplexInt16ImageType, TOutputImage>(); - } - else if (dynamic_cast<ComplexInt32ImageType*>(m_Image.GetPointer())) - { - return CastImage<ComplexInt32ImageType, TOutputImage>(); - } - else if (dynamic_cast<ComplexFloatImageType*>(m_Image.GetPointer())) - { - return CastImage<ComplexFloatImageType, TOutputImage>(); - } - else if (dynamic_cast<ComplexDoubleImageType*>(m_Image.GetPointer())) - { - return CastImage<ComplexDoubleImageType, TOutputImage>(); - } - else - { - itkExceptionMacro("Unknown image type"); - } - } - } -} - -/** declare a specialization for ImageBaseType */ -template <> -ImageBaseType* -ComplexInputImageParameter::GetImage(); - -template <class TComplexInputImage, class TOutputImage> -TOutputImage* -ComplexInputImageParameter::CastImage() -{ - TComplexInputImage* realComplexInputImage = dynamic_cast<TComplexInputImage*>(m_Image.GetPointer()); - - typedef ClampImageFilter<TComplexInputImage, TOutputImage> CasterType; - typename CasterType::Pointer caster = CasterType::New(); - - caster->SetInput(realComplexInputImage); - caster->UpdateOutputInformation(); - - m_Image = caster->GetOutput(); - m_Caster = caster; - - return caster->GetOutput(); - // itkExceptionMacro("Cast from "<<typeid(TComplexInputImage).name() - // <<" to "<<typeid(TOutputImage).name()<<" not authorized."); -} - -template <class TComplexInputImage> -void -ComplexInputImageParameter::SetImage(TComplexInputImage* image) -{ - m_UseFilename = false; - m_Image = image; -} - - - -} // End namespace Wrapper -} // End namespace otb - -#endif diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexOutputImageParameter.h b/Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexOutputImageParameter.h deleted file mode 100644 index 2e527855aa..0000000000 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexOutputImageParameter.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (C) 2005-2019 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. - */ - -#ifndef otbWrapperComplexOutputImageParameter_h -#define otbWrapperComplexOutputImageParameter_h - -#include "itkImageBase.h" -#include "otbWrapperParameter.h" -#include "otbImageFileWriter.h" -#include <string> - -namespace otb -{ -namespace Wrapper -{ -/** \class ComplexOutputImageParameter - * \brief This class represents a ComplexOutputImage parameter - * - * \ingroup OTBApplicationEngine - */ - -class OTBApplicationEngine_EXPORT ComplexOutputImageParameter : public Parameter -{ -public: - /** Standard class typedef */ - typedef ComplexOutputImageParameter Self; - typedef Parameter Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - /** Defining ::New() static method */ - itkNewMacro(Self); - - /** RTTI support */ - itkTypeMacro(ComplexOutputImageParameter, Parameter); - - /** Set the value */ - itkSetObjectMacro(Image, ImageBaseType); - - /** Get the value */ - itkGetObjectMacro(Image, ImageBaseType); - - /** Return any value */ - void SetValue(ImageBaseType* image); - - /** Return any value */ - ImageBaseType* GetValue( void ); - - /** Set/Get m_ComplexPixelType to be used when saving */ - itkSetMacro(ComplexPixelType, ComplexImagePixelType); - itkGetMacro(ComplexPixelType, ComplexImagePixelType); - - /** Set/Get m_DefaultComplexPixelType*/ - itkSetMacro(DefaultComplexPixelType, ComplexImagePixelType); - itkGetMacro(DefaultComplexPixelType, ComplexImagePixelType); - - /** Set/Get available RAM value */ - itkSetMacro(RAMValue, unsigned int); - itkGetMacro(RAMValue, unsigned int); - - /** Implement the reset method (replace pixel type by default type) */ - void Reset() override - { - m_ComplexPixelType = m_DefaultComplexPixelType; - } - - /** Static method to convert pixel type into string */ - static std::string ConvertPixelTypeToString(ComplexImagePixelType type); - - /** Convert a string into a ComplexImagePixelType (returns false if the - * conversion fails) */ - static bool ConvertStringToPixelType(const std::string &value, ComplexImagePixelType &type); - - /** Return true if a filename is set */ - bool HasValue() const override; - - void SetFileName (const char* filename); - void SetFileName (const std::string& filename); - - itkGetStringMacro(FileName); - - void Write(); - - itk::ProcessObject* GetWriter(); - - void InitializeWriters(); - - ParameterType GetType() const override; - std::string ToString() const override; - void FromString(const std::string& value) override; - -protected: - /** Constructor */ - ComplexOutputImageParameter(); - /** Destructor */ - ~ComplexOutputImageParameter() override; - - template <class TInputImageType> - void SwitchImageWrite(); - - template <class TInputVectorImageType> - void SwitchVectorImageWrite(); - - ImageBaseType::Pointer m_Image; - std::string m_FileName; - ComplexImagePixelType m_ComplexPixelType; - ComplexImagePixelType m_DefaultComplexPixelType; - - typedef otb::ImageFileWriter<ComplexInt16VectorImageType> ComplexVectorInt16WriterType; - typedef otb::ImageFileWriter<ComplexInt32VectorImageType> ComplexVectorInt32WriterType; - typedef otb::ImageFileWriter<ComplexFloatVectorImageType> ComplexVectorFloatWriterType; - typedef otb::ImageFileWriter<ComplexDoubleVectorImageType> ComplexVectorDoubleWriterType; - - ComplexVectorInt16WriterType::Pointer m_ComplexVectorInt16Writer; - ComplexVectorInt32WriterType::Pointer m_ComplexVectorInt32Writer; - ComplexVectorFloatWriterType::Pointer m_ComplexVectorFloatWriter; - ComplexVectorDoubleWriterType::Pointer m_ComplexVectorDoubleWriter; - - -private: - ComplexOutputImageParameter(const Parameter &) = delete; - void operator =(const Parameter&) = delete; - - unsigned int m_RAMValue; - -}; // End class OutputImage Parameter - -} // End namespace Wrapper -} // End namespace otb - -#endif diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperTypes.h b/Modules/Wrappers/ApplicationEngine/include/otbWrapperTypes.h index 8418f0fb2f..206eb0716d 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperTypes.h +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperTypes.h @@ -54,8 +54,6 @@ typedef enum ParameterType_Radius, ParameterType_Group, ParameterType_ListView, - ParameterType_ComplexInputImage, - ParameterType_ComplexOutputImage, ParameterType_RAM, ParameterType_OutputProcessXML, ParameterType_InputProcessXML, @@ -84,8 +82,6 @@ constexpr char const* parameterTypesStrings [] = { "Radius", "Group", "ListView", - "ComplexInputImage", - "ComplexOutputImage", "RAM", "OutputProcessXML", "InputProcessXML", diff --git a/Modules/Wrappers/ApplicationEngine/src/CMakeLists.txt b/Modules/Wrappers/ApplicationEngine/src/CMakeLists.txt index a25d98d3ff..d298482c06 100644 --- a/Modules/Wrappers/ApplicationEngine/src/CMakeLists.txt +++ b/Modules/Wrappers/ApplicationEngine/src/CMakeLists.txt @@ -20,10 +20,8 @@ set( OTBApplicationEngine_SRC otbWrapperApplicationHtmlDocGenerator.cxx - otbWrapperComplexOutputImageParameter.cxx otbWrapperInputVectorDataListParameter.cxx otbWrapperListViewParameter.cxx - otbWrapperComplexInputImageParameter.cxx otbWrapperParameterGroup.cxx otbWrapperOutputProcessXMLParameter.cxx otbWrapperInputImageListParameter.cxx diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx index 7287782f61..8c0d624ae5 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx @@ -790,25 +790,6 @@ int Application::ExecuteAndWriteOutput() outputParam->Write(); } } - else if (GetParameterType(key) == ParameterType_ComplexOutputImage - && IsParameterEnabled(key) && HasValue(key) ) - { - Parameter* param = GetParameterByKey(key); - ComplexOutputImageParameter* outputParam = dynamic_cast<ComplexOutputImageParameter*>(param); - - if(outputParam!=nullptr) - { - outputParam->InitializeWriters(); - if (useRAM) - { - outputParam->SetRAMValue(ram); - } - std::ostringstream progressId; - progressId << "Writing " << outputParam->GetFileName() << "..."; - AddProcess(outputParam->GetWriter(), progressId.str()); - outputParam->Write(); - } - } //xml writer parameter else if (m_HaveOutXML && GetParameterType(key) == ParameterType_OutputProcessXML && IsParameterEnabled(key) && HasValue(key) ) @@ -1055,13 +1036,6 @@ void Application::SetDefaultOutputPixelType(std::string key, ImagePixelType type param->SetPixelType(type); } -void Application::SetDefaultOutputComplexPixelType(std::string key, ComplexImagePixelType type) -{ - auto param = downcast_check<ComplexOutputImageParameter>(GetParameterByKey(key)); - param->SetDefaultComplexPixelType(type); - param->SetComplexPixelType(type); -} - void Application::SetMinimumParameterIntValue(std::string key, int value) { auto param = downcast_check<IntParameter>(GetParameterByKey(key)); @@ -1104,24 +1078,12 @@ void Application::SetParameterOutputImage(std::string key, FloatVectorImageType* param->SetValue(value); } -void Application::SetParameterComplexOutputImage(std::string key, ComplexFloatVectorImageType* value) -{ - auto param = downcast_check<ComplexOutputImageParameter>(GetParameterByKey(key)); - param->SetValue(value); -} - void Application::SetParameterOutputImagePixelType(std::string key, ImagePixelType pixelType) { auto param = downcast_check<OutputImageParameter>(GetParameterByKey(key)); param->SetPixelType(pixelType); } -void Application::SetParameterComplexOutputImagePixelType(std::string key, ComplexImagePixelType cpixelType) -{ - auto param = downcast_check<ComplexOutputImageParameter>(GetParameterByKey(key)); - param->SetComplexPixelType(cpixelType); -} - void Application::SetParameterOutputVectorData(std::string key, VectorDataType* value) { auto param = downcast_check<OutputVectorDataParameter>(GetParameterByKey(key)); @@ -1181,18 +1143,6 @@ ImageBaseType* Application::GetParameterOutputImage(std::string key) return param->GetValue(); } -void Application::SetParameterComplexInputImage(std::string key, ImageBaseType* inputImage) -{ - auto param = downcast_check<ComplexInputImageParameter>(GetParameterByKey(key)); - param->SetImage(inputImage); -} - -ImageBaseType* Application::GetParameterComplexOutputImage(std::string key) -{ - auto param = downcast_check<ComplexOutputImageParameter>(GetParameterByKey(key)); - return param->GetValue(); -} - void Application::AddImageToParameterInputImageList(std::string key, ImageBaseType* img) { auto param = downcast_check<InputImageListParameter>(GetParameterByKey(key)); @@ -1240,12 +1190,6 @@ FloatVectorImageListType* Application::GetParameterImageList(std::string key) return param->GetImageList(); } -ComplexFloatVectorImageType* Application::GetParameterComplexImage(std::string key) -{ - auto param = downcast_check<ComplexInputImageParameter>(GetParameterByKey(key)); - return param->GetImage(); -} - VectorDataType* Application::GetParameterVectorData(std::string key) { auto param = downcast_check<InputVectorDataParameter>(GetParameterByKey(key)); @@ -1269,12 +1213,6 @@ ImagePixelType Application::GetParameterOutputImagePixelType(std::string key) return param->GetPixelType(); } -ComplexImagePixelType Application::GetParameterComplexOutputImagePixelType(std::string key) -{ - auto param = downcast_check<ComplexOutputImageParameter>(GetParameterByKey(key)); - return param->GetComplexPixelType(); -} - void Application::AddChoice(std::string paramKey, std::string paramName) { @@ -1555,26 +1493,15 @@ Application::GetParameterImageBase(const std::string & key, unsigned int idx) InputImageListParameter* paramDown = dynamic_cast<InputImageListParameter*>(param); return paramDown->GetNthImage(idx); } - else if (dynamic_cast<ComplexInputImageParameter*>(param)) - { - ComplexInputImageParameter* paramDown = dynamic_cast<ComplexInputImageParameter*>(param); - return paramDown->GetImage<ImageBaseType>(); - } else if (dynamic_cast<OutputImageParameter*>(param)) { OutputImageParameter* paramDown = dynamic_cast<OutputImageParameter*>(param); return paramDown->GetValue(); } - else if (dynamic_cast<ComplexOutputImageParameter*>(param)) - { - ComplexOutputImageParameter* paramDown = dynamic_cast<ComplexOutputImageParameter*>(param); - return paramDown->GetValue(); - } else { itkExceptionMacro("Wrong parameter type, expect InputImageParameter, " - "InputImageListParameter, ComplexInputImageParameter, " - "OutputImageParameter, ComplexOutputImageParameter"); + "InputImageListParameter or OutputImageParameter"); } return nullptr; } @@ -1600,14 +1527,9 @@ Application::SetParameterImageBase(const std::string & key, ImageBaseType* img, paramDown->SetNthImage(idx, img); } } - else if (dynamic_cast<ComplexInputImageParameter*>(param)) - { - ComplexInputImageParameter* paramDown = dynamic_cast<ComplexInputImageParameter*>(param); - paramDown->SetImage<ImageBaseType>(img); - } else { - itkExceptionMacro("Wrong parameter type, expect InputImageParameter, InputImageListParameter or ComplexInputImageParameter"); + itkExceptionMacro("Wrong parameter type, expect InputImageParameter or InputImageListParameter"); } } @@ -1674,11 +1596,6 @@ Application::GetImageBasePixelType(const std::string & key, unsigned int idx) { \ return paramDown->Get##Image(); \ } \ - ComplexInputImageParameter* paramDownC = dynamic_cast<ComplexInputImageParameter*>(param); \ - if ( paramDownC ) \ - { \ - return paramDownC->Get##Image(); \ - } \ return Image##Type::Pointer(); \ } diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexInputImageParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexInputImageParameter.cxx deleted file mode 100644 index e118b270b7..0000000000 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexInputImageParameter.cxx +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (C) 2005-2019 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 "otbWrapperComplexInputImageParameter.h" -#include "itksys/SystemTools.hxx" -#include "otbWrapperTypes.h" - - -namespace otb -{ -namespace Wrapper -{ - -ComplexInputImageParameter::ComplexInputImageParameter() -{ - this->SetName("Complex Input Image"); - this->SetKey("cin"); - m_FileName=""; - m_PreviousFileName=""; - m_UseFilename = true; - this->ClearValue(); -} - -ComplexInputImageParameter::~ComplexInputImageParameter() -{ -} - -bool -ComplexInputImageParameter::SetFromFileName(const std::string& filename) -{ - // First clear previous file chosen - this->ClearValue(); - - // No file existence is done here : - // - Done in the reader - // - allow appending additional information to the filename - // myfile.tif:2 for example, or myfile.tif:nocarto - m_FileName = filename; - m_UseFilename = true; - SetActive(true); - return true; -} - - -ComplexFloatVectorImageType* -ComplexInputImageParameter::GetImage() -{ - return this->GetImage<ComplexFloatVectorImageType>(); -} - -template <> -ImageBaseType* -ComplexInputImageParameter::GetImage() -{ - if (m_Image.IsNull()) - return this->GetImage<ComplexFloatVectorImageType>(); - - return m_Image; -} - -#define otbGetImageMacro(image) \ - image##Type * \ - ComplexInputImageParameter::Get##image () \ - { \ - return this->GetImage< image##Type > (); \ - } - -otbGetImageMacro(ComplexInt16Image); -otbGetImageMacro(ComplexInt32Image); -otbGetImageMacro(ComplexFloatImage); -otbGetImageMacro(ComplexDoubleImage); - -otbGetImageMacro(ComplexInt16VectorImage); -otbGetImageMacro(ComplexInt32VectorImage); -otbGetImageMacro(ComplexFloatVectorImage); -otbGetImageMacro(ComplexDoubleVectorImage); - - -/*#define otbCastImageMacro(ComplexInputImageType, OutputImageType, theMethod) \ - template<> OutputImageType * \ - ComplexInputImageParameter::CastImage<ComplexInputImageType , OutputImageType>() \ - { \ - return this->theMethod<ComplexInputImageType , OutputImageType>(); \ - } - -#define otbGenericCastImageMacro(ComplexInputImageType, theMethod, prefix) \ - otbCastImageMacro(ComplexInputImageType, ComplexFloat##prefix##ImageType, theMethod) \ - otbCastImageMacro(ComplexInputImageType, ComplexDouble##prefix##ImageType, theMethod)*/ - - -/******************************************************************** -********************** Image -> Image -*********************************************************************/ - -// otbGenericCastImageMacro(ComplexFloatImageType, SimpleCastImage, ) -// otbGenericCastImageMacro(ComplexDoubleImageType, SimpleCastImage, ) - - -/********************************************************************* -********************** VectorImage -> VectorImage -**********************************************************************/ -// otbGenericCastImageMacro(ComplexFloatVectorImageType, SimpleCastImage, Vector) -// otbGenericCastImageMacro(ComplexDoubleVectorImageType, SimpleCastImage, Vector) - - void -ComplexInputImageParameter::SetImage(ComplexFloatVectorImageType* image) -{ - m_UseFilename = false; - this->SetImage<ComplexFloatVectorImageType>( image ); -} - -bool -ComplexInputImageParameter::HasValue() const -{ - if( m_FileName.empty() && m_Image.IsNull() ) - return false; - else - return true; -} - -void -ComplexInputImageParameter::ClearValue() -{ - m_Image = nullptr; - m_Reader = nullptr; - m_Caster = nullptr; - m_FileName = ""; - m_PreviousFileName=""; - m_UseFilename = true; -} - -ParameterType ComplexInputImageParameter::GetType() const -{ - return ParameterType_ComplexInputImage; -} - -std::string ComplexInputImageParameter::ToString() const -{ - return GetFileName(); -} - -void ComplexInputImageParameter::FromString(const std::string& value) -{ - SetFromFileName(value); -} - -/* Support for ComplexInputImageParameter. This has been done to support -the macro otbGetParameterImageMacro of otbWrapperApplication.h */ -#define otbGetFalseImageMacro(image) \ - image##Type * \ - ComplexInputImageParameter::Get##image () \ - { \ - return nullptr; \ - } - -otbGetFalseImageMacro(DoubleImage); -otbGetFalseImageMacro(DoubleVectorImage); - -otbGetFalseImageMacro(FloatImage); -otbGetFalseImageMacro(FloatVectorImage); - -otbGetFalseImageMacro(Int16Image); -otbGetFalseImageMacro(Int16VectorImage); - -otbGetFalseImageMacro(UInt16Image); -otbGetFalseImageMacro(UInt16VectorImage); - -otbGetFalseImageMacro(Int32Image); -otbGetFalseImageMacro(Int32VectorImage); - -otbGetFalseImageMacro(UInt32Image); -otbGetFalseImageMacro(UInt32VectorImage); - -otbGetFalseImageMacro(UInt8Image); -otbGetFalseImageMacro(UInt8VectorImage); - -otbGetFalseImageMacro(UInt8RGBImage); -otbGetFalseImageMacro(UInt8RGBAImage); - -} -} - diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexOutputImageParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexOutputImageParameter.cxx deleted file mode 100644 index 35ea2a050a..0000000000 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexOutputImageParameter.cxx +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Copyright (C) 2005-2019 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 "otbWrapperComplexOutputImageParameter.h" -#include "otbClampImageFilter.h" - -#ifdef OTB_USE_MPI - -#include "otbMPIConfig.h" -#include "otbMPIVrtWriter.h" - -#ifdef OTB_USE_SPTW -#include "otbSimpleParallelTiffWriter.h" -#endif - -#endif - - -namespace otb -{ -namespace Wrapper -{ - -ComplexOutputImageParameter::ComplexOutputImageParameter() - : m_ComplexPixelType(ComplexImagePixelType_float), - m_DefaultComplexPixelType(ComplexImagePixelType_float), - m_RAMValue(0) -{ - this->SetName("Complex Output Image"); - this->SetKey("cout"); -} - -ComplexOutputImageParameter::~ComplexOutputImageParameter() -{ -} - -std::string -ComplexOutputImageParameter::ConvertPixelTypeToString(ComplexImagePixelType type) -{ - std::string ret; - switch(type) - { - case ComplexImagePixelType_int16: - { - ret = "cint16"; - break; - } - case ComplexImagePixelType_int32: - { - ret = "cint32"; - break; - } - case ComplexImagePixelType_float: - { - ret = "cfloat"; - break; - } - case ComplexImagePixelType_double: - { - ret = "cdouble"; - break; - } - } - return ret; -} - -bool -ComplexOutputImageParameter::ConvertStringToPixelType(const std::string &value, ComplexImagePixelType &type) -{ - if (value == "cint16") - type = ComplexImagePixelType_int16; - if (value == "cint32") - type = ComplexImagePixelType_int32; - else if (value == "cfloat") - type = ComplexImagePixelType_float; - else if (value == "cdouble") - type = ComplexImagePixelType_double; - else - return false; - return true; -} - -void ComplexOutputImageParameter::InitializeWriters() -{ - m_ComplexVectorInt16Writer = ComplexVectorInt16WriterType::New(); - m_ComplexVectorInt32Writer = ComplexVectorInt32WriterType::New(); - m_ComplexVectorFloatWriter = ComplexVectorFloatWriterType::New(); - m_ComplexVectorDoubleWriter = ComplexVectorDoubleWriterType::New(); -} - -template <typename TInput, typename TOutput> void CastAndWriteImage(itk::ImageBase<2> * in, otb::ImageFileWriter<TOutput> * writer, const std::string & filename, const unsigned int & ramValue) -{ - typedef ClampImageFilter<TInput, TOutput> ClampFilterType; - typename ClampFilterType::Pointer clampFilter = ClampFilterType::New(); - clampFilter->SetInput( dynamic_cast<TInput*>(in)); - - bool useStandardWriter = true; - - #ifdef OTB_USE_MPI - - otb::MPIConfig::Pointer mpiConfig = otb::MPIConfig::Instance(); - - if (mpiConfig->GetNbProcs() > 1) - { - useStandardWriter = false; - - // Get file extension - std::string extension = itksys::SystemTools::GetFilenameExtension(filename); - - if(extension == ".vrt") - { - // Use the WriteMPI function - WriteMPI(clampFilter->GetOutput(),filename,ramValue); - } - #ifdef OTB_USE_SPTW - else if (extension == ".tif") - { - // Use simple parallel tiff writer - typedef otb::SimpleParallelTiffWriter<TOutput> SPTWriterType; - - typename SPTWriterType::Pointer sptWriter = SPTWriterType::New(); - sptWriter->SetFileName(filename); - sptWriter->SetInput(clampFilter->GetOutput()); - sptWriter->SetAutomaticAdaptativeStreaming(ramValue); - sptWriter->Update(); - } - - #endif - else - { - itkGenericExceptionMacro("File format "<<extension<<" not supported for parallel writing with MPI. Supported formats are .vrt and .tif. Extended filenames are not supported."); - } - - } - - #endif - - if(useStandardWriter) - { - - writer->SetFileName( filename ); - writer->SetInput(clampFilter->GetOutput()); - writer->SetAutomaticAdaptativeStreaming(ramValue); - writer->Update(); - } -} - -template <class TInputImageType> -void -ComplexOutputImageParameter::SwitchImageWrite() -{ - switch(m_ComplexPixelType ) - { - case ComplexImagePixelType_int16: - { - CastAndWriteImage<TInputImageType,ComplexInt16VectorImageType>( - m_Image , - m_ComplexVectorInt16Writer , - m_FileName , - m_RAMValue ); - break; - } - case ComplexImagePixelType_int32: - { - CastAndWriteImage<TInputImageType,ComplexInt32VectorImageType>( - m_Image , - m_ComplexVectorInt32Writer , - m_FileName , - m_RAMValue ); - break; - } - case ComplexImagePixelType_float: - { - CastAndWriteImage<TInputImageType,ComplexFloatVectorImageType>( - m_Image , - m_ComplexVectorFloatWriter , - m_FileName , - m_RAMValue ); - break; - } - case ComplexImagePixelType_double: - { - CastAndWriteImage<TInputImageType,ComplexDoubleVectorImageType>( - m_Image , - m_ComplexVectorDoubleWriter , - m_FileName , - m_RAMValue ); - break; - } - } -} - -void -ComplexOutputImageParameter::Write() -{ - m_Image->UpdateOutputInformation(); - if (dynamic_cast<ComplexInt16ImageType*>(m_Image.GetPointer())) - { - SwitchImageWrite<ComplexInt16ImageType>(); - } - else if (dynamic_cast<ComplexInt16ImageType*>(m_Image.GetPointer())) - { - SwitchImageWrite<ComplexInt16ImageType>(); - } - else if (dynamic_cast<ComplexFloatImageType*>(m_Image.GetPointer())) - { - SwitchImageWrite<ComplexFloatImageType>(); - } - else if (dynamic_cast<ComplexDoubleImageType*>(m_Image.GetPointer())) - { - SwitchImageWrite<ComplexDoubleImageType>(); - } - else if (dynamic_cast<ComplexInt16VectorImageType*>(m_Image.GetPointer())) - { - SwitchImageWrite<ComplexInt16VectorImageType>(); - } - else if (dynamic_cast<ComplexInt32VectorImageType*>(m_Image.GetPointer())) - { - SwitchImageWrite<ComplexInt32VectorImageType>(); - } - else if (dynamic_cast<ComplexFloatVectorImageType*>(m_Image.GetPointer())) - { - SwitchImageWrite<ComplexFloatVectorImageType>(); - } - else if (dynamic_cast<ComplexDoubleVectorImageType*>(m_Image.GetPointer())) - { - SwitchImageWrite<ComplexDoubleVectorImageType>(); - } - else - { - itkExceptionMacro("Unknown complex image type"); - } - } - -itk::ProcessObject* -ComplexOutputImageParameter::GetWriter() -{ - itk::ProcessObject* writer = nullptr; - switch ( GetComplexPixelType() ) - { - case ComplexImagePixelType_int16: - { - writer = m_ComplexVectorInt16Writer; - break; - } - case ComplexImagePixelType_int32: - { - writer = m_ComplexVectorInt32Writer; - break; - } - case ComplexImagePixelType_float: - { - writer = m_ComplexVectorFloatWriter; - break; - } - case ComplexImagePixelType_double: - { - writer = m_ComplexVectorDoubleWriter; - break; - } - } - return writer; -} - -ImageBaseType* -ComplexOutputImageParameter::GetValue( ) -{ - return m_Image; -} - -void -ComplexOutputImageParameter::SetValue(ImageBaseType* image) -{ - m_Image = image; - SetActive(true); -} - -bool -ComplexOutputImageParameter::HasValue() const -{ - std::string filename(this->GetFileName()); - return !filename.empty(); -} - -void ComplexOutputImageParameter::SetFileName (const char* filename) -{ - this->SetFileName(std::string(filename)); -} - -void ComplexOutputImageParameter::SetFileName (const std::string& filename) -{ - m_FileName = filename; - SetActive(true); -} - -ParameterType ComplexOutputImageParameter::GetType() const -{ - return ParameterType_ComplexOutputImage; -} - -std::string ComplexOutputImageParameter::ToString() const -{ - return GetFileName(); -} - -void ComplexOutputImageParameter::FromString(const std::string& value) -{ - SetFileName(value); -} -} -} diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputProcessXMLParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputProcessXMLParameter.cxx index cae44be16b..44b76c6540 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputProcessXMLParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputProcessXMLParameter.cxx @@ -33,9 +33,7 @@ #include "otbWrapperStringListParameter.h" #include "otbWrapperInputImageParameter.h" #include "otbWrapperInputImageListParameter.h" -#include "otbWrapperComplexInputImageParameter.h" #include "otbWrapperOutputImageParameter.h" -#include "otbWrapperComplexOutputImageParameter.h" #include "itksys/SystemTools.hxx" #include "otbMacro.h" @@ -332,12 +330,6 @@ InputProcessXMLParameter::Read(Application::Pointer this_) GetPixelTypeFromString( pixelType ) ); } - else if (type == ParameterType_ComplexOutputImage) - { - ComplexOutputImageParameter* paramDown = dynamic_cast<ComplexOutputImageParameter*>(param); - if(paramDown!=nullptr) - paramDown->SetFileName(value); - } else if (type == ParameterType_Directory) { DirectoryParameter* paramDown = dynamic_cast<DirectoryParameter*>(param); @@ -369,15 +361,6 @@ InputProcessXMLParameter::Read(Application::Pointer this_) otbMsgDevMacro( << "InputImageFile saved in InputXML does not exists" ); } } - else if (type == ParameterType_ComplexInputImage) - { - if(itksys::SystemTools::FileExists(value)) - { - ComplexInputImageParameter* paramDown = dynamic_cast<ComplexInputImageParameter*>(param); - if(paramDown!=nullptr) - paramDown->SetFromFileName(value); - } - } else if (dynamic_cast<InputVectorDataParameter*>(param)) { if(itksys::SystemTools::FileExists(value)) diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputProcessXMLParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputProcessXMLParameter.cxx index 0cc21cebf0..eaaf8c7c30 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputProcessXMLParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputProcessXMLParameter.cxx @@ -33,9 +33,7 @@ #include "otbWrapperStringListParameter.h" #include "otbWrapperInputImageParameter.h" #include "otbWrapperInputImageListParameter.h" -#include "otbWrapperComplexInputImageParameter.h" #include "otbWrapperOutputImageParameter.h" -#include "otbWrapperComplexOutputImageParameter.h" #include "itksys/SystemTools.hxx" namespace otb @@ -283,9 +281,9 @@ OutputProcessXMLParameter::ParseGroup(const std::string& group) } else if ( type == ParameterType_String || type == ParameterType_InputFilename || type == ParameterType_Directory || type == ParameterType_InputImage || - type == ParameterType_ComplexInputImage || type == ParameterType_InputVectorData || - type == ParameterType_Choice || type == ParameterType_OutputVectorData || - type == ParameterType_OutputFilename || type == ParameterType_Bool) + type == ParameterType_InputVectorData || type == ParameterType_Choice || + type == ParameterType_OutputVectorData || type == ParameterType_OutputFilename || + type == ParameterType_Bool) { value = m_Appli->GetParameterString(key); } @@ -302,7 +300,7 @@ OutputProcessXMLParameter::ParseGroup(const std::string& group) //get only file name /* if(type == ParameterType_InputFilename || type == ParameterType_InputImage || - type == ParameterType_ComplexInputImage || type == ParameterType_InputVectorData || + type == ParameterType_InputVectorData || type == ParameterType_OutputVectorData || type == ParameterType_OutputFilename) { unsigned found = value.find_last_of("/\\"); @@ -337,7 +335,7 @@ OutputProcessXMLParameter::ParseGroup(const std::string& group) AddChildNodeTo(n_Parameter, "type", typeAsString); AddChildNodeTo(n_Parameter, "name", paramName); - if(type == ParameterType_OutputImage || type == ParameterType_ComplexOutputImage) + if(type == ParameterType_OutputImage) { AddChildNodeTo(n_Parameter, "pixtype", pixelTypeAsString); } diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperParameterGroup.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperParameterGroup.cxx index 0d312035ae..3a8ec354b5 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperParameterGroup.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperParameterGroup.cxx @@ -26,11 +26,9 @@ #include "otbWrapperInputFilenameListParameter.h" #include "otbWrapperOutputFilenameParameter.h" #include "otbWrapperOutputProcessXMLParameter.h" -#include "otbWrapperComplexInputImageParameter.h" #include "otbWrapperInputImageParameter.h" #include "otbWrapperInputVectorDataParameter.h" #include "otbWrapperOutputImageParameter.h" -#include "otbWrapperComplexOutputImageParameter.h" #include "otbWrapperOutputVectorDataParameter.h" #include "otbWrapperNumericalParameter.h" #include "otbWrapperStringListParameter.h" @@ -366,16 +364,6 @@ ParameterGroup::AddParameter(ParameterType type, std::string paramKey, std::stri newParam = ListViewParameter::New(); } break; - case ParameterType_ComplexInputImage: - { - newParam = ComplexInputImageParameter::New(); - } - break; - case ParameterType_ComplexOutputImage: - { - newParam = ComplexOutputImageParameter::New(); - } - break; case ParameterType_RAM: { newParam = RAMParameter::New(); -- GitLab