diff --git a/Applications/Test/otbTestApplication.cxx b/Applications/Test/otbTestApplication.cxx index df85ec3bf8fbe0b1d1d4b17ef0901c7e083f6bf0..7914ad9b5404156dbe9348f19ecc3c4f723b21a3 100644 --- a/Applications/Test/otbTestApplication.cxx +++ b/Applications/Test/otbTestApplication.cxx @@ -51,50 +51,52 @@ private: void DoCreateParameters() { std::cout << "TestApplication::DoCreateParameters" << std::endl; - AddParameter(ParameterType_Empty, "boolean", "Boolean"); - AddParameter(ParameterType_Int, "int", "Integer"); - MandatoryOff("int"); - AddParameter(ParameterType_Float, "float", "Float"); - MandatoryOff("float"); - AddParameter(ParameterType_String, "string", "String"); - AddParameter(ParameterType_Filename, "filename", "File name"); - AddParameter(ParameterType_Directory, "directory", "Directory name"); - - - AddParameter(ParameterType_Choice, "choice", "Choice"); - AddChoice("choice.choice1", "Choice 1"); - AddChoice("choice.choice2", "Choice 2"); - AddChoice("choice.choice3", "Choice 3"); - AddParameter(ParameterType_Float, "choice.choice1.floatchoice1", "Float of choice1"); - SetParameterFloat("choice.choice1.floatchoice1", 0.125); -// Test a choice without associated parameter -// AddParameter(ParameterType_Float, "choice.choice2.floatchoice2", "Float of choice2"); -// SetParameterFloat("choice.choice2.floatchoice2", 1.0); - AddParameter(ParameterType_Float, "choice.choice3.floatchoice3", "Float of choice3"); - SetParameterFloat("choice.choice3.floatchoice3", 5.0); - - - AddParameter(ParameterType_Group, "ingroup", "Input Group"); - MandatoryOff("ingroup"); - AddParameter(ParameterType_Float, "ingroup.integer", "Integer of Group"); - AddParameter(ParameterType_Group, "ingroup.images", "Input Images Group"); - AddParameter(ParameterType_InputImage, "ingroup.images.inputimage", "Input Image"); - //AddParameter(ParameterType_InputComplexImage, "ingroup.images.inputcompleximage", "Input Complex Image"); - //AddParameter(ParameterType_InputVectorData, "ingroup.inputvectordata", "Input Vector Data"); - - AddParameter(ParameterType_Group, "outgroup", "Output Group"); - AddParameter(ParameterType_OutputImage, "outgroup.outputimage", "Output Image"); - //AddParameter(ParameterType_OutputVectorData, "outgroup.outputvectordata", "Output Vector Data"); - - AddParameter(ParameterType_Radius, "radius", "Radius"); - - AddParameter(ParameterType_InputImageList, "il", "Input image list"); - MandatoryOff("il"); + //AddParameter(ParameterType_Empty, "boolean", "Boolean"); +// AddParameter(ParameterType_Int, "int", "Integer"); +// MandatoryOff("int"); +// AddParameter(ParameterType_Float, "float", "Float"); +// MandatoryOff("float"); +// AddParameter(ParameterType_String, "string", "String"); +// AddParameter(ParameterType_Filename, "filename", "File name"); +// AddParameter(ParameterType_Directory, "directory", "Directory name"); + + +// AddParameter(ParameterType_Choice, "choice", "Choice"); +// AddChoice("choice.choice1", "Choice 1"); +// AddChoice("choice.choice2", "Choice 2"); +// AddChoice("choice.choice3", "Choice 3"); +// AddParameter(ParameterType_Float, "choice.choice1.floatchoice1", "Float of choice1"); +// SetParameterFloat("choice.choice1.floatchoice1", 0.125); +// // Test a choice without associated parameter +// // AddParameter(ParameterType_Float, "choice.choice2.floatchoice2", "Float of choice2"); +// // SetParameterFloat("choice.choice2.floatchoice2", 1.0); +// AddParameter(ParameterType_Float, "choice.choice3.floatchoice3", "Float of choice3"); +// SetParameterFloat("choice.choice3.floatchoice3", 5.0); + + +// AddParameter(ParameterType_Group, "ingroup", "Input Group"); +// MandatoryOff("ingroup"); +// AddParameter(ParameterType_Float, "ingroup.integer", "Integer of Group"); +// AddParameter(ParameterType_Group, "ingroup.images", "Input Images Group"); +// AddParameter(ParameterType_InputImage, "ingroup.images.inputimage", "Input Image"); +// //AddParameter(ParameterType_InputComplexImage, "ingroup.images.inputcompleximage", "Input Complex Image"); +// //AddParameter(ParameterType_InputVectorData, "ingroup.inputvectordata", "Input Vector Data"); + +// AddParameter(ParameterType_Group, "outgroup", "Output Group"); +// AddParameter(ParameterType_OutputImage, "outgroup.outputimage", "Output Image"); +// //AddParameter(ParameterType_OutputVectorData, "outgroup.outputvectordata", "Output Vector Data"); + +// AddParameter(ParameterType_Radius, "radius", "Radius"); + +// AddParameter(ParameterType_InputImageList, "il", "Input image list"); +// MandatoryOff("il"); - AddParameter(ParameterType_ListView, "cl", "Output Image channels"); - AddChoice("cl.choice1", "cl.choice1"); - AddChoice("cl.choice2", "cl.choice2"); - MandatoryOff("cl"); +// AddParameter(ParameterType_ListView, "cl", "Output Image channels"); +// AddChoice("cl.choice1", "cl.choice1"); +// AddChoice("cl.choice2", "cl.choice2"); +// MandatoryOff("cl"); + + AddParameter(ParameterType_ComplexInputImage, "cin", "Input Complex Image"); } @@ -105,6 +107,12 @@ private: void DoExecute() { + ComplexFloatVectorImageType* myFloatVectorComplexImage = GetParameterComplexFloatVectorImage("cin"); + ComplexDoubleVectorImageType* myDoubleVectorComplexImage = GetParameterComplexDoubleVectorImage("cin"); + + ComplexFloatImageType* myFloatComplexImage = GetParameterComplexFloatImage("cin"); + ComplexDoubleImageType* myDoubleComplexImage = GetParameterComplexDoubleImage("cin"); + std::cout << "TestApplication::DoExecute" << std::endl; } }; diff --git a/Code/ApplicationEngine/otbWrapperApplication.cxx b/Code/ApplicationEngine/otbWrapperApplication.cxx index 1bf08062bc7371206a3209882695e121be1fa252..767573d43116c54884852a4f6ae103ab52ec3de7 100644 --- a/Code/ApplicationEngine/otbWrapperApplication.cxx +++ b/Code/ApplicationEngine/otbWrapperApplication.cxx @@ -22,7 +22,7 @@ #include "otbWrapperDirectoryParameter.h" #include "otbWrapperEmptyParameter.h" #include "otbWrapperFilenameParameter.h" -#include "otbWrapperInputComplexImageParameter.h" +#include "otbWrapperComplexInputImageParameter.h" #include "otbWrapperInputImageParameter.h" #include "otbWrapperInputVectorDataParameter.h" #include "otbWrapperInputVectorDataListParameter.h" @@ -461,9 +461,9 @@ void Application::SetParameterString(std::string parameter, std::string value) InputImageParameter* paramDown = dynamic_cast<InputImageParameter*>(param); paramDown->SetFromFileName(value); } - else if (dynamic_cast<InputComplexImageParameter*>(param)) + else if (dynamic_cast<ComplexInputImageParameter*>(param)) { - InputComplexImageParameter* paramDown = dynamic_cast<InputComplexImageParameter*>(param); + ComplexInputImageParameter* paramDown = dynamic_cast<ComplexInputImageParameter*>(param); paramDown->SetFromFileName(value); } else if (dynamic_cast<InputVectorDataParameter*>(param)) @@ -635,9 +635,9 @@ std::string Application::GetParameterString(std::string parameter) InputImageParameter* paramDown = dynamic_cast<InputImageParameter*>(param); ret = paramDown->GetFileName(); } - else if (dynamic_cast<InputComplexImageParameter*>(param)) + else if (dynamic_cast<ComplexInputImageParameter*>(param)) { - InputComplexImageParameter* paramDown = dynamic_cast<InputComplexImageParameter*>(param); + ComplexInputImageParameter* paramDown = dynamic_cast<ComplexInputImageParameter*>(param); ret = paramDown->GetFileName(); } else if (dynamic_cast<InputVectorDataParameter*>(param)) @@ -723,13 +723,12 @@ ComplexFloatVectorImageType* Application::GetParameterComplexImage(std::string p if (dynamic_cast<ComplexInputImageParameter*>(param)) { - InputComplexImageParameter* paramDown = dynamic_cast<InputComplexImageParameter*>(param); + ComplexInputImageParameter* paramDown = dynamic_cast<ComplexInputImageParameter*>(param); ret = paramDown->GetImage(); } //TODO: exception if not found ? return ret; - } VectorDataType* Application::GetParameterVectorData(std::string parameter) @@ -770,7 +769,7 @@ std::string Application::GetParameterAsString(std::string paramKey) if( type == ParameterType_String || type == ParameterType_Filename || type == ParameterType_Directory || type == ParameterType_InputImage - || type == ParameterType_InputComplexImage || type == ParameterType_InputVectorData + || type == ParameterType_ComplexInputImage || type == ParameterType_InputVectorData || type == ParameterType_OutputImage || type == ParameterType_OutputVectorData ) { ret = this->GetParameterString( paramKey ); diff --git a/Code/ApplicationEngine/otbWrapperInputComplexImageParameter.h b/Code/ApplicationEngine/otbWrapperInputComplexImageParameter.h deleted file mode 100644 index 6fa3ba3683f41f975c36497e33efb5434b7632ed..0000000000000000000000000000000000000000 --- a/Code/ApplicationEngine/otbWrapperInputComplexImageParameter.h +++ /dev/null @@ -1,114 +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. - -=========================================================================*/ -#ifndef __otbWrapperInputComplexImageParameter_h -#define __otbWrapperInputComplexImageParameter_h - -#include "otbImageFileReader.h" -#include "otbWrapperParameter.h" - -namespace otb -{ -namespace Wrapper -{ -/** \class InputComplexImageParameter - * \brief This class represents a InputComplexImage parameter - */ - -class ITK_EXPORT InputComplexImageParameter : public Parameter -{ -public: - /** Standard class typedef */ - typedef InputComplexImageParameter Self; - typedef Parameter Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - /** Defining ::New() static method */ - itkNewMacro(Self); - - /** RTTI support */ - itkTypeMacro(InputComplexImageParameter, Parameter); - - /** Set value from filename */ - void SetFromFileName(const std::string& filename) - { - ImageFileReaderType::Pointer reader = ImageFileReaderType::New(); - reader->SetFileName(filename); - reader->UpdateOutputInformation(); - m_Reader = reader; - m_Image = reader->GetOutput(); - SetActive(true); - } - - std::string GetFileName() const - { - if (m_Reader) - { - return m_Reader->GetFileName(); - } - - itkExceptionMacro(<< "No filename value"); - } - - ComplexFloatVectorImageType* GetImage() const - { - return m_Image; - } - - void SetImage(ComplexFloatVectorImageType* image) - { - m_Image = image; - m_Reader = ImageFileReaderType::Pointer(); - } - - bool HasValue() const - { - return m_Image.IsNotNull(); - } - - void ClearValue() - { - m_Image = ComplexFloatVectorImageType::Pointer(); - m_Reader = ImageFileReaderType::Pointer(); - } -protected: - /** Constructor */ - InputComplexImageParameter() - { - this->SetName("Input Image"); - this->SetKey("in"); - } - - /** Destructor */ - virtual ~InputComplexImageParameter() - {} - - typedef otb::ImageFileReader<ComplexFloatVectorImageType> ImageFileReaderType; - ComplexFloatVectorImageType::Pointer m_Image; - ImageFileReaderType::Pointer m_Reader; - -private: - InputComplexImageParameter(const Parameter &); //purposely not implemented - void operator =(const Parameter&); //purposely not implemented - -}; // End class InputComplexImage Parameter - -} // End namespace Wrapper -} // End namespace otb - -#endif diff --git a/Code/ApplicationEngine/otbWrapperTypes.h b/Code/ApplicationEngine/otbWrapperTypes.h index 7214f018c0d3c2c71da98eaaeae384e715645237..eb422b3165ad637ae8b3c2d6ff48d633d7af9ff7 100644 --- a/Code/ApplicationEngine/otbWrapperTypes.h +++ b/Code/ApplicationEngine/otbWrapperTypes.h @@ -41,7 +41,6 @@ typedef enum ParameterType_Choice, ParameterType_InputImage, ParameterType_InputImageList, - ParameterType_InputComplexImage, ParameterType_InputVectorData, ParameterType_InputVectorDataList, ParameterType_OutputImage, diff --git a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx index 227f5485b69f23a920b6c97d36f8771978889aaf..b443b8e24dc62cf4904995b71c58b5c5b5176262 100644 --- a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx +++ b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx @@ -22,7 +22,7 @@ #include "otbWrapperDirectoryParameter.h" #include "otbWrapperEmptyParameter.h" #include "otbWrapperFilenameParameter.h" -#include "otbWrapperInputComplexImageParameter.h" +#include "otbWrapperComplexInputImageParameter.h" #include "otbWrapperInputImageParameter.h" #include "otbWrapperInputVectorDataParameter.h" #include "otbWrapperNumericalParameter.h" @@ -440,7 +440,7 @@ CommandLineLauncher::LoadParameters() // Single value parameter if (type == ParameterType_Choice || type == ParameterType_Float || type == ParameterType_Int || type == ParameterType_Radius || type == ParameterType_Directory || type == ParameterType_String || type - == ParameterType_Filename || type == ParameterType_InputComplexImage || type == ParameterType_InputImage || + == ParameterType_Filename || type == ParameterType_ComplexInputImage || type == ParameterType_InputImage || type == ParameterType_InputVectorData || type == ParameterType_InputVectorDataList || type == ParameterType_OutputVectorData) { m_Application->SetParameterString(paramKey, values[0]); @@ -611,7 +611,7 @@ CommandLineLauncher::DisplayParameterHelp( const Parameter::Pointer & param, con { oss<<"\t Type: String (Directory path)"<<std::endl; } - else if( type == ParameterType_InputImage || type == ParameterType_InputComplexImage ) + else if( type == ParameterType_InputImage || type == ParameterType_ComplexInputImage ) { oss<<"\t Type: String (input image file name)"<<std::endl; }