Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
47c79d52
Commit
47c79d52
authored
Feb 26, 2018
by
Guillaume Pasero
Browse files
Options
Browse Files
Download
Plain Diff
MRG: Synchronize with branch develop
Conflicts: Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx
parents
2ed55283
99723cb9
Changes
55
Hide whitespace changes
Inline
Side-by-side
Showing
55 changed files
with
1455 additions
and
1234 deletions
+1455
-1234
Modules/Applications/AppClassification/app/otbPolygonClassStatistics.cxx
...tions/AppClassification/app/otbPolygonClassStatistics.cxx
+22
-6
Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx
...pplications/AppDomainTransform/app/otbDomainTransform.cxx
+1
-1
Modules/Applications/AppImageUtils/test/CMakeLists.txt
Modules/Applications/AppImageUtils/test/CMakeLists.txt
+13
-0
Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx
...tions/AppOpticalCalibration/app/otbOpticalCalibration.cxx
+2
-2
Modules/Applications/AppSARCalibration/app/otbSARCalibration.cxx
.../Applications/AppSARCalibration/app/otbSARCalibration.cxx
+1
-1
Modules/Applications/AppSARDecompositions/app/otbSARDecompositions.cxx
...cations/AppSARDecompositions/app/otbSARDecompositions.cxx
+10
-10
Modules/Applications/AppSARPolarMatrixConvert/app/otbSARPolarMatrixConvert.cxx
...AppSARPolarMatrixConvert/app/otbSARPolarMatrixConvert.cxx
+16
-16
Modules/Applications/AppSARPolarSynth/app/otbSARPolarSynth.cxx
...es/Applications/AppSARPolarSynth/app/otbSARPolarSynth.cxx
+1
-1
Modules/Applications/AppSARUtils/app/otbComputeModulusAndPhase.cxx
...pplications/AppSARUtils/app/otbComputeModulusAndPhase.cxx
+2
-2
Modules/Core/ImageBase/include/otbDefaultConvertPixelTraits.h
...les/Core/ImageBase/include/otbDefaultConvertPixelTraits.h
+48
-304
Modules/Core/ObjectList/include/otbImageList.h
Modules/Core/ObjectList/include/otbImageList.h
+2
-0
Modules/Core/ObjectList/include/otbImageList.txx
Modules/Core/ObjectList/include/otbImageList.txx
+33
-10
Modules/Core/Streaming/include/otbPipelineMemoryPrintCalculator.h
...Core/Streaming/include/otbPipelineMemoryPrintCalculator.h
+1
-1
Modules/Core/Streaming/src/otbPipelineMemoryPrintCalculator.cxx
...s/Core/Streaming/src/otbPipelineMemoryPrintCalculator.cxx
+10
-6
Modules/Filtering/ImageManipulation/include/otbClampImageFilter.h
...Filtering/ImageManipulation/include/otbClampImageFilter.h
+49
-66
Modules/Filtering/ImageManipulation/include/otbClampImageFilter.txx
...ltering/ImageManipulation/include/otbClampImageFilter.txx
+40
-76
Modules/Filtering/ImageManipulation/include/otbClampVectorImageFilter.h
...ing/ImageManipulation/include/otbClampVectorImageFilter.h
+1
-0
Modules/Filtering/ImageManipulation/include/otbConvertTypeFunctor.h
...ltering/ImageManipulation/include/otbConvertTypeFunctor.h
+243
-0
Modules/Filtering/ImageManipulation/include/otbOneRIBandImageToOneComplexBandImage.h
...pulation/include/otbOneRIBandImageToOneComplexBandImage.h
+1
-0
Modules/Filtering/ImageManipulation/include/otbRealImageToComplexImageFilter.h
...geManipulation/include/otbRealImageToComplexImageFilter.h
+1
-0
Modules/Filtering/ImageManipulation/include/otbTwoNRIBandsImageToNComplexBandsImage.h
...ulation/include/otbTwoNRIBandsImageToNComplexBandsImage.h
+1
-0
Modules/Filtering/ImageManipulation/test/CMakeLists.txt
Modules/Filtering/ImageManipulation/test/CMakeLists.txt
+5
-15
Modules/Filtering/ImageManipulation/test/otbClampImageFilter.cxx
.../Filtering/ImageManipulation/test/otbClampImageFilter.cxx
+424
-0
Modules/Filtering/ImageManipulation/test/otbImageManipulationTestDriver.cxx
...ImageManipulation/test/otbImageManipulationTestDriver.cxx
+1
-2
Modules/Filtering/ImageManipulation/test/otbOneRIBandImageToOneComplexBandImage.cxx
...ipulation/test/otbOneRIBandImageToOneComplexBandImage.cxx
+3
-2
Modules/IO/IOXML/include/otbStatisticsXMLFileWriter.txx
Modules/IO/IOXML/include/otbStatisticsXMLFileWriter.txx
+1
-1
Modules/Remote/otb-bv.remote.cmake
Modules/Remote/otb-bv.remote.cmake
+2
-2
Modules/Remote/phenotb.remote.cmake
Modules/Remote/phenotb.remote.cmake
+2
-2
Modules/Remote/temporal-gapfilling.remote.cmake
Modules/Remote/temporal-gapfilling.remote.cmake
+2
-2
Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h
...rappers/ApplicationEngine/include/otbWrapperApplication.h
+16
-25
Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexInputImageParameter.h
...tionEngine/include/otbWrapperComplexInputImageParameter.h
+25
-39
Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexInputImageParameter.txx
...onEngine/include/otbWrapperComplexInputImageParameter.txx
+23
-32
Modules/Wrappers/ApplicationEngine/include/otbWrapperComplexOutputImageParameter.h
...ionEngine/include/otbWrapperComplexOutputImageParameter.h
+4
-9
Modules/Wrappers/ApplicationEngine/include/otbWrapperInputImageParameter.h
...ApplicationEngine/include/otbWrapperInputImageParameter.h
+21
-68
Modules/Wrappers/ApplicationEngine/include/otbWrapperInputImageParameter.txx
...plicationEngine/include/otbWrapperInputImageParameter.txx
+36
-32
Modules/Wrappers/ApplicationEngine/include/otbWrapperOutputImageParameter.h
...pplicationEngine/include/otbWrapperOutputImageParameter.h
+9
-18
Modules/Wrappers/ApplicationEngine/include/otbWrapperTypes.h
Modules/Wrappers/ApplicationEngine/include/otbWrapperTypes.h
+13
-1
Modules/Wrappers/ApplicationEngine/src/CMakeLists.txt
Modules/Wrappers/ApplicationEngine/src/CMakeLists.txt
+0
-7
Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexInputImageParameter.cxx
...cationEngine/src/otbWrapperComplexInputImageParameter.cxx
+44
-8
Modules/Wrappers/ApplicationEngine/src/otbWrapperComplexOutputImageParameter.cxx
...ationEngine/src/otbWrapperComplexOutputImageParameter.cxx
+69
-45
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameter.cxx
...s/ApplicationEngine/src/otbWrapperInputImageParameter.cxx
+11
-0
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterDouble.cxx
...icationEngine/src/otbWrapperInputImageParameterDouble.cxx
+0
-37
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterFloat.cxx
...licationEngine/src/otbWrapperInputImageParameterFloat.cxx
+0
-37
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterInt16.cxx
...licationEngine/src/otbWrapperInputImageParameterInt16.cxx
+0
-37
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterInt32.cxx
...licationEngine/src/otbWrapperInputImageParameterInt32.cxx
+0
-37
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterMacros.h
...plicationEngine/src/otbWrapperInputImageParameterMacros.h
+3
-16
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt16.cxx
...icationEngine/src/otbWrapperInputImageParameterUInt16.cxx
+0
-37
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt32.cxx
...icationEngine/src/otbWrapperInputImageParameterUInt32.cxx
+0
-37
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt8.cxx
...licationEngine/src/otbWrapperInputImageParameterUInt8.cxx
+0
-37
Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputImageParameter.cxx
.../ApplicationEngine/src/otbWrapperOutputImageParameter.cxx
+172
-146
Modules/Wrappers/ApplicationEngine/test/CMakeLists.txt
Modules/Wrappers/ApplicationEngine/test/CMakeLists.txt
+6
-0
Modules/Wrappers/ApplicationEngine/test/otbApplicationEngineTestDriver.cxx
...ApplicationEngine/test/otbApplicationEngineTestDriver.cxx
+1
-0
Modules/Wrappers/ApplicationEngine/test/otbWrapperOutputImageParameterTest.cxx
...icationEngine/test/otbWrapperOutputImageParameterTest.cxx
+58
-1
Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetComplexOutputImageParameter.cxx
...get/src/otbWrapperQtWidgetComplexOutputImageParameter.cxx
+2
-0
Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetOutputImageParameter.cxx
...s/QtWidget/src/otbWrapperQtWidgetOutputImageParameter.cxx
+4
-0
No files found.
Modules/Applications/AppClassification/app/otbPolygonClassStatistics.cxx
View file @
47c79d52
...
...
@@ -76,7 +76,7 @@ private:
SetDocName
(
"Polygon Class Statistics"
);
SetDocLongDescription
(
"The application processes a set of geometries "
"intended for training (they should have a field giving the associated "
"class). The geometries are analy
s
ed against a support image to compute "
"class). The geometries are analy
z
ed against a support image to compute "
"statistics :
\n
"
" - number of samples per class
\n
"
" - number of samples per geometry
\n
"
...
...
@@ -92,17 +92,17 @@ private:
AddDocTag
(
Tags
::
Learning
);
AddParameter
(
ParameterType_InputImage
,
"in"
,
"Input
I
mage"
);
AddParameter
(
ParameterType_InputImage
,
"in"
,
"Input
i
mage"
);
SetParameterDescription
(
"in"
,
"Support image that will be classified"
);
AddParameter
(
ParameterType_InputImage
,
"mask"
,
"Input
M
ask"
);
AddParameter
(
ParameterType_InputImage
,
"mask"
,
"Input
validity m
ask"
);
SetParameterDescription
(
"mask"
,
"Validity mask (only pixels corresponding to a mask value greater than 0 will be used for statistics)"
);
MandatoryOff
(
"mask"
);
AddParameter
(
ParameterType_InputFilename
,
"vec"
,
"Input vectors"
);
SetParameterDescription
(
"vec"
,
"Input geometries to analy
s
e"
);
SetParameterDescription
(
"vec"
,
"Input geometries to analy
z
e"
);
AddParameter
(
ParameterType_OutputFilename
,
"out"
,
"Output
S
tatistics"
);
AddParameter
(
ParameterType_OutputFilename
,
"out"
,
"Output
XML s
tatistics
file
"
);
SetParameterDescription
(
"out"
,
"Output file to store statistics (XML format)"
);
AddParameter
(
ParameterType_ListView
,
"field"
,
"Field Name"
);
...
...
@@ -155,6 +155,22 @@ private:
}
}
}
// Check that the extension of the output parameter is XML (mandatory for
// StatisticsXMLFileWriter)
// Check it here to trigger the error before polygons analysis
if
(
HasValue
(
"out"
)
)
{
// Store filename extension
// Check that the right extension is given : expected .xml
const
std
::
string
extension
=
itksys
::
SystemTools
::
GetFilenameLastExtension
(
this
->
GetParameterString
(
"out"
));
if
(
itksys
::
SystemTools
::
LowerCase
(
extension
)
!=
".xml"
)
{
otbAppLogFATAL
(
<<
extension
<<
" is a wrong extension for parameter
\"
out
\"
: Expected .xml"
);
}
}
}
void
DoExecute
()
ITK_OVERRIDE
...
...
@@ -223,7 +239,7 @@ private:
filter
->
SetLayerIndex
(
this
->
GetParameterInt
(
"layer"
));
filter
->
GetStreamer
()
->
SetAutomaticAdaptativeStreaming
(
GetParameterInt
(
"ram"
));
AddProcess
(
filter
->
GetStreamer
(),
"Analy
s
e polygons..."
);
AddProcess
(
filter
->
GetStreamer
(),
"Analy
z
e polygons..."
);
filter
->
Update
();
FilterType
::
ClassCountMapType
&
classCount
=
filter
->
GetClassCountOutput
()
->
Get
();
...
...
Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx
View file @
47c79d52
...
...
@@ -264,7 +264,7 @@ private:
{
// fft ttransform
bool
shift
=
GetParameterInt
(
"mode.fft.shift"
);
typedef
otb
::
Image
<
std
::
complex
<
OutputPixelType
>
>
ComplexOutputImageType
;
typedef
otb
::
Image
<
std
::
complex
<
OutputPixelType
>
>
ComplexOutputImageType
;
if
(
dir
==
0
)
{
...
...
Modules/Applications/AppImageUtils/test/CMakeLists.txt
View file @
47c79d52
...
...
@@ -173,6 +173,14 @@ otb_test_application(NAME apTvUtExtractROIRightInputFile
${
INPUTDATA
}
/couleurs_extrait.png
${
TEMP
}
/apTvUtExtractROIRightInputFile.tif
)
otb_test_application
(
NAME apTvUtExtractROIComplexInputFile
APP ExtractROI
OPTIONS -in
${
INPUTDATA
}
/complexInputCfloat.tif
-out
${
TEMP
}
/apTvUtExtractROIComplexInputFile.tif cfloat
VALID --compare-image
${
NOTOL
}
${
INPUTDATA
}
/complexInputCfloat.tif
${
TEMP
}
/apTvUtExtractROIComplexInputFile.tif
)
#----------- Rescale TESTS ----------------
otb_test_application
(
NAME apTvUtRescaleTest
...
...
@@ -207,6 +215,11 @@ otb_test_application(NAME apTuUtReadImageInfoExtendedFilename_reader
OPTIONS -in
${
INPUTDATA
}
/ToulouseExtract_WithGeom.tif?&skipgeom=true&skipcarto=true
)
otb_test_application
(
NAME apTuUtReadComplexImageInfoFilename_reader
APP ReadImageInfo
OPTIONS -in
${
INPUTDATA
}
/complexInputCfloat.tif
)
set
(
TESTNAME
"gd-pleiades-1"
#LARGEINPUT{PLEIADES/TLSE_JP2_DIMAPv2_PRIMARY_PMS_lossless_12bits/IMGPHR_201222215194743808/IMG_PHR1A_PMS_201201151100183_SEN_IPU_20120222_0901-001_R1C1.JP2}
...
...
Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx
View file @
47c79d52
...
...
@@ -29,7 +29,7 @@
#include "otbReflectanceToRadianceImageFilter.h"
#include "otbReflectanceToSurfaceReflectanceImageFilter.h"
#include "itkMultiplyImageFilter.h"
#include "otbClamp
Vector
ImageFilter.h"
#include "otbClampImageFilter.h"
#include "otbSurfaceAdjacencyEffectCorrectionSchemeFilter.h"
#include "otbGroundSpacingImageFunction.h"
#include "vnl/vnl_random.h"
...
...
@@ -92,7 +92,7 @@ public:
typedef
itk
::
MultiplyImageFilter
<
DoubleVectorImageType
,
DoubleImageType
,
DoubleVectorImageType
>
ScaleFilterOutDoubleType
;
typedef
otb
::
Clamp
Vector
ImageFilter
<
DoubleVectorImageType
,
typedef
otb
::
ClampImageFilter
<
DoubleVectorImageType
,
DoubleVectorImageType
>
ClampFilterType
;
typedef
ReflectanceToSurfaceReflectanceImageFilter
<
DoubleVectorImageType
,
...
...
Modules/Applications/AppSARCalibration/app/otbSARCalibration.cxx
View file @
47c79d52
...
...
@@ -60,7 +60,7 @@ private:
AddDocTag
(
Tags
::
Calibration
);
AddDocTag
(
Tags
::
SAR
);
AddParameter
(
ParameterType_
Complex
InputImage
,
"in"
,
"Input Image"
);
AddParameter
(
ParameterType_InputImage
,
"in"
,
"Input Image"
);
SetParameterDescription
(
"in"
,
"Input complex image"
);
AddParameter
(
ParameterType_OutputImage
,
"out"
,
"Output Image"
);
...
...
Modules/Applications/AppSARDecompositions/app/otbSARDecompositions.cxx
View file @
47c79d52
...
...
@@ -31,7 +31,7 @@
#include "otbSinclairToReciprocalCoherencyMatrixFunctor.h"
#include "otbPerBandVectorImageFilter.h"
#include "itkMeanImageFilter.h"
#include "otbNRIBandImagesToOneNComplexBandsImage.h"
//
#include "otbNRIBandImagesToOneNComplexBandsImage.h"
#include "otbImageListToVectorImageFilter.h"
#include "otbImageList.h"
...
...
@@ -109,21 +109,21 @@ private:
AddDocTag
(
Tags
::
SAR
);
AddParameter
(
ParameterType_
Complex
InputImage
,
"inhh"
,
"Input Image"
);
AddParameter
(
ParameterType_InputImage
,
"inhh"
,
"Input Image"
);
SetParameterDescription
(
"inhh"
,
"Input image (HH)"
);
AddParameter
(
ParameterType_
Complex
InputImage
,
"inhv"
,
"Input Image"
);
AddParameter
(
ParameterType_InputImage
,
"inhv"
,
"Input Image"
);
SetParameterDescription
(
"inhv"
,
"Input image (HV)"
);
MandatoryOff
(
"inhv"
);
AddParameter
(
ParameterType_
Complex
InputImage
,
"invh"
,
"Input Image"
);
AddParameter
(
ParameterType_InputImage
,
"invh"
,
"Input Image"
);
SetParameterDescription
(
"invh"
,
"Input image (VH)"
);
MandatoryOff
(
"invh"
);
AddParameter
(
ParameterType_
Complex
InputImage
,
"invv"
,
"Input Image"
);
AddParameter
(
ParameterType_InputImage
,
"invv"
,
"Input Image"
);
SetParameterDescription
(
"invv"
,
"Input image (VV)"
);
AddParameter
(
ParameterType_
Complex
OutputImage
,
"out"
,
"Output Image"
);
AddParameter
(
ParameterType_OutputImage
,
"out"
,
"Output Image"
);
SetParameterDescription
(
"out"
,
"Output image"
);
AddParameter
(
ParameterType_Choice
,
"decomp"
,
"Decompositions"
);
...
...
@@ -201,7 +201,7 @@ private:
m_MeanFilter
->
SetInput
(
m_SRFilter
->
GetOutput
());
m_HAFilter
->
SetInput
(
m_MeanFilter
->
GetOutput
());
SetParameter
Complex
OutputImage
(
"out"
,
m_HAFilter
->
GetOutput
()
);
SetParameterOutputImage
(
"out"
,
m_HAFilter
->
GetOutput
()
);
break
;
...
...
@@ -220,7 +220,7 @@ private:
m_MeanFilter
->
SetInput
(
m_SRFilter
->
GetOutput
());
m_BarnesFilter
->
SetInput
(
m_MeanFilter
->
GetOutput
());
SetParameter
Complex
OutputImage
(
"out"
,
m_BarnesFilter
->
GetOutput
()
);
SetParameterOutputImage
(
"out"
,
m_BarnesFilter
->
GetOutput
()
);
break
;
...
...
@@ -239,7 +239,7 @@ private:
m_MeanFilter
->
SetInput
(
m_SRFilter
->
GetOutput
());
m_HuynenFilter
->
SetInput
(
m_MeanFilter
->
GetOutput
());
SetParameter
Complex
OutputImage
(
"out"
,
m_HuynenFilter
->
GetOutput
()
);
SetParameterOutputImage
(
"out"
,
m_HuynenFilter
->
GetOutput
()
);
break
;
...
...
@@ -257,7 +257,7 @@ private:
m_Concatener
->
SetInput
(
m_ImageList
);
m_PauliFilter
->
SetInput
(
m_Concatener
->
GetOutput
());
SetParameter
Complex
OutputImage
(
"out"
,
m_PauliFilter
->
GetOutput
()
);
SetParameterOutputImage
(
"out"
,
m_PauliFilter
->
GetOutput
()
);
break
;
}
...
...
Modules/Applications/AppSARPolarMatrixConvert/app/otbSARPolarMatrixConvert.cxx
View file @
47c79d52
...
...
@@ -232,7 +232,7 @@ private:
AddDocTag
(
Tags
::
SAR
);
AddParameter
(
ParameterType_
Complex
InputImage
,
"inc"
,
"Input : multi-band complex image"
);
AddParameter
(
ParameterType_InputImage
,
"inc"
,
"Input : multi-band complex image"
);
SetParameterDescription
(
"inc"
,
"Input : multi-band complex image"
);
MandatoryOff
(
"inc"
);
...
...
@@ -241,23 +241,23 @@ private:
MandatoryOff
(
"inf"
);
AddParameter
(
ParameterType_
Complex
InputImage
,
"inhh"
,
"Input : one-band complex image (HH)"
);
AddParameter
(
ParameterType_InputImage
,
"inhh"
,
"Input : one-band complex image (HH)"
);
SetParameterDescription
(
"inhh"
,
"Input : one-band complex image (HH)"
);
MandatoryOff
(
"inhh"
);
AddParameter
(
ParameterType_
Complex
InputImage
,
"inhv"
,
"Input : one-band complex image (HV)"
);
AddParameter
(
ParameterType_InputImage
,
"inhv"
,
"Input : one-band complex image (HV)"
);
SetParameterDescription
(
"inhv"
,
"Input : one-band complex image (HV)"
);
MandatoryOff
(
"inhv"
);
AddParameter
(
ParameterType_
Complex
InputImage
,
"invh"
,
"Input : one-band complex image (VH)"
);
AddParameter
(
ParameterType_InputImage
,
"invh"
,
"Input : one-band complex image (VH)"
);
SetParameterDescription
(
"invh"
,
"Input : one-band complex image (VH)"
);
MandatoryOff
(
"invh"
);
AddParameter
(
ParameterType_
Complex
InputImage
,
"invv"
,
"Input : one-band complex image (VV)"
);
AddParameter
(
ParameterType_InputImage
,
"invv"
,
"Input : one-band complex image (VV)"
);
SetParameterDescription
(
"invv"
,
"Input : one-band complex image (VV)"
);
MandatoryOff
(
"invv"
);
AddParameter
(
ParameterType_
Complex
OutputImage
,
"outc"
,
"Output Complex Image"
);
AddParameter
(
ParameterType_OutputImage
,
"outc"
,
"Output Complex Image"
);
SetParameterDescription
(
"outc"
,
"Output Complex image."
);
MandatoryOff
(
"outc"
);
...
...
@@ -509,7 +509,7 @@ private:
m_RCohSRFilter
->
SetInputHH
(
GetParameterComplexDoubleImage
(
"inhh"
));
m_RCohSRFilter
->
SetInputVV
(
GetParameterComplexDoubleImage
(
"invv"
));
SetParameter
Complex
OutputImage
(
"outc"
,
m_RCohSRFilter
->
GetOutput
()
);
// input : 3 x 1 complex channel | output : 6 complex channels
SetParameterOutputImage
(
"outc"
,
m_RCohSRFilter
->
GetOutput
()
);
// input : 3 x 1 complex channel | output : 6 complex channels
break
;
...
...
@@ -526,7 +526,7 @@ private:
m_RCovSRFilter
->
SetInputHH
(
GetParameterComplexDoubleImage
(
"inhh"
));
m_RCovSRFilter
->
SetInputVV
(
GetParameterComplexDoubleImage
(
"invv"
));
SetParameter
Complex
OutputImage
(
"outc"
,
m_RCovSRFilter
->
GetOutput
()
);
// input : 3 x 1 complex channel | output : 6 complex channels
SetParameterOutputImage
(
"outc"
,
m_RCovSRFilter
->
GetOutput
()
);
// input : 3 x 1 complex channel | output : 6 complex channels
break
;
...
...
@@ -544,7 +544,7 @@ private:
m_RCCSRFilter
->
SetInputHH
(
GetParameterComplexDoubleImage
(
"inhh"
));
m_RCCSRFilter
->
SetInputVV
(
GetParameterComplexDoubleImage
(
"invv"
));
SetParameter
Complex
OutputImage
(
"outc"
,
m_RCCSRFilter
->
GetOutput
()
);
// input : 3 x 1 complex channel | output : 6 complex channels
SetParameterOutputImage
(
"outc"
,
m_RCCSRFilter
->
GetOutput
()
);
// input : 3 x 1 complex channel | output : 6 complex channels
break
;
...
...
@@ -565,7 +565,7 @@ private:
m_RCCDFilter
=
RCCDFilterType
::
New
();
m_RCCDFilter
->
SetInput
(
GetParameterComplexDoubleVectorImage
(
"inc"
));
SetParameter
Complex
OutputImage
(
"outc"
,
m_RCCDFilter
->
GetOutput
()
);
// input : 6 complex channels | 3 complex channels
SetParameterOutputImage
(
"outc"
,
m_RCCDFilter
->
GetOutput
()
);
// input : 6 complex channels | 3 complex channels
break
;
...
...
@@ -575,7 +575,7 @@ private:
m_RCRCFilter
=
RCRCFilterType
::
New
();
m_RCRCFilter
->
SetInput
(
GetParameterComplexDoubleVectorImage
(
"inc"
));
SetParameter
Complex
OutputImage
(
"outc"
,
m_RCRCFilter
->
GetOutput
()
);
// input : 6 complex channels | 6 complex channels
SetParameterOutputImage
(
"outc"
,
m_RCRCFilter
->
GetOutput
()
);
// input : 6 complex channels | 6 complex channels
break
;
...
...
@@ -586,7 +586,7 @@ private:
m_RLCRCCFilter
=
RLCRCCFilterType
::
New
();
m_RLCRCCFilter
->
SetInput
(
GetParameterComplexDoubleVectorImage
(
"inc"
));
SetParameter
Complex
OutputImage
(
"outc"
,
m_RLCRCCFilter
->
GetOutput
()
);
// input : 6 complex channels | output : 6 complex channels
SetParameterOutputImage
(
"outc"
,
m_RLCRCCFilter
->
GetOutput
()
);
// input : 6 complex channels | output : 6 complex channels
break
;
...
...
@@ -597,7 +597,7 @@ private:
m_MRCFilter
->
SetInput
(
GetParameterDoubleVectorImage
(
"inf"
));
SetParameter
Complex
OutputImage
(
"outc"
,
m_MRCFilter
->
GetOutput
()
);
// input : 16 real channels | output : 6 complex channels
SetParameterOutputImage
(
"outc"
,
m_MRCFilter
->
GetOutput
()
);
// input : 16 real channels | output : 6 complex channels
break
;
...
...
@@ -615,7 +615,7 @@ private:
m_CohSRFilter
->
SetInputVH
(
GetParameterComplexDoubleImage
(
"invh"
));
m_CohSRFilter
->
SetInputVV
(
GetParameterComplexDoubleImage
(
"invv"
));
SetParameter
Complex
OutputImage
(
"outc"
,
m_CohSRFilter
->
GetOutput
()
);
// input : 4 x 1 complex channel | 10 complex channels
SetParameterOutputImage
(
"outc"
,
m_CohSRFilter
->
GetOutput
()
);
// input : 4 x 1 complex channel | 10 complex channels
break
;
...
...
@@ -630,7 +630,7 @@ private:
m_CovSRFilter
->
SetInputVH
(
GetParameterComplexDoubleImage
(
"invh"
));
m_CovSRFilter
->
SetInputVV
(
GetParameterComplexDoubleImage
(
"invv"
));
SetParameter
Complex
OutputImage
(
"outc"
,
m_CovSRFilter
->
GetOutput
()
);
// input : 4 x 1 complex channel | output : 10 complex channels
SetParameterOutputImage
(
"outc"
,
m_CovSRFilter
->
GetOutput
()
);
// input : 4 x 1 complex channel | output : 10 complex channels
break
;
...
...
@@ -644,7 +644,7 @@ private:
m_CCSRFilter
->
SetInputVH
(
GetParameterComplexDoubleImage
(
"invh"
));
m_CCSRFilter
->
SetInputVV
(
GetParameterComplexDoubleImage
(
"invv"
));
SetParameter
Complex
OutputImage
(
"outc"
,
m_CCSRFilter
->
GetOutput
()
);
// input : 4 x 1 complex channel | output : 10 complex channels
SetParameterOutputImage
(
"outc"
,
m_CCSRFilter
->
GetOutput
()
);
// input : 4 x 1 complex channel | output : 10 complex channels
break
;
...
...
Modules/Applications/AppSARPolarSynth/app/otbSARPolarSynth.cxx
View file @
47c79d52
...
...
@@ -86,7 +86,7 @@ private:
AddDocTag
(
Tags
::
SAR
);
AddParameter
(
ParameterType_
Complex
InputImage
,
"in"
,
"Input Image"
);
AddParameter
(
ParameterType_InputImage
,
"in"
,
"Input Image"
);
SetParameterDescription
(
"in"
,
"Input image."
);
AddParameter
(
ParameterType_OutputImage
,
"out"
,
"Output Image"
);
SetParameterDescription
(
"out"
,
"Output image."
);
...
...
Modules/Applications/AppSARUtils/app/otbComputeModulusAndPhase.cxx
View file @
47c79d52
...
...
@@ -75,7 +75,7 @@ private:
AddDocTag
(
Tags
::
SAR
);
AddDocTag
(
Tags
::
Manip
);
// Input images
AddParameter
(
ParameterType_
Complex
InputImage
,
"in"
,
"Input Image"
);
AddParameter
(
ParameterType_InputImage
,
"in"
,
"Input Image"
);
SetParameterDescription
(
"in"
,
"Input image (complex single band)"
);
// Outputs
...
...
@@ -110,7 +110,7 @@ private:
m_Modulus
=
ModulusFilterType
::
New
();
m_Phase
=
PhaseFilterType
::
New
();
ComplexFloatVectorImageType
::
Pointer
inImage
=
GetParameterComplexImage
(
"in"
);
ComplexFloatVectorImageType
::
Pointer
inImage
=
GetParameterComplex
FloatVector
Image
(
"in"
);
if
(
inImage
->
GetNumberOfComponentsPerPixel
()
!=
1
)
{
...
...
Modules/Core/ImageBase/include/otbDefaultConvertPixelTraits.h
View file @
47c79d52
/*
* Copyright (C) 1999-2011 Insight Software Consortium
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
...
...
@@ -19,322 +18,67 @@
* limitations under the License.
*/
#ifndef otbDefaultConvertPixelTraits_h
#define otbDefaultConvertPixelTraits_h
#include "itkOffset.h"
#include "itkVector.h"
#include "itkMatrix.h"
#include "itkDefaultConvertPixelTraits.h"
namespace
otb
namespace
otb
{
/** \class DefaultConvertPixelTraits
* \brief Traits class used to by ConvertPixels to convert blocks of pixels.
*
* TOutputPixelType is the destination type. The input type is inferred
* by the templated static function Convert.
*
* This implementation does a simple assignment operator, so if you are
* going from a higher bit representation to a lower bit one (int to
* char), you may want to specialize and add some sort of transfer function.
*
* \ingroup OTBImageBase
*/
template
<
typename
PixelType
>
class
DefaultConvertPixelTraits
template
<
typename
PixelType
>
class
DefaultConvertPixelTraits
:
public
itk
::
DefaultConvertPixelTraits
<
PixelType
>
{
public:
/** Determine the pixel data type. */
typedef
typename
PixelType
::
ComponentType
ComponentType
;
/** Return the number of components per pixel. */
static
unsigned
int
GetNumberOfComponents
()
{
return
PixelType
::
GetNumberOfComponents
();
}
/** Return the nth component of the pixel. */
static
ComponentType
GetNthComponent
(
int
c
,
const
PixelType
&
pixel
)
{
return
pixel
.
GetNthComponent
(
c
);
}
/** Set the nth component of the pixel. */
static
void
SetNthComponent
(
int
c
,
PixelType
&
pixel
,
const
ComponentType
&
v
)
{
pixel
.
SetNthComponent
(
c
,
v
);
}
static
void
SetNthComponent
(
int
itkNotUsed
(
c
),
PixelType
&
pixel
,
const
PixelType
&
v
)
{
pixel
=
v
;
}
typedef
itk
::
DefaultConvertPixelTraits
<
PixelType
>
SuperClass
;
using
typename
SuperClass
::
ComponentType
;
/** Return a single scalar value from this pixel. */
static
ComponentType
GetScalarValue
(
const
PixelType
&
pixel
)
{
return
pixel
.
GetScalarValue
();
}
using
SuperClass
::
SetNthComponent
;
static
void
SetNthComponent
(
int
,
PixelType
&
pixel
,
const
PixelType
&
v
)
{
pixel
=
v
;
}
};
#define OTB_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL(type) \
template<> \
class DefaultConvertPixelTraits<type> \
{ \
public: \
typedef type ComponentType; \
static unsigned int GetNumberOfComponents() \
{ \
return 1; \
} \
static void SetNthComponent(int , type& pixel, const ComponentType& v) \
{ \
pixel = v; \
} \
static type GetScalarValue(const type& pixel) \
{ \
return pixel; \
} \
};
OTB_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL
(
float
)
OTB_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL
(
double
)
OTB_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL
(
int
)
OTB_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL
(
char
)
OTB_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL
(
short
)
OTB_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL
(
unsigned
int
)
OTB_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL
(
signed
char
)
OTB_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL
(
unsigned
char
)
OTB_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL
(
unsigned
short
)
OTB_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL
(
long
)
OTB_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL
(
unsigned
long
)
OTB_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL
(
bool
)
#undef OTB_DEFAULTCONVERTTRAITS_NATIVE_SPECIAL
//
// Default traits for the Offset<> pixel type
//
template
<
typename
T
>
class
DefaultConvertPixelTraits
<
::
std
::
complex
<
T
>
>
:
public
itk
::
DefaultConvertPixelTraits
<
::
std
::
complex
<
T
>
>
{
public:
#define OTB_DEFAULTCONVERTTRAITS_OFFSET_TYPE(dimension) \
template<> \
class DefaultConvertPixelTraits< itk::Offset<dimension> > \
{ \
public: \
typedef itk::Offset<dimension> TargetType; \
typedef TargetType::OffsetValueType ComponentType; \
static unsigned int GetNumberOfComponents() \
{ \
return dimension; \
} \
static void SetNthComponent(int i, TargetType & pixel, const ComponentType& v) \
{ \
pixel[i] = v; \
} \
static void SetNthComponent(int , TargetType & pixel, const TargetType& v) \
{ \
pixel = v; \
} \
static ComponentType GetScalarValue(const TargetType& pixel) \
{ \
return pixel[0]; \
} \
typedef
itk
::
DefaultConvertPixelTraits
<
::
std
::
complex
<
T
>
>
SuperClass
;
using
typename
SuperClass
::
TargetType
;
using
typename
SuperClass
::
ComponentType
;
using
SuperClass
::
SetNthComponent
;
static
void
SetNthComponent
(
int
,
TargetType
&
pixel
,
const
TargetType
&
v
)
{
pixel
=
v
;
}
static
TargetType
GetNthComponent
(
int
,
const
TargetType
&
pixel
)
{
return
pixel
;
}
static
ComponentType
GetScalarValue
(
const
TargetType
&
pixel
)
{
/*
* This seems to be dead code, since the complex to scalar
* conversion is done by ConvertPixelBuffer
*
* Historically, it was returning std::norm, which causes
* compilation error on MacOSX 10.9.
* Now returns the equivalent implementation of std::norm.
*/
return
static_cast
<
ComponentType
>
(
pixel
.
real
()
*
pixel
.
real
()
+
pixel
.
imag
()
*
pixel
.
imag
()
);
}
};
// Define traits for Offset<> from dimensions 1 to 5
OTB_DEFAULTCONVERTTRAITS_OFFSET_TYPE
(
1
)
OTB_DEFAULTCONVERTTRAITS_OFFSET_TYPE
(
2
)
OTB_DEFAULTCONVERTTRAITS_OFFSET_TYPE
(
3
)
OTB_DEFAULTCONVERTTRAITS_OFFSET_TYPE
(
4
)
OTB_DEFAULTCONVERTTRAITS_OFFSET_TYPE
(
5
)
//
// Default traits for the pixel types deriving from FixedArray<>
//
#define OTB_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE(type,componenttype, dimension) \
template<> \
class DefaultConvertPixelTraits< type< componenttype, dimension> > \
{ \
public: \
typedef type< componenttype, dimension > TargetType; \
typedef componenttype ComponentType; \
static unsigned int GetNumberOfComponents() \
{ \
return dimension; \
} \
static void SetNthComponent(int i, TargetType & pixel, const ComponentType& v) \
{ \
pixel[i] = v; \
} \
static void SetNthComponent(int , TargetType & pixel, const TargetType& v) \
{ \
pixel = v; \
} \
static ComponentType GetScalarValue(const TargetType& pixel) \
{ \
return pixel[0]; \
} \
}; \
//
//
// Define traits for Classed deriving from FixedArray from dimensions 1 to 6
// These classes include: Vector, CovariantVector and Point.
//
//
#define OTB_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE_ALL_MACRO(ArrayType, Type) \
OTB_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE(ArrayType,Type,1) \
OTB_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE(ArrayType,Type,2) \
OTB_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE(ArrayType,Type,3) \
OTB_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE(ArrayType,Type,4) \
OTB_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE(ArrayType,Type,5) \
OTB_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE(ArrayType,Type,6)
#define OTB_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE_ALL_TYPES_MACRO(ArrayType) \
OTB_DEFAULTCONVERTTRAITS_FIXEDARRAY_TYPE_ALL_MACRO(ArrayType, char); \